/* ============================================================
   ViewsOS — mockup
   Dark utilitarian instrument. Two-lane color system is the
   identity: Work = cool cyan, Personal = warm amber. The lanes
   never share a screen — separation you can see.
   ============================================================ */

:root {
  --bg: #0a0b0d;
  --surface: #121419;
  --surface-2: #181b22;
  --surface-3: #20242d;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #eef0f3;
  --muted: #888f9b;
  --faint: #5b626d;

  /* lane accents */
  --work: #34c8ff;
  --work-dim: #0f3a4d;
  --personal: #ffae54;
  --personal-dim: #4a3315;

  /* active lane (set on <body data-lane>) */
  --accent: #6b7280;
  --accent-dim: #232730;

  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font-display: "Bricolage Grotesque", sans-serif;
  --font-body: "Hanken Grotesk", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

body[data-lane="work"] { --accent: var(--work); --accent-dim: var(--work-dim); }
body[data-lane="personal"] { --accent: var(--personal); --accent-dim: var(--personal-dim); }

* { box-sizing: border-box; margin: 0; padding: 0; }

/* explicit display on .tg-overlay/.toast would otherwise defeat the attribute */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  position: relative;
}

.mono { font-family: var(--font-mono); }

/* ---------- atmosphere ---------- */
.grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.lane-glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(80% 55% at 50% -8%, var(--accent-dim), transparent 60%);
  opacity: 0; transition: opacity 0.6s var(--ease);
}
body[data-lane="work"] .lane-glow,
body[data-lane="personal"] .lane-glow { opacity: 0.9; }

/* ---------- device shell ---------- */
.device {
  position: relative; z-index: 1;
  width: 100%; max-width: 430px; height: 100dvh; margin: 0 auto;
  display: flex; flex-direction: column;
  padding: max(env(safe-area-inset-top), 18px) 20px max(env(safe-area-inset-bottom), 18px);
  overflow: hidden;
}
@media (min-width: 600px) {
  body { display: grid; place-items: center; padding: 24px; }
  .device {
    height: min(880px, 94dvh);
    border: 1px solid var(--line);
    border-radius: 40px;
    background: linear-gradient(180deg, #0c0e12, #090a0d);
    box-shadow: 0 40px 120px -30px rgba(0,0,0,0.9), inset 0 1px 0 rgba(255,255,255,0.04);
  }
}

/* ---------- screens / router ---------- */
.screen { display: none; flex: 1; min-height: 0; flex-direction: column; }
.screen.is-active { display: flex; animation: screen-in 0.45s var(--ease); }
@keyframes screen-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- topbar ---------- */
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.back {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  font-size: 19px; cursor: pointer; transition: 0.2s var(--ease);
}
.back:active { transform: scale(0.92); }
.topbar__lane, .topbar__title {
  font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -0.01em;
}
.topbar__lane { color: var(--accent); }
.topbar__spacer { margin-left: auto; }

/* ============ HOME ============ */
.screen--home { justify-content: space-between; }
.brand { padding-top: 30px; }
.reticle {
  position: relative; width: 52px; height: 52px; margin-bottom: 30px;
}
.reticle span {
  position: absolute; width: 14px; height: 14px; border: 2px solid var(--faint);
}
.reticle span:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.reticle span:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.reticle span:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.reticle span:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.reticle::after {
  content: ""; position: absolute; inset: 50% auto auto 50%;
  width: 5px; height: 5px; background: var(--accent); border-radius: 50%;
  transform: translate(-50%, -50%); box-shadow: 0 0 14px var(--accent);
}
.wordmark {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(48px, 16vw, 66px);
  line-height: 0.92; letter-spacing: -0.04em;
}
.wordmark em { font-style: normal; color: var(--faint); }
.tagline { color: var(--muted); font-size: 16px; margin-top: 14px; max-width: 22ch; }

.lanes { display: flex; flex-direction: column; gap: 14px; padding: 8px 0; }
.lane {
  position: relative; text-align: left; cursor: pointer; overflow: hidden;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 14px;
  padding: 24px 22px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text); transition: 0.3s var(--ease);
}
.lane::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--lane-c); transition: 0.3s var(--ease);
}
.lane::after {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: 0.3s var(--ease);
  background: radial-gradient(120% 100% at 0% 0%, color-mix(in srgb, var(--lane-c) 16%, transparent), transparent 55%);
}
.lane--work { --lane-c: var(--work); }
.lane--personal { --lane-c: var(--personal); }
.lane:active { transform: scale(0.985); }
.lane:hover { border-color: color-mix(in srgb, var(--lane-c) 45%, var(--line)); }
.lane:hover::after { opacity: 1; }
.lane:hover::before { width: 6px; box-shadow: 0 0 22px var(--lane-c); }
.lane__tag {
  grid-row: 1 / 3; font-family: var(--font-mono); font-size: 12px; color: var(--lane-c);
  border: 1px solid color-mix(in srgb, var(--lane-c) 40%, transparent);
  border-radius: 7px; padding: 5px 7px; align-self: start;
}
.lane__name { font-family: var(--font-display); font-weight: 700; font-size: 27px; letter-spacing: -0.02em; }
.lane__meta { grid-column: 2; font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.lane__arrow {
  grid-row: 1 / 3; grid-column: 3; align-self: center;
  font-family: var(--font-mono); font-size: 12px; color: var(--faint);
  letter-spacing: 0.02em; white-space: nowrap;
}
.lane:hover .lane__arrow { color: var(--lane-c); }

.home-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; }
.det-badge {
  font-family: var(--font-mono); font-size: 11px; color: var(--faint);
  border: 1px solid var(--line); border-radius: 20px; padding: 6px 12px;
  display: inline-flex; align-items: center; gap: 7px;
}
.det-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #2fd47a; box-shadow: 0 0 10px #2fd47a; }

.ghost-btn {
  background: none; border: 1px solid var(--line); color: var(--text);
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  padding: 11px 18px; border-radius: 12px; cursor: pointer; transition: 0.2s var(--ease);
}
.ghost-btn:active { transform: scale(0.96); }
.ghost-btn:hover { border-color: var(--line-strong); }

.solid-btn {
  background: var(--accent); border: none; color: #07090c;
  font-family: var(--font-body); font-size: 15px; font-weight: 600;
  padding: 15px 18px; border-radius: 13px; cursor: pointer; width: 100%;
  transition: 0.2s var(--ease);
}
.solid-btn:active { transform: scale(0.97); }

/* ============ CAPTURE ============ */
.viewfinder {
  position: relative; margin-bottom: 22px; padding: 34px 20px;
  border-radius: var(--r-md);
  background:
    repeating-linear-gradient(45deg, transparent, transparent 11px, rgba(255,255,255,0.012) 11px, rgba(255,255,255,0.012) 12px),
    var(--surface);
}
.vf-corner { position: absolute; width: 18px; height: 18px; border: 2px solid var(--accent); }
.vf-tl { top: 12px; left: 12px; border-right: 0; border-bottom: 0; }
.vf-tr { top: 12px; right: 12px; border-left: 0; border-bottom: 0; }
.vf-bl { bottom: 12px; left: 12px; border-right: 0; border-top: 0; }
.vf-br { bottom: 12px; right: 12px; border-left: 0; border-top: 0; }
.vf-hint { text-align: center; color: var(--muted); font-size: 14px; font-family: var(--font-mono); }

.samples { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; overflow-y: auto; padding-bottom: 4px; }
.sample {
  cursor: pointer; text-align: left; padding: 0; overflow: hidden;
  border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface-2);
  transition: 0.2s var(--ease); display: flex; flex-direction: column; min-height: 132px;
}
.sample:active { transform: scale(0.97); }
.sample:hover { border-color: var(--accent); }
.sample__shot {
  flex: 1; padding: 13px; font-family: var(--font-mono); font-size: 10.5px; line-height: 1.5;
  color: #c4c9d2; background: linear-gradient(160deg, #1d2129, #15181e);
  overflow: hidden; position: relative;
}
.sample__chrome { display: flex; gap: 4px; margin-bottom: 9px; }
.sample__chrome i { width: 7px; height: 7px; border-radius: 50%; background: #353b45; }
.sample__cap {
  padding: 9px 12px; font-family: var(--font-body); font-size: 11.5px; color: var(--muted);
  border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center;
}
.sample__cap b { color: var(--text); font-weight: 600; }

.upload-real {
  display: block; text-align: center; margin-top: 16px; padding: 13px;
  color: var(--faint); font-size: 13px; font-family: var(--font-mono);
  border: 1px dashed var(--line); border-radius: var(--r-sm); cursor: pointer;
}
.upload-real:hover { color: var(--muted); border-color: var(--line-strong); }

/* ============ PROCESSING ============ */
.screen--processing { align-items: center; justify-content: center; text-align: center; gap: 22px; }
.scan { position: relative; width: 200px; height: 200px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--accent); }
.scan__thumb { position: absolute; inset: 0; padding: 16px; font-family: var(--font-mono); font-size: 10px; line-height: 1.6; color: #aeb4be; background: #14171d; overflow: hidden; }
.scan__line {
  position: absolute; left: 0; right: 0; height: 28px; top: -28px;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--accent) 35%, transparent));
  border-bottom: 2px solid var(--accent); box-shadow: 0 0 24px var(--accent);
  animation: scanmove 1.15s linear infinite;
}
@keyframes scanmove { 0% { top: -28px; } 100% { top: 200px; } }
.scan__status { font-family: var(--font-mono); font-size: 14px; color: var(--accent); letter-spacing: 0.02em; }
.scan__ocr { font-size: 11px; color: var(--muted); max-width: 280px; min-height: 40px; line-height: 1.6; text-align: left; white-space: pre-wrap; }

/* ============ NOTE ============ */
.note-kicker { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.note-kicker span { color: var(--accent); }
.note-card {
  border-radius: var(--r-md); border: 1px solid var(--line); overflow: hidden;
  background: var(--surface); flex-shrink: 0;
}
.frontmatter {
  font-size: 12px; line-height: 1.85; color: var(--muted); padding: 16px 18px;
  background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: pre-wrap;
}
.frontmatter b { color: var(--accent); font-weight: 500; }
.note-body { padding: 18px; font-size: 13.5px; line-height: 1.65; color: var(--text); white-space: pre-wrap; max-height: 30dvh; overflow-y: auto; }

/* ---- tagger ---- */
.tagger { margin-top: 16px; }
.tagger__label { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.tagger__label em { font-style: normal; color: var(--faint); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 7px 13px; border-radius: 20px; cursor: pointer; transition: 0.18s var(--ease);
  display: inline-flex; align-items: center; gap: 6px; line-height: 1;
}
.chip:active { transform: scale(0.94); }
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip.is-on {
  background: var(--accent); border-color: var(--accent); color: #07090c; font-weight: 500;
}
.chip.is-on::before { content: "✓"; font-size: 10px; }
.chip--add { color: var(--accent); border-style: dashed; border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.chip--add:hover { background: var(--accent-dim); }
.chip-input {
  font-family: var(--font-mono); font-size: 12px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--accent); outline: none;
  padding: 7px 12px; border-radius: 20px; width: 120px;
}

.nudge-promise {
  display: flex; align-items: center; gap: 9px; margin: 20px 2px;
  color: var(--muted); font-size: 13.5px;
}
.nudge-promise .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); flex-shrink: 0; }
.note-actions { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }

/* ============ INBOX ============ */
.tabs { display: flex; gap: 8px; margin-bottom: 18px; background: var(--surface); padding: 5px; border-radius: 14px; border: 1px solid var(--line); }
.tab {
  flex: 1; padding: 11px; border-radius: 10px; border: none; cursor: pointer;
  background: none; color: var(--muted); font-family: var(--font-body); font-weight: 600; font-size: 14px;
  transition: 0.2s var(--ease); display: flex; gap: 7px; justify-content: center; align-items: center;
}
.tab span { font-family: var(--font-mono); font-size: 11px; padding: 1px 7px; border-radius: 20px; background: var(--surface-3); color: var(--faint); }
.tab[data-tab="work"].is-active { background: var(--work-dim); color: var(--work); }
.tab[data-tab="work"].is-active span { background: var(--work); color: #07090c; }
.tab[data-tab="personal"].is-active { background: var(--personal-dim); color: var(--personal); }
.tab[data-tab="personal"].is-active span { background: var(--personal); color: #07090c; }

.inbox-list { overflow-y: auto; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.item {
  border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface);
  padding: 15px 16px; position: relative; overflow: hidden; animation: screen-in 0.3s var(--ease);
}
.item::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--tab-c); }
.inbox-list[data-active="work"] { --tab-c: var(--work); }
.inbox-list[data-active="personal"] { --tab-c: var(--personal); }
.item__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.item__id { font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); }
.item__age { font-family: var(--font-mono); font-size: 10.5px; color: var(--tab-c); }
.item__text { font-size: 13px; line-height: 1.5; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.item__tag { font-family: var(--font-mono); font-size: 10px; color: var(--tab-c); border: 1px solid color-mix(in srgb, var(--tab-c) 35%, transparent); padding: 3px 8px; border-radius: 20px; }
.item__foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.item__status { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.item__status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--tab-c); }
.item__done {
  background: none; border: 1px solid var(--line-strong); color: var(--text);
  font-family: var(--font-mono); font-size: 11px; padding: 6px 13px; border-radius: 20px; cursor: pointer;
  transition: 0.2s var(--ease);
}
.item__done:active { transform: scale(0.94); }
.item__done:hover { background: var(--tab-c); color: #07090c; border-color: var(--tab-c); }
.inbox-empty { text-align: center; color: var(--faint); font-family: var(--font-mono); font-size: 13px; margin-top: 60px; }

/* ============ TELEGRAM OVERLAY ============ */
.tg-overlay {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(4,5,7,0.66); backdrop-filter: blur(3px); padding: 0 14px 14px;
  animation: fade 0.25s var(--ease);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.tg-sheet {
  width: 100%; max-width: 402px; background: #0e1116; border: 1px solid var(--line);
  border-radius: 22px; overflow: hidden; animation: sheet-up 0.4s var(--ease);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.8);
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.tg-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #151921; border-bottom: 1px solid var(--line); }
.tg-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; color: #07090c; background: var(--accent); }
.tg-id { display: flex; flex-direction: column; line-height: 1.3; }
.tg-id strong { font-size: 14.5px; }
.tg-id span { font-size: 11.5px; color: var(--muted); }
.tg-x { margin-left: auto; background: none; border: none; color: var(--muted); font-size: 24px; cursor: pointer; line-height: 1; }
.tg-thread { padding: 20px 16px 24px; background:
  radial-gradient(circle at 20% 10%, rgba(52,200,255,0.04), transparent 40%),
  #0b0e12; min-height: 150px; }
.tg-bubble {
  position: relative; background: #1c2530; border-radius: 4px 16px 16px 16px;
  padding: 13px 15px 9px; max-width: 86%; box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.tg-meta { font-size: 10.5px; color: var(--accent); margin-bottom: 7px; }
.tg-text { font-size: 14px; line-height: 1.5; color: #e7ebf0; }
.tg-done {
  display: block; width: 100%; margin-top: 12px; padding: 11px;
  background: #232e3a; border: 1px solid var(--line); border-radius: 9px;
  color: var(--accent); font-family: var(--font-body); font-weight: 600; font-size: 14px; cursor: pointer;
  transition: 0.2s var(--ease);
}
.tg-done:hover { background: var(--accent); color: #07090c; }
.tg-done:active { transform: scale(0.97); }
.tg-done.is-done { background: transparent; color: var(--muted); border-color: var(--line); pointer-events: none; }
.tg-time { display: block; text-align: right; font-size: 10px; color: var(--faint); margin-top: 6px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(20px);
  z-index: 90; background: var(--surface-3); border: 1px solid var(--line-strong);
  color: var(--text); font-size: 13.5px; font-weight: 500; padding: 13px 20px; border-radius: 13px;
  box-shadow: 0 16px 40px -12px rgba(0,0,0,0.7); opacity: 0; transition: 0.3s var(--ease);
  display: flex; align-items: center; gap: 9px; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }

::-webkit-scrollbar { width: 0; height: 0; }
