/* Plan 31: the account portal in the desktop app's clothes. The colours are the app's own (schemes.css, generated
 * from its tokens) and the painted study behind every screen is study.css. One top bar with the three places, then
 * glass panels over the study. */
html { background: var(--nh-surface-deep); color-scheme: dark; }
html[data-nh-theme='light'] { color-scheme: light; }
body { margin: 0; background: transparent; color: var(--nh-text-hi); font: 400 15px/1.55 var(--font-body); overflow-x: hidden; }
#portal { position: relative; min-height: 100vh; min-height: 100dvh; }
.look a { color: inherit; }
/* :where keeps this reset at one class, so the single-class margins below (.tiles, .books, .notes, ...) still win. */
.look :where(h1, h2, h3, p, ol, ul, dl, dd) { margin: 0; }
.look h1 { margin: 10px 0 16px; font: 400 clamp(32px, 5vw, 46px)/1.1 var(--font-head); letter-spacing: -.01em; }
.look :focus-visible { outline: 2px solid var(--nh-accent); outline-offset: 2px; }
.label { font: 600 11px/1.3 var(--font-body); letter-spacing: .2em; text-transform: uppercase; color: var(--nh-text-lo); }
.soft { color: var(--nh-text-mid); font-size: 14px; }
.clock { color: var(--nh-text-mid); font: italic 400 15px/1.4 var(--font-head); }

/* ---- the top bar: the tree mark, NovlHeim, where you are, and the three places ---- */
.bar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 22px;
  background: var(--nh-glass-strong); border-bottom: 1px solid color-mix(in srgb, var(--nh-text-hi) 12%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--nh-text-hi); text-decoration: none; }
.brand img { width: 28px; height: 28px; }
.wordmark { color: inherit; font: 600 17px/1 var(--font-mark); letter-spacing: .08em; }
.crumb { color: var(--nh-text-lo); font-size: 15px; white-space: nowrap; }
.crumb b { margin-left: 6px; color: var(--nh-text-mid); font: 500 17px/1 var(--font-head); }
.places { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.place { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: var(--nh-radius-sm);
  color: var(--nh-text-mid); font: 500 14px/1 var(--font-body); text-decoration: none; }
.place svg { width: 18px; height: 18px; flex: none; }
.place:hover { color: var(--nh-text-hi); }
.place[aria-current='page'] { color: var(--nh-text-hi); background: color-mix(in srgb, var(--nh-accent) 20%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--nh-accent) 55%, transparent); }
.places .you { margin-left: 8px; }
.bar-out { margin-left: auto; border: 0; background: none; cursor: pointer; }
.you-btn { background: color-mix(in srgb, var(--nh-accent) 30%, var(--nh-surface-high)); color: var(--nh-text-hi); font: 600 15px/1 var(--font-body); }
.you-btn[aria-expanded='true'] { box-shadow: 0 0 0 2px var(--nh-accent); }
.you-menu { background: var(--nh-glass-strong); color: var(--nh-text-hi); border: 1px solid color-mix(in srgb, var(--nh-text-hi) 14%, transparent);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); max-height: calc(100vh - 80px); overflow-y: auto; }

/* ---- the page ---- */
.look main { position: relative; max-width: 1120px; margin: 0 auto; padding: 44px 40px 72px; overflow-x: clip; }
.panel { min-width: 0; padding: 22px 24px; border-radius: var(--nh-radius-md); background: var(--nh-glass);
  border: 1px solid color-mix(in srgb, var(--nh-text-hi) 11%, transparent);
  backdrop-filter: blur(18px) saturate(1.1); -webkit-backdrop-filter: blur(18px) saturate(1.1); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; box-sizing: border-box;
  border-radius: var(--nh-radius-sm); border: 1px solid var(--nh-accent); background: color-mix(in srgb, var(--nh-accent) 22%, transparent);
  color: var(--nh-text-hi); font: 500 14px/1.2 var(--font-body); text-decoration: none; cursor: pointer; }
.btn:hover { background: color-mix(in srgb, var(--nh-accent) 32%, transparent); }
.btn.primary { background: var(--nh-accent); color: var(--nh-surface-deep); }
[data-nh-theme='light'] .btn.primary { color: #ffffff; }
.btn.quiet { border-color: color-mix(in srgb, var(--nh-text-hi) 22%, transparent); background: none; padding: 0 14px; font-size: 13px; }

/* ---- Your writing: the greeting, the Living World tree behind it, This week and the small Your app ---- */
.greet { position: relative; isolation: isolate; }
.greet .tree { position: absolute; z-index: -1; right: -10px; top: -70px; width: min(460px, 62vw); height: auto; pointer-events: none; }
.rule { margin: 0 0 24px; }
.rule:not(.ornament) svg { display: block; width: 100%; overflow: visible; }
.rule.ornament { display: flex; align-items: center; gap: 12px; color: color-mix(in srgb, var(--leaf) 70%, var(--nh-text-lo)); }
.rule.ornament::before, .rule.ornament::after { content: ''; flex: 1; height: 1px; background: color-mix(in srgb, var(--nh-text-hi) 16%, transparent); }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 16px; }
.stats > div { min-width: 0; padding-right: 14px; }
.stats > div + div { padding-left: 16px; border-left: 1px solid color-mix(in srgb, var(--nh-text-hi) 12%, transparent); }
.stats dt { color: var(--nh-text-lo); font-size: 13px; }
.stats b { display: block; margin: 4px 0 2px; font: 400 30px/1.1 var(--font-head); }
.stats span { color: var(--nh-text-mid); font-size: 13px; }
.panel-line { margin-top: 14px; color: var(--nh-text-mid); line-height: 1.6; max-width: 58ch; }
.panel-line .btn { margin-left: 6px; }
.week-art { margin-top: 18px; }
.week-art svg { display: block; width: 100%; height: auto; overflow: visible; }
.wk-lab { font: 500 11px var(--font-body); fill: var(--nh-text-lo); letter-spacing: .04em; }
.wk-num { font: italic 400 13px var(--font-head); fill: var(--nh-text-mid); }
.wk-today { fill: var(--nh-text-hi); }
.books { list-style: none; margin-top: 18px; padding: 0; }
.books li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid color-mix(in srgb, var(--nh-text-hi) 11%, transparent); }
.books svg { width: 18px; height: 18px; flex: none; color: var(--nh-text-mid); }
.books .t { display: block; font: 400 16px/1.3 var(--font-head); overflow-wrap: anywhere; }
.books .s { display: block; margin-top: 2px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--nh-text-lo); overflow-wrap: anywhere; }
.books .w { margin-left: auto; color: var(--nh-text-mid); font-size: 13px; white-space: nowrap; }
.app-mini h2 { margin: 10px 0 4px; font: 400 24px/1.2 var(--font-head); }
.app-mini > p:not(.label) { color: var(--nh-text-mid); font-size: 14px; }
.app-mini .btn { margin-top: 16px; }
.mini-count { margin-top: 22px; }
.mini-machine { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding-top: 10px; font-size: 14px;
  border-top: 1px solid color-mix(in srgb, var(--nh-text-hi) 11%, transparent); }
.mini-name { min-width: 0; overflow-wrap: anywhere; }
/* A flex item is a block, so the link needs its own 44px to be a fair tap target on a phone. */
.mini-machine a, .mini-more a { display: inline-flex; align-items: center; min-height: 44px; }
.app-mini > p.mini-more { margin-top: 2px; font-size: 14px; }
.mini-machine .soft { margin-left: auto; font-size: 13px; white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--leaf); flex: none; }

/* ---- Your app: the download and the machines ---- */
/* .look main sets 1120px; this narrower column needs the same weight to take hold. */
.look main.your-app { max-width: 820px; }
.your-app .panel + .panel { margin-top: 20px; }
.release h2 { margin: 10px 0 4px; font: 400 26px/1.2 var(--font-head); }
.release > p:not(.label) { color: var(--nh-text-mid); font-size: 14px; }
.release .btn { margin-top: 16px; }
.release-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-top: 22px; }
.notes { margin-top: 8px; padding-left: 18px; color: var(--nh-text-mid); font-size: 14px; line-height: 1.7; }
.machines .soft { margin-top: 6px; }
.devices { list-style: none; margin-top: 14px; padding: 0; }
.device { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0;
  border-top: 1px solid color-mix(in srgb, var(--nh-text-hi) 11%, transparent); }
.device-text { flex: 1; min-width: 0; }
.device h3 { font: 400 18px/1.3 var(--font-head); overflow-wrap: anywhere; }
.device p { color: var(--nh-text-mid); font-size: 14px; }
.device.free h3 { color: var(--nh-text-lo); }
.device-acts { display: flex; gap: 8px; flex: none; }
.name-edit { box-sizing: border-box; width: 100%; min-height: 44px; padding: 0 10px; border-radius: var(--nh-radius-sm);
  border: 1px solid var(--nh-accent); background: var(--nh-surface-high); color: var(--nh-text-hi); font: 400 16px var(--font-body); }
.later { margin-top: 14px; }
.dialog { max-width: min(28rem, calc(100vw - 32px)); padding: 24px; border-radius: var(--nh-radius-lg); background: var(--nh-surface-high);
  color: var(--nh-text-hi); border: 1px solid color-mix(in srgb, var(--nh-text-hi) 16%, transparent); }
.dialog::backdrop { background: rgba(0, 0, 0, .55); }
.dialog h2 { font: 400 22px/1.25 var(--font-head); }
.dialog p { margin-top: 10px; color: var(--nh-text-mid); }
.dialog-acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* ---- first sign-in: five painted tiles ---- */
.tiles-page .lede { max-width: 60ch; color: var(--nh-text-mid); font-size: 16px; line-height: 1.55; }
.tiles { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-top: 26px; padding: 0; }
.tile { position: relative; display: block; width: 100%; aspect-ratio: 3 / 4; padding: 0; overflow: hidden; cursor: pointer; text-align: left;
  border-radius: var(--nh-radius-lg); border: 1px solid color-mix(in srgb, var(--nh-text-hi) 14%, transparent);
  background: var(--nh-surface-deep); color: var(--nh-text-hi); font: inherit; }
.tile[aria-pressed='true'] { box-shadow: 0 0 0 2px var(--nh-accent), 0 10px 30px rgba(0, 0, 0, .35); }
.tile-study { position: absolute; inset: 0; background: center / cover no-repeat; }
/* The tile's own scheme veil over its study: parchment for Daylight, the app's dark scrim for the others (study.css). */
.tile-veil { position: absolute; inset: 0; background: var(--veil); }
.tile-mini { position: absolute; left: 10%; right: 10%; top: 20%; padding: 10px; border-radius: 8px; background: var(--nh-glass);
  border: 1px solid color-mix(in srgb, var(--nh-text-hi) 12%, transparent); }
.tile-mini i { display: block; height: 5px; margin-top: 6px; border-radius: 3px; background: color-mix(in srgb, var(--nh-text-hi) 22%, transparent); }
.tile-mini i:first-child { width: 70%; height: 8px; margin: 0; background: var(--nh-text-hi); opacity: .8; }
.tile-mini i.acc { width: 45%; background: var(--leaf); }
.tile-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px; background: var(--nh-glass-strong); }
.tile-name b { display: block; font: 500 16px/1.2 var(--font-head); }
.tile-name span { display: block; margin-top: 3px; color: var(--nh-text-lo); font-size: 12px; line-height: 1.35; }

/* ---- sign-in: the study at this hour, Clerk in a frosted panel ---- */
.look main.signin { display: grid; place-items: center; box-sizing: border-box; min-height: calc(100vh - 60px); min-height: calc(100dvh - 60px); padding: 32px 16px; }
.frost { box-sizing: border-box; width: min(440px, 100%); padding: 28px; border-radius: var(--nh-radius-lg);
  background: color-mix(in srgb, var(--nh-glass) 72%, transparent); border: 1px solid color-mix(in srgb, var(--nh-text-hi) 16%, transparent);
  backdrop-filter: blur(22px) saturate(1.2); -webkit-backdrop-filter: blur(22px) saturate(1.2); }
.frost h1 { margin: 6px 0 4px; font-size: 34px; }
.frost .lede { color: var(--nh-text-mid); }
.frost .clerk-slot { margin-top: 16px; }
.frost .clerk-slot > * { max-width: 100%; }
.fine { margin-top: 14px; color: var(--nh-text-mid); font-size: 13px; }

/* ---- the page shown when nothing else can be ---- */
.fatal .btn { margin-top: 8px; }

@media (max-width: 1000px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  /* Phones: the tree mark, two small icons for the places, and your initial; the panels stack. */
  .bar { gap: 4px; padding: 0 10px; }
  .wordmark, .crumb { display: none; }
  .place { padding: 0 12px; }
  .place-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .look main { padding: 26px 16px 48px; }
  .panel { padding: 18px 16px; }
  .greet .tree { width: 300px; right: -70px; top: -40px; }
  .stats b { font-size: 22px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .device { flex-wrap: wrap; }
  .device-acts { width: 100%; }
  .frost { padding: 20px 14px; }
}

/* ---- switching the scheme and the week (Task 6) ---- */
.views { display: flex; gap: 2px; padding: 2px; border-radius: var(--nh-radius-sm); background: color-mix(in srgb, var(--nh-text-hi) 6%, transparent); }
.view-btn { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--nh-text-lo); cursor: pointer; }
.view-btn svg { width: 18px; height: 18px; }
.view-btn:hover { color: var(--nh-text-hi); }
.view-btn[aria-pressed='true'] { color: var(--nh-text-hi); background: color-mix(in srgb, var(--nh-accent) 22%, transparent); }
.you-group { padding: .5rem .8rem .6rem; }
.you-group p { display: grid; gap: .1rem; }
.you-group b { font: 500 .95rem/1.25 var(--font-body); }
.you-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.you-menu .you-chip { display: inline-flex; align-items: center; width: auto; min-height: 36px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--nh-text-hi) 14%, transparent); background: color-mix(in srgb, var(--nh-text-hi) 6%, transparent);
  color: var(--nh-text-mid); font: 500 13px/1 var(--font-body); }
.you-menu .you-chip[aria-pressed='true'] { color: var(--nh-text-hi); border-color: var(--nh-accent); background: color-mix(in srgb, var(--nh-accent) 22%, transparent); }
@media (max-width: 700px) { .you-menu .you-chip { min-height: 44px; } }
