/* =====================================================================================================
   Appearance: what appearance.js's data attributes on <html> do. A setting at its standard value sets no attribute, so
   with nothing chosen none of this applies and the screens are exactly what theme.css, styles.css and shell.css draw.

   Colours, the font and the corner scale are not here: appearance.js writes them as custom properties (--vs-amber,
   --font, --rs ...) into <style id="look-css">, and the other stylesheets read them. This file holds only shapes and
   sizes, and (like every stylesheet) no colour literal: colours come from the theme tokens.
   ===================================================================================================== */

/* ---- text size: every size in rem follows the root size */
html[data-ts="small"], html[data-ts="small"] body { font-size: 13px; }
html[data-ts="large"], html[data-ts="large"] body { font-size: 16px; }

/* ---- density: how much air there is around rows, buttons, fields and menu lines */
html[data-density="compact"] table.data th, html[data-density="compact"] table.data td { padding-top: .26rem; padding-bottom: .26rem; }
html[data-density="compact"] .btn { padding: .24rem .65rem; }
html[data-density="compact"] :is(input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"]:not(.desk-search):not(.ui-search-input), input[type="date"], select, textarea) { padding-top: .26rem; padding-bottom: .26rem; margin-bottom: .35rem; }
html[data-density="compact"] .side .menu-btn, html[data-density="compact"] .side .menu-list button { min-height: 30px; }
html[data-density="compact"] .side .menu-btn { padding-top: 4px; padding-bottom: 4px; }

/* ---- icon weight: one stroke for every icon (the few tiny tick marks keep their own) */
html[data-iw="light"] :is(svg.menu-ico, .rail-ico svg, .tile-ico svg, .find-ico svg, .tile-tip svg, .app-menu button svg) { stroke-width: 1.2 !important; }
html[data-iw="bold"] :is(svg.menu-ico, .rail-ico svg, .tile-ico svg, .find-ico svg, .tile-tip svg, .app-menu button svg) { stroke-width: 2.3 !important; }
html[data-iw] .wall-tick .menu-ico { stroke-width: 3 !important; }

/* ---- app tiles on All apps: block (the standard), soft tint, outline, or the bare icon; rounded or circular */
html[data-tile="soft"] .tile-ico:not(.muted) { background: var(--amber-soft); color: var(--amber-ink); }
html[data-tile="outline"] .tile-ico:not(.muted) { background: transparent; color: var(--amber-ink); box-shadow: inset 0 0 0 2px var(--amber-ink); }
html[data-tile="plain"] .tile-ico:not(.muted) { background: transparent; color: var(--amber-ink); }
html[data-shape="circle"] .tile-ico { border-radius: 50%; }

/* ---- tile size */
html[data-tilesize="small"] .tile-grid { grid-template-columns: repeat(auto-fill, minmax(min(92px, 100%), 92px)); gap: 10px; }
html[data-tilesize="small"] .tile-ico { width: 36px; height: 36px; }
html[data-tilesize="small"] .tile-ico svg { width: 18px; height: 18px; }
html[data-tilesize="small"] .tile-name { font-size: .72rem; }
html[data-tilesize="large"] .tile-grid { grid-template-columns: repeat(auto-fill, minmax(min(148px, 100%), 148px)); gap: 16px; }
html[data-tilesize="large"] .tile-ico { width: 58px; height: 58px; }
html[data-tilesize="large"] .tile-ico svg { width: 29px; height: 29px; }
html[data-tilesize="large"] .tile-name { font-size: .9rem; }
html[data-tilesize="large"] .desk.launch { max-width: 1400px; }

/* ---- a centred page: the content keeps a comfortable width on a wide screen; the header band still runs edge to edge */
html[data-width="centered"] .page { --page-px: max(1rem, calc((100% - 1180px) / 2)); padding-inline: var(--page-px); }
html[data-width="centered"] :is(.page > .page-head, .page > .ctrl, .browse) { margin-inline: calc(-1 * var(--page-px)); padding-inline: var(--page-px); }

/* ---- apps along the top: the rail becomes a bar above the menu and the page (the way it already does on a phone) */
@media (min-width: 641px) {
  html[data-bar="top"] { --rail-w: 0px; }
  html[data-bar="top"] #app-view { flex-direction: column; }
  html[data-bar="top"] .rail { flex: none; width: 100%; flex-direction: row; align-items: center; padding: 6px 10px; gap: 2px; overflow-x: auto; overflow-y: hidden; }
  html[data-bar="top"] .rail-brand { margin: 0 8px 0 0; width: 38px; height: 38px; }
  html[data-bar="top"] .rail-apps, html[data-bar="top"] .rail-foot { flex-direction: row; width: auto; }
  html[data-bar="top"] .rail-foot { border-top: 0; border-left: 1px solid var(--rail-hi); padding: 0 0 0 6px; margin: 0 0 0 4px; }
  html[data-bar="top"] .rail-sp { display: block; flex: 1; min-width: 8px; }
  html[data-bar="top"] .rail-item { flex: none; width: 66px; min-height: 48px; }
  html[data-bar="top"] .rail-item.on::before { left: 10px; right: 10px; top: auto; bottom: -5px; width: auto; height: 3px; border-radius: calc(2px * var(--rs)); }
  html[data-bar="top"] .main-col { height: auto; flex: 1; min-height: 0; }
}
@media (min-width: 1001px) {
  /* menu and page share the row under the bar */
  html[data-bar="top"] #app-view { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  html[data-bar="top"] .rail { grid-column: 1 / -1; grid-row: 1; }
  html[data-bar="top"] .skip-link { position: absolute; }
  html[data-bar="top"] .side { grid-column: 1; grid-row: 2; height: auto; }
  html[data-bar="top"] .main-col { grid-column: 2; grid-row: 2; height: auto; }
  html[data-bar="top"] body.side-off .side { display: none; }
  html[data-bar="top"] body.side-off .main-col { grid-column: 1 / -1; }
  html[data-bar="top"] body.is-launcher .rail { display: none; }
  html[data-bar="top"] body.is-launcher .main-col { grid-column: 1 / -1; grid-row: 1 / -1; }
}

/* ---- the solid and two-tone icon families: filled shapes in currentColor and no outline (beats every rule that gave an icon a stroke) */
svg.menu-ico.alt { fill: currentColor !important; stroke: none !important; }

/* ---- the company's own logo as the brand mark (a picture on a white tile, so any logo reads on the dark bar and in the dark theme) */
.logo-co { display: block; object-fit: contain; background: var(--rail-on); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rail-fg) 30%, transparent); }
.rail-brand .logo-co, .launch-brand .logo-co { width: 34px; height: 34px; padding: 3px; border-radius: calc(8px * var(--rs)); }
.login-hero > .logo-co { align-self: flex-start; height: 48px; width: auto; max-width: 260px; padding: 6px 12px; border-radius: calc(10px * var(--rs)); }

/* ---- the Appearance editor (the page in Customizations and the panel in the user menu) */
.look-ed { display: flex; flex-direction: column; gap: 1.1rem; }
.look-sec { display: flex; flex-direction: column; gap: .5rem; }
.look-sec > h4 { margin: 0; font-size: .95rem; font-weight: 700; color: var(--ink); }
.look-row { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: .35rem .8rem; align-items: center; }
.look-row > label, .look-row > .look-lbl { font-size: .86rem; font-weight: 600; color: var(--ink); }
.look-opts { display: flex; flex-wrap: wrap; gap: .4rem; }
.look-opt { min-height: 32px; padding: 0 .85rem; border: 1px solid var(--line-strong); border-radius: calc(8px * var(--rs)); background: var(--bg); color: var(--ink); font: inherit; font-size: .84rem; cursor: pointer; }
.look-opt:hover { background: var(--fill); }
.look-opt[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--on-accent); font-weight: 600; }
.look-opt:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.look-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: .6rem; }
.look-card { display: flex; flex-direction: column; gap: .3rem; align-items: stretch; padding: .65rem .75rem; border: 1px solid var(--line-strong); border-radius: calc(10px * var(--rs)); background: var(--bg); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.look-card:hover { background: var(--fill); }
.look-card b { font-size: .9rem; }
.look-card small { color: var(--muted); font-size: .78rem; line-height: 1.3; }
.look-card[aria-pressed="true"] { border-color: var(--amber); box-shadow: 0 0 0 2px var(--amber); }
.look-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.look-sw { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.look-dot { display: inline-flex; align-items: center; gap: .5rem; min-height: 32px; padding: 0 .75rem 0 .35rem; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg); color: var(--ink); font: inherit; font-size: .84rem; cursor: pointer; }
.look-dot:hover { background: var(--fill); }
.look-dot i { width: 20px; height: 20px; border-radius: 50%; background: var(--dot, var(--amber)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 25%, transparent); }
.look-dot[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); font-weight: 600; }
.look-dot:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.look-custom { display: inline-flex; align-items: center; gap: .5rem; }
.look-custom input[type="color"] { width: 36px; height: 32px; padding: 0; margin: 0; border: 1px solid var(--line-strong); border-radius: calc(6px * var(--rs)); background: none; cursor: pointer; }
.look-note { margin: 0; font-size: .8rem; color: var(--muted); }
.look-msg { margin: 0; font-size: .84rem; color: var(--danger); }
.look-msg[hidden], .look-note[hidden] { display: none; }
.look-foot { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.look-foot .grow { flex: 1; }
.look-tabs { display: inline-flex; gap: 4px; padding: 3px; border-radius: calc(10px * var(--rs)); background: var(--fill); }
.look-tab { min-height: 32px; padding: 0 1rem; border: 0; border-radius: calc(8px * var(--rs)); background: none; color: var(--muted); font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; }
.look-tab[aria-selected="true"] { background: var(--bg); color: var(--ink); box-shadow: var(--shadow); }
.look-tab:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.look-panel { width: min(440px, 100vw); }
@media (max-width: 640px) { .look-row { grid-template-columns: minmax(0, 1fr); } }
