/* FaberOS · the shell. Mentifaber's ground and gold, a bar on top, a dock below, windows in between. */
@font-face { font-family: "Mentifaber Display"; src: url("../fonts/MentifaberDisplay-Regular.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url("../fonts/SchibstedGrotesk-var.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Martian Mono"; src: url("../fonts/MartianMono-var.woff2") format("woff2"); font-weight: 300 600; font-display: swap; }

:root {
  --ground: #080705; --floor: #0d0b08; --floor-2: #13100b; --plate: #16120c; --plate-2: #1d1810;
  --ink: #f1e8d4; --ink-2: #c9bc9f; --dim: #9a8b6c; --mute: #6c604a;
  --gold: #d6a647; --gold-hi: #f6dc94; --gold-lo: #8d6a26;
  --line: rgba(214, 166, 71, .16); --line-2: rgba(214, 166, 71, .32);
  --live: #9ed98a; --lock: #ef7f55; --build: #86aee8; --music: #cfa4ec;
  --display: "Mentifaber Display", Georgia, serif; --font: "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif; --mono: "Martian Mono", ui-monospace, monospace;
  --bar: 40px; --dockh: 64px; --ease: cubic-bezier(.2, .7, .1, 1);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ground); color: var(--ink); font: 400 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.os { position: fixed; inset: 0; display: grid; grid-template-rows: var(--bar) 1fr var(--dockh); }
.os[data-wall="forge"] { background: radial-gradient(120% 70% at 70% 0%, rgba(214,166,71,.16), transparent 60%), radial-gradient(80% 60% at 0% 100%, rgba(141,106,38,.18), transparent 60%), var(--ground); }
.os[data-wall="night"] { background: radial-gradient(100% 80% at 50% 120%, rgba(134,174,232,.18), transparent 60%), radial-gradient(60% 40% at 80% 10%, rgba(207,164,236,.1), transparent 70%), #05060a; }
.os[data-wall="plan"] { background: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 32px 32px, linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 32px 32px, var(--floor); }

/* the bar */
.bar { display: flex; align-items: center; gap: 12px; padding: 0 10px; border-bottom: 1px solid var(--line); background: rgba(8,7,5,.82); backdrop-filter: blur(14px); z-index: 50; }
.bar-mark { all: unset; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.bar-mark b { font: 400 14px var(--display); letter-spacing: .14em; color: var(--gold-hi); }
.bar-mark:hover, .bar-mark[aria-expanded="true"] { background: rgba(214,166,71,.1); }
.bar-title { font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ask { margin-left: auto; flex: 0 1 300px; min-width: 0; }
.ask input { width: 100%; height: 28px; border: 1px solid var(--line); background: rgba(214,166,71,.05); border-radius: 999px; padding: 0 14px; outline: none; }
.ask input:focus { border-color: var(--line-2); background: rgba(214,166,71,.09); }
.ask input::placeholder { color: var(--mute); }
.bar-clock { font: 500 12px var(--mono); color: var(--ink-2); white-space: nowrap; }

.menu { position: absolute; top: calc(var(--bar) + 4px); left: 8px; z-index: 60; min-width: 230px; display: grid; padding: 6px; border: 1px solid var(--line-2); border-radius: 12px; background: rgba(19,16,11,.96); box-shadow: 0 18px 50px rgba(0,0,0,.6); }
.menu > * { all: unset; padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.menu > *:hover, .menu > *:focus-visible { background: rgba(214,166,71,.12); color: var(--gold-hi); }

/* the desktop */
.desk { position: relative; overflow: hidden; }
.widgets { position: absolute; top: 18px; right: 18px; width: 228px; display: grid; gap: 10px; z-index: 1; max-height: calc(100% - 36px); overflow: auto; scrollbar-width: none; }
.w { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(13,11,8,.72); backdrop-filter: blur(10px); text-decoration: none; min-height: 84px; }
a.w:hover { border-color: var(--line-2); }
.w .wl { font: 500 9.5px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); display: flex; justify-content: space-between; gap: 6px; }
.w .wl > span:last-child:not(:first-child) { display: none; }
.w .wv { font: 400 22px/1.2 var(--display); color: var(--gold-hi); letter-spacing: .03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w .wv small { font: 500 11px var(--font); color: var(--dim); margin-left: 3px; }
.w .ws { font-size: 11.5px; line-height: 1.35; color: var(--dim); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.w svg, .w img { display: none; }
.w.skel .wv:empty, .w.skel:empty { background: linear-gradient(90deg, var(--line), var(--line-2), var(--line)); background-size: 200% 100%; animation: sk 1.4s infinite linear; border-radius: 10px; }
@keyframes sk { to { background-position: -200% 0; } }
.clockw .wv { font-size: 30px; }

.icons { position: absolute; inset: 18px 270px 18px 18px; display: grid; grid-template-columns: repeat(auto-fill, 92px); grid-auto-rows: 100px; gap: 6px; align-content: start; }
.ic { all: unset; display: grid; justify-items: center; align-content: start; gap: 6px; padding: 8px 4px; border-radius: 12px; cursor: pointer; text-align: center; }
.ic:hover, .ic:focus-visible { background: rgba(214,166,71,.08); }
.ic span { font-size: 12px; line-height: 1.2; color: var(--ink); text-shadow: 0 1px 6px #000; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile { --s: 52px; width: var(--s); height: var(--s); border-radius: calc(var(--s) * .24); display: grid; place-items: center; overflow: hidden; flex: none; background: radial-gradient(circle at 30% 25%, hsl(var(--h) 70% 30%), hsl(var(--h) 60% 10%)); color: hsl(var(--h) 95% 75%); box-shadow: 0 6px 18px rgba(0,0,0,.45), inset 0 0 0 1px hsl(var(--h) 80% 60% / .25); }
.tile img { width: 100%; height: 100%; display: block; }
.tile svg { width: 56%; height: 56%; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* windows */
.windows { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.win { position: absolute; pointer-events: auto; display: grid; grid-template-rows: 36px 1fr; min-width: 300px; min-height: 200px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--floor); box-shadow: 0 24px 70px rgba(0,0,0,.6); overflow: hidden; }
.win.focus { border-color: rgba(246,220,148,.55); box-shadow: 0 28px 80px rgba(0,0,0,.7), 0 0 0 1px rgba(246,220,148,.15); }
.win.max { inset: 0 !important; width: auto !important; height: auto !important; border-radius: 0; border-width: 0 0 1px; }
.win.min { display: none; }
.win-bar { display: flex; align-items: center; gap: 8px; padding: 0 6px 0 10px; background: var(--plate); border-bottom: 1px solid var(--line); cursor: grab; user-select: none; touch-action: none; }
.win-bar .tile { --s: 20px; border-radius: 6px; box-shadow: none; }
.win-bar b { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.win-bar .perm { font: 500 9px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); border: 1px solid var(--line); border-radius: 999px; padding: 2px 7px; white-space: nowrap; }
.wb { all: unset; width: 28px; height: 26px; display: grid; place-items: center; border-radius: 6px; color: var(--dim); cursor: pointer; flex: none; }
.wb:hover, .wb:focus-visible { background: rgba(214,166,71,.12); color: var(--gold-hi); }
.wb.close:hover { background: rgba(239,127,85,.2); color: var(--lock); }
.wb svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.win iframe { width: 100%; height: 100%; border: 0; display: block; background: var(--ground); }
.win .shield { position: absolute; inset: 36px 0 0; display: none; }
.os.dragging .win .shield { display: block; } /* iframes would swallow the pointer while a window moves */
.win .grip { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize; touch-action: none; background: linear-gradient(135deg, transparent 50%, var(--line-2) 50% 58%, transparent 58% 70%, var(--line-2) 70% 78%, transparent 78%); }
.win .inner { overflow: auto; padding: 20px 22px 26px; }
.inner h2 { font: 400 22px var(--display); letter-spacing: .06em; color: var(--gold-hi); margin: 0 0 8px; }
.inner h3 { font: 500 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin: 22px 0 8px; }
.inner p { color: var(--ink-2); margin: 0 0 10px; max-width: 64ch; }
.layers { display: grid; gap: 8px; margin: 12px 0; }
.layers div { display: grid; grid-template-columns: 120px 1fr; gap: 4px 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.layers div.here { border-color: var(--line-2); background: rgba(214,166,71,.06); }
.layers b { font: 400 14px var(--display); letter-spacing: .1em; color: var(--gold-hi); }
.layers span { color: var(--ink-2); font-size: 13px; }
.road { margin: 0; padding-left: 18px; color: var(--ink-2); }
.road li { margin: 3px 0; }
.road .done { color: var(--live); }
.prow { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.prow .tile { --s: 28px; border-radius: 8px; }
.prow small { display: block; color: var(--dim); font-size: 12px; }
.chip { font: 500 9.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 8px; color: var(--ink-2); white-space: nowrap; }
.chip.live { color: var(--live); border-color: rgba(158,217,138,.4); } .chip.invite { color: var(--lock); border-color: rgba(239,127,85,.4); } .chip.soon { color: var(--build); border-color: rgba(134,174,232,.4); } .chip.android, .chip.music { color: var(--music); border-color: rgba(207,164,236,.4); }
.btn { all: unset; cursor: pointer; padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 8px; font-size: 12.5px; }
.btn:hover, .btn:focus-visible { background: rgba(214,166,71,.12); color: var(--gold-hi); }
.walls { display: flex; gap: 8px; flex-wrap: wrap; }
.walls button { all: unset; cursor: pointer; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; }
.walls button[aria-pressed="true"] { border-color: var(--gold); color: var(--gold-hi); }

/* the command bar's suggestions */
.ask { position: relative; }
.sug { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 70; list-style: none; margin: 0; padding: 6px; border: 1px solid var(--line-2); border-radius: 12px; background: rgba(19,16,11,.98); box-shadow: 0 18px 50px rgba(0,0,0,.6); min-width: 280px; }
.sug li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.sug li[aria-selected="true"], .sug li:hover { background: rgba(214,166,71,.12); }
.sug .tile { --s: 24px; border-radius: 7px; box-shadow: none; }
.sug b { font-weight: 600; } .sug small { color: var(--dim); margin-left: auto; font: 500 9.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.sug .k { width: 24px; height: 24px; display: grid; place-items: center; color: var(--gold); flex: none; }
.sug span.t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* notifications */
.bell { all: unset; position: relative; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; cursor: pointer; flex: none; }
.bell svg { width: 18px; height: 18px; fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-linejoin: round; }
.bell:hover, .bell[aria-expanded="true"] { background: rgba(214,166,71,.1); }
.badge { position: absolute; top: 1px; right: 0; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 999px; background: var(--lock); color: #1a0d05; font: 700 9.5px/15px var(--font); text-align: center; }
.notes { position: absolute; top: calc(var(--bar) + 4px); right: 8px; z-index: 60; width: min(360px, calc(100% - 16px)); max-height: 70vh; display: grid; grid-template-rows: auto 1fr; border: 1px solid var(--line-2); border-radius: 12px; background: rgba(19,16,11,.97); box-shadow: 0 18px 50px rgba(0,0,0,.6); overflow: hidden; }
.notes header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.notes ol { list-style: none; margin: 0; padding: 6px; overflow: auto; }
.notes li button { all: unset; display: grid; grid-template-columns: 28px 1fr; gap: 2px 10px; width: 100%; padding: 8px; border-radius: 8px; cursor: pointer; box-sizing: border-box; }
.notes li button:hover, .notes li button:focus-visible { background: rgba(214,166,71,.1); }
.notes li .tile { --s: 28px; border-radius: 8px; grid-row: span 3; box-shadow: none; }
.notes li b { font-weight: 600; } .notes li span { color: var(--ink-2); font-size: 13px; } .notes li time { color: var(--mute); font: 500 9.5px var(--mono); }
.notes li.unread b::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--lock); margin-right: 6px; vertical-align: 2px; }
.notes .none { color: var(--dim); padding: 14px 8px; }

/* the Shelf */
.shelf-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 6px 0 4px; }
.shelf-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.shelf-row b { font-weight: 600; overflow-wrap: anywhere; } .shelf-row small { display: block; color: var(--dim); font-size: 12px; }
.shelf-row .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.drop { position: fixed; inset: 0; z-index: 85; display: none; place-items: center; background: rgba(8,7,5,.7); border: 2px dashed var(--gold); pointer-events: none; }
.drop p { font: 400 22px var(--display); letter-spacing: .08em; color: var(--gold-hi); }
.os.dropping .drop { display: grid; }

/* the dock */
.dock { display: flex; align-items: center; gap: 6px; padding: 0 10px; border-top: 1px solid var(--line); background: rgba(8,7,5,.86); backdrop-filter: blur(14px); z-index: 50; overflow: hidden; }
.dock > button, .dock-apps button { all: unset; position: relative; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; cursor: pointer; flex: none; }
.dock > button svg { width: 22px; height: 22px; fill: var(--gold); }
.dock > button:hover, .dock-apps button:hover, .dock > button:focus-visible, .dock-apps button:focus-visible { background: rgba(214,166,71,.1); }
.dock-apps { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; min-width: 0; padding-left: 6px; border-left: 1px solid var(--line); }
.dock-apps .tile { --s: 36px; border-radius: 10px; }
.dock-apps button.open::after { content: ""; position: absolute; bottom: 2px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--gold-hi); }
.dock-apps button.front::after { width: 14px; margin-left: -7px; border-radius: 3px; }

/* the launcher */
.launcher, .consent { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(4,3,2,.7); backdrop-filter: blur(6px); padding: 16px; }
.l-box { width: min(880px, 100%); height: min(640px, 100%); display: grid; grid-template-rows: auto 1fr; border: 1px solid var(--line-2); border-radius: 16px; background: rgba(16,13,9,.97); overflow: hidden; }
.l-top { display: flex; border-bottom: 1px solid var(--line); }
.l-top input { flex: 1; min-width: 0; height: 52px; padding: 0 18px; border: 0; background: none; outline: none; font-size: 16px; }
.x { all: unset; cursor: pointer; width: 52px; display: grid; place-items: center; color: var(--dim); }
.x:hover, .x:focus-visible { color: var(--gold-hi); }
.l-body { overflow: auto; padding: 8px 18px 22px; }
.l-body h3 { font: 500 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin: 16px 0 8px; }
.l-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; }
.la { all: unset; display: grid; grid-template-columns: 44px 1fr; gap: 3px 12px; align-items: center; padding: 8px; border-radius: 10px; cursor: pointer; }
.la:hover, .la:focus-visible, .la.sel { background: rgba(214,166,71,.09); }
.la .tile { --s: 44px; grid-row: span 2; }
.la b { font-weight: 600; font-size: 14px; display: flex; gap: 8px; align-items: center; min-width: 0; }
.la b > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.la small { color: var(--dim); font-size: 12px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.la[aria-disabled="true"] { opacity: .62; }
.l-empty { color: var(--dim); padding: 24px 0; }

/* the consent sheet */
.c-box { width: min(440px, 100%); padding: 22px; border: 1px solid var(--line-2); border-radius: 16px; background: rgba(19,16,11,.98); }
.c-box h2 { font: 400 20px var(--display); letter-spacing: .06em; color: var(--gold-hi); margin: 0 0 8px; }
.c-box p { color: var(--ink-2); margin: 0 0 10px; }
.c-box ul { margin: 0 0 12px; padding-left: 18px; }
.c-box .fine { font-size: 12px; color: var(--dim); }
.c-act { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.c-act button { all: unset; cursor: pointer; padding: 9px 14px; border: 1px solid var(--line-2); border-radius: 9px; }
.c-act button.pri { background: var(--gold); color: #1a1205; border-color: var(--gold); font-weight: 600; }
.c-act button:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--dockh) + 14px); transform: translateX(-50%) translateY(20px); opacity: 0; transition: .25s var(--ease); z-index: 90; padding: 9px 16px; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(19,16,11,.96); pointer-events: none; max-width: calc(100% - 32px); }
.toast.on { opacity: 1; transform: translateX(-50%); }

/* a phone: one app at a time, full screen, and the dock switches between them */
@media (max-width: 760px) {
  :root { --dockh: 60px; }
  .bar { gap: 8px; padding: 0 6px; }
  .bar-title { display: none; }
  .ask { flex: 1 1 auto; }
  .bar-mark b { display: none; }
  .shelf-row { grid-template-columns: 1fr; } .shelf-row .acts { justify-content: flex-start; }
  .widgets { position: static; width: auto; grid-template-columns: 1fr 1fr; padding: 16px 16px 0; max-height: none; overflow: visible; }
  .clockw { grid-column: 1 / -1; }
  .desk { overflow-y: auto; }
  .icons { position: static; inset: auto; padding: 14px 16px 24px; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); grid-auto-rows: auto; }
  .windows { position: fixed; inset: var(--bar) 0 var(--dockh); }
  .win { inset: 0 !important; width: auto !important; height: auto !important; border-radius: 0; border-width: 0; min-width: 0; }
  .win:not(.focus) { display: none; }
  .win .grip, .wb.max { display: none; }
  .win-bar { cursor: default; }
  .l-box { height: 100%; border-radius: 12px; }
  .l-grid { grid-template-columns: 1fr; }
  .layers div { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.v-trust { display: flex; gap: 8px; align-items: center; margin: 4px 0 12px; color: var(--ink-2); }
#v-list li b { color: var(--gold-hi); font-weight: 500; margin-right: 6px; }

/* Routines (os.js): each routine a card; the last answer kept under it, one line per app */
.rt { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 0 0 10px; }
.rt > b { display: block; font-size: 15px; } .rt > small { color: var(--dim); font: 500 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.rt ol { margin: 8px 0; padding-left: 20px; color: var(--ink-2); font-size: 13.5px; }
.rt-last { white-space: pre-line; font-size: 13px; color: var(--ink-2); border-left: 2px solid var(--gold); padding: 4px 0 4px 10px; margin: 8px 0; overflow-wrap: anywhere; }
.rt-last small { display: block; color: var(--mute); font: 500 9.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.rt-acts { margin: 6px 0 0 !important; display: flex; flex-wrap: wrap; gap: 6px; }
.rt-f, .rt-step label, .rt-when label { display: grid; gap: 4px; font-size: 12.5px; color: var(--dim); }
.rt-f input, .rt-step input, .rt-step select, .rt-when input, .rt-when select { font-size: 14px; color: var(--ink); background: rgba(0,0,0,.3); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 9px; min-width: 0; width: 100%; box-sizing: border-box; }
.rt-step { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 8px; align-items: end; border-top: 1px solid var(--line); padding: 10px 0; }
.rt-step label:first-child { grid-column: 1 / -1; }
.rt-step .btn { justify-self: start; }
.rt-when { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 8px; max-width: 420px; }
.rt-err { color: #ff8a6b; min-height: 1em; }
.notes li span { white-space: pre-line; }
