/* Fake iOS 27 Notes. All sizes are iOS points (1 CSS px = 1 pt).
 * Measured from Apple's own iOS 27 screenshots (reference/online/SOURCES.md):
 * margins 16 pt (< 414 pt wide) / 20 pt (Plus / Max); glass buttons 44 pt; bottom bar 47 pt, 25 pt above the edge.
 * The real iOS status bar stays visible in Clearpage, so nothing is drawn there. */
:root {
  --m: 16px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --accent: #E4AF09;
  --bg-grouped: #F2F2F7;
  --card: #FFFFFF;
  --bg-note: #FFFFFF;
  --label: #000000;
  --note-text: #232323;
  --label-2: rgba(60, 60, 67, 0.6);
  --label-3: rgba(60, 60, 67, 0.3);
  --sep: rgba(60, 60, 67, 0.16);
  --chev: rgba(60, 60, 67, 0.3);
  --glass: rgba(255, 255, 255, 0.74);
  --glass-edge: rgba(0, 0, 0, 0.07);
  --glass-hi: rgba(255, 255, 255, 0.95);
  --glass-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 6px 20px rgba(0, 0, 0, 0.08);
  --icon: #000000;
  --shared-blue: #32ADE6;
  color-scheme: light;
}
@media (min-width: 414px) { :root { --m: 20px; } }
:root[data-theme="dark"] {
  --bg-grouped: #000000;
  --card: #1C1C1E;
  --bg-note: #000000;
  --label: #FFFFFF;
  --note-text: #E6E6E6;
  --label-2: rgba(235, 235, 245, 0.6);
  --label-3: rgba(235, 235, 245, 0.3);
  --sep: rgba(84, 84, 88, 0.6);
  --chev: rgba(235, 235, 245, 0.3);
  --glass: rgba(30, 30, 32, 0.78);
  --glass-edge: rgba(255, 255, 255, 0.10);
  --glass-hi: rgba(255, 255, 255, 0.10);
  --glass-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  --icon: #FFFFFF;
  --glass-solid: #2A2A2C;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none;
  background: var(--bg-note); color: var(--label);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; }
svg { display: block; }

/* ---------- screens + push/pop ---------- */
#app { position: fixed; inset: 0; overflow: hidden; }
.screen {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  background: var(--bg-grouped); transform: translateX(0); transition: transform 0.42s cubic-bezier(0.2, 0.9, 0.25, 1);
  overscroll-behavior-y: contain;
}
.screen.note, .screen.blank { background: var(--bg-note); }
.screen[hidden] { display: block; visibility: hidden; transform: translateX(100%); }
.screen.off-left { transform: translateX(-30%); }
.screen.off-right { transform: translateX(100%); }
.screen-inner { min-height: 100%; padding-bottom: calc(var(--sab) + 96px); }

/* ---------- glass controls ---------- */
.topbar { position: absolute; left: 0; right: 0; top: 0; height: calc(var(--sat) + 44px); z-index: 3; pointer-events: none; }
.topbar-fade {
  position: absolute; left: 0; right: 0; top: 0; height: calc(var(--sat) + 58px);
  background: linear-gradient(var(--fade-from, var(--bg-grouped)) 55%, transparent);
  pointer-events: none; opacity: 0; transition: opacity 0.2s;
}
.screen.scrolled .topbar-fade { opacity: 1; }
.screen.note .topbar-fade, .screen.blank .topbar-fade { --fade-from: var(--bg-note); }
.glass {
  position: absolute; top: var(--sat); height: 44px; min-width: 44px; border-radius: 22px;
  background: var(--glass); -webkit-backdrop-filter: blur(14px) saturate(170%); backdrop-filter: blur(14px) saturate(170%);
  box-shadow: inset 0 0.5px 0 var(--glass-hi), inset 0 0 0 0.5px var(--glass-edge), var(--glass-shadow);
  display: flex; align-items: center; justify-content: center; color: var(--icon); pointer-events: auto;
}
.glass.left { left: calc(var(--m) - 1px); }
.glass.right { right: calc(var(--m) - 1px); }
.glass.text { padding: 0 19px; font-size: 17px; font-weight: 400; letter-spacing: -0.4px; }
.glass .seg { width: 50px; height: 44px; display: flex; align-items: center; justify-content: center; }
.glass.group { padding: 0 1px; }
.glass.offset-2 { right: calc(var(--m) - 1px + 44px + 12px); }

.bottombar { position: absolute; left: 0; right: 0; bottom: max(calc(var(--sab) - 9px), 12px); height: 47px; z-index: 3; pointer-events: none; }
.bottombar .glass { top: 0; height: 47px; border-radius: 23.5px; }
.search { left: 27px; right: calc(27px + 47px + 12px); justify-content: flex-start; padding: 0 14px 0 13px; gap: 9px; }
.search .ph { flex: 1; font-size: 17px; color: var(--label-2); letter-spacing: -0.4px; }
.compose { right: 27px; width: 47px; }
.tools { left: 27px; padding: 0 6px; }
.tools .seg { width: 52px; height: 47px; }

/* ---------- large title + grouped lists ---------- */
.large-title {
  padding: calc(var(--sat) + 65px) var(--m) 0; font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: 0.37px;
}
.subtitle { margin-top: -1px; padding: 0 var(--m); font-size: 15px; line-height: 20px; color: var(--label-2); letter-spacing: -0.2px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 26.8px var(--m) 10.6px; font-size: 20px; line-height: 25px; font-weight: 700; letter-spacing: 0.38px;
}
.section-head .chev-down { color: var(--label-2); margin-right: 6px; }
.card { margin: 0 var(--m); background: var(--card); border-radius: 26px; overflow: hidden; }
.row { position: relative; display: flex; align-items: center; min-height: 52px; padding-right: 16px; }
.row + .row::before { content: ""; position: absolute; top: 0; right: var(--m); left: var(--sep-left, 56px); height: 0.67px; background: var(--sep); }
.row .ico { width: 56px; flex: 0 0 56px; display: flex; align-items: center; justify-content: center; padding-left: 2px; color: var(--accent); }
.row .name { flex: 1; font-size: 17px; letter-spacing: -0.4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .count { font-size: 17px; color: var(--label-2); letter-spacing: -0.4px; margin: 0 13px 0 8px; }
.row .chev { color: var(--chev); }
.app-ico { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; color: #fff; }
.folders .card.top { margin-top: 8px; }
.folders .large-title { padding-top: calc(var(--sat) + 58px); }

/* note rows in a folder list */
.note-row { position: relative; display: flex; align-items: center; padding: 7.5px 16px 5.5px 0; min-height: 56.7px; }
.note-row + .note-row::before { content: ""; position: absolute; top: 0; left: 27px; right: 19px; height: 0.67px; background: var(--sep); }
.note-row .glyph { width: 27px; flex: 0 0 27px; display: flex; justify-content: center; color: var(--label-2); align-self: flex-start; margin-top: 3px; }
.note-row .txt { flex: 1; min-width: 0; }
.note-row .t { font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: -0.4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-row .s { padding-top: 1.7px; font-size: 15px; line-height: 20px; color: var(--label-2); letter-spacing: -0.4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-row .s b { font-weight: 400; color: var(--label-2); margin-right: 7px; }
.list .subtitle + .section-head { padding-top: 15.7px; }

/* ---------- the note itself ---------- */
.note-body {
  padding: calc(var(--sat) + 61px) calc(var(--m) + 9px) 0; color: var(--note-text);
  font-size: 17px; line-height: 25.4px; letter-spacing: -0.4px;
  -webkit-user-select: none; user-select: none;
}
.note-body .title { font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: 0.36px; margin-bottom: 6.5px; }
.note-body .blank { height: 25.4px; }
.note-body p { margin: 0; min-height: 25.4px; }
.note-body ol { list-style: none; margin: 0; padding: 0; }
.note-body ol li { display: flex; }
.note-body ol li .num { flex: 0 0 auto; min-width: var(--num-w, 23px); text-align: right; padding-right: 7px; font-variant-numeric: tabular-nums; }
.note-body ol li .item { flex: 1; min-width: 0; }
.caret { display: inline-block; width: 2px; height: 22px; margin-bottom: -4px; background: var(--accent); border-radius: 1px; animation: blink 1.06s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* the hidden performer cue: faint, never above --cue opacity */
.cue { position: absolute; z-index: 2; pointer-events: none; font-size: 11px; color: var(--label); opacity: var(--cue, 0.06); }

/* desktop preview only: a stand-in status bar so screenshots line up with Apple's references */
.fake-sb { position: fixed; top: 0; left: 0; right: 0; height: var(--sat); z-index: 9; pointer-events: none;
  display: flex; align-items: center; justify-content: space-between; padding: 6px 34px 0 52px; font: 600 17px/1 -apple-system, "Inter", sans-serif; color: var(--label); }
