/* RackApp prototype · presentation frame: top bar, screen register, stage (device, browser, documents), notes, overview. */

#root { height: 100%; }
.shell { height: 100%; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); }
.topbar { flex: none; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 24px; padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 25px; letter-spacing: 0.01em; }
.brand-sub { font-size: 13px; color: var(--ink-3); white-space: nowrap; }

.controls { display: flex; flex-direction: column; gap: 14px; }
.controls--compact { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.ctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.controls:not(.controls--compact) .ctl { flex-direction: column; align-items: stretch; gap: 6px; }
.ctl-label { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.seg--sm { padding: 3px; gap: 3px; border-radius: 10px; }
.seg--sm .seg-opt { min-height: 32px; font-size: 13px; padding: 0 10px; border-radius: 7px; }
.controls .btn--sm { min-height: 38px; }

.shell-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 264px minmax(0, 1fr) 330px; }
.register { overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line); padding: 12px 10px 28px; display: flex; flex-direction: column; gap: 2px; }
.reg-group { display: flex; flex-direction: column; gap: 1px; }
.reg-head { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin: 16px 10px 6px; }
.reg-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 40px; padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font-size: 14.5px; font-weight: 500; text-align: left; line-height: 1.25; }
.reg-item:hover { background: var(--surface-2); color: var(--ink); }
.reg-item.is-on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.reg-item--all { justify-content: flex-start; color: var(--ink); font-weight: 600; margin-bottom: 2px; }
.reg-spec { flex: none; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.reg-item.is-on .reg-spec { color: var(--accent); }

.stage { position: relative; min-width: 0; min-height: 0; overflow: auto; background-color: var(--bg); background-image: radial-gradient(var(--line) 1px, transparent 1.3px); background-size: 22px 22px; }
.stage--app { overflow: hidden; display: flex; }
.stage-device { flex: 1; min-height: 0; min-width: 0; display: flex; justify-content: center; align-items: flex-start; padding: 14px; overflow: hidden; }
.device { flex: none; width: 414px; height: 868px; box-sizing: border-box; padding: 12px; border-radius: 56px; background: var(--bezel); box-shadow: 0 0 0 1px var(--bezel-edge), var(--shadow-2); transform-origin: top center; }
.device-screen { position: relative; width: 390px; height: 844px; border-radius: 44px; overflow: hidden; background: var(--app-bg); transform: translateZ(0); }

.notes { overflow-y: auto; background: var(--surface); border-left: 1px solid var(--line); padding: 22px 22px 32px; display: flex; flex-direction: column; gap: 12px; }
.notes-head { display: flex; flex-direction: column; gap: 4px; }
.notes-spec { font-family: var(--font-mono); font-size: 12px; color: var(--accent); }
.notes-title { font-family: var(--font-display); font-weight: 600; font-size: 27px; line-height: 1.05; }
.notes-p { font-size: 15px; line-height: 1.5; color: var(--ink-2); max-width: 62ch; }
.notes-rules { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.notes-sub { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.notes-rules ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--ink-2); }
.notes-foot { font-size: 12.5px; color: var(--ink-3); }

.browser { width: calc(100% - 48px); max-width: 1380px; margin: 20px auto 40px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-2); }
.browser-bar { display: flex; align-items: center; gap: 14px; height: 40px; padding: 0 14px; background: var(--surface-3); border-bottom: 1px solid var(--line); }
.bb-dots { display: flex; gap: 6px; flex: none; }
.bb-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); display: block; }
.bb-url { flex: 1; max-width: 620px; min-width: 0; height: 26px; display: flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: 7px; background: var(--surface); color: var(--ink-3); font-family: var(--font-mono); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.browser-body { min-height: 640px; background: var(--bg); }

.docview { display: flex; flex-direction: column; gap: 16px; padding: 18px 24px 48px; }
.doc-toolbar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: center; }
.doc-select .select { min-height: 38px; padding: 6px 12px; font-size: 14px; width: auto; }
.doc-stage { width: 100%; max-width: 794px; margin: 0 auto; }
.scaled { position: relative; width: 100%; overflow: hidden; }
.scaled-inner { transform-origin: top left; }
.placeholder { padding: 48px 16px; text-align: center; color: var(--ink-3); }

.overview { padding: 22px 28px 56px; display: flex; flex-direction: column; gap: 30px; }
.ov-title { font-family: var(--font-display); font-weight: 600; font-size: 26px; margin-bottom: 14px; }
.ov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 26px 18px; }
.mini { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; }
.mini-frame { position: relative; display: block; width: 156px; height: 326px; border-radius: 24px; background: var(--bezel); box-shadow: var(--shadow-1); overflow: hidden; transition: box-shadow 0.15s, transform 0.15s; }
.mini:hover .mini-frame, .mini:focus-visible .mini-frame { box-shadow: 0 0 0 3px var(--accent), var(--shadow-2); transform: translateY(-2px); }
.mini-scale { position: absolute; top: 5px; left: 5px; width: 390px; height: 844px; transform: scale(0.374); transform-origin: top left; border-radius: 52px; overflow: hidden; display: block; background: var(--app-bg); }
.mini-cap { font-size: 13px; font-weight: 600; text-align: center; line-height: 1.25; max-width: 160px; }
.mini-spec { display: block; font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--accent); margin-bottom: 2px; }
.ov-wide { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.ov-link { display: flex; align-items: center; gap: 12px; padding: 14px; min-height: 60px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-align: left; }
.ov-link:hover { border-color: var(--accent-line); }
.ov-link > span { flex: 1; display: flex; flex-direction: column; }

/* tablets and small laptops: notes move out of the way */
@media (max-width: 1100px) {
  .shell-body { grid-template-columns: 230px minmax(0, 1fr); }
  .notes { display: none; }
}

/* phones: the app runs full screen; the frame lives behind a button */
.shell--phone { height: 100%; }
.shell--phone.shell--scroll { height: auto; min-height: 100%; }
.phone-full { height: 100%; }
.phone-page .browser { width: 100%; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.phone-page .browser-bar { display: none; }
.phone-page .docview { padding: 12px 0 96px; }
.phone-page .overview { padding: 16px 16px 96px; }
.phone-page .ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); justify-items: center; }
.fab { position: fixed; z-index: 60; left: max(10px, env(safe-area-inset-left, 0px)); bottom: calc(98px + env(safe-area-inset-bottom, 0px)); width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-2); display: grid; place-items: center; padding: 0; }
.drawer-wrap { position: fixed; inset: 0; z-index: 70; }
.drawer-scrim { position: absolute; inset: 0; border: 0; padding: 0; background: var(--scrim); }
.drawer { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88%; display: flex; flex-direction: column; background: var(--surface); border-radius: 18px 18px 0 0; box-shadow: var(--shadow-2); padding-bottom: env(safe-area-inset-bottom, 0px); animation: sheetUp 0.22s ease-out; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px max(16px, env(safe-area-inset-right, 0px)) 6px max(16px, env(safe-area-inset-left, 0px)); }
.drawer-body { overflow-y: auto; padding: 6px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); }
.drawer-body .register { border: 0; padding: 0; background: none; overflow: visible; }
.drawer-body .notes { display: flex; border: 0; padding: 4px 0; overflow: visible; }

/* screenshot and print modes used by the export script */
.is-shot .fab { display: none; }
.is-print body { background: var(--paper); }
@media print { body { background: var(--paper); } }
