/* Ferndesk-style inbox: stone frame, one inset white panel, Inter. Calm like Linear and Notion. Light + dark. */
:root {
  --frame: #F4F3F1; --panel: #FFFFFF; --sunk: #FAFAF9; --line: #E8E6E3; --line-soft: #F1EFED; --hover: rgba(28,25,23,.045); --sel: #F3F6F4;
  --ink: #1C1917; --ink-2: #44403C; --muted: #78716C; --faint: #A8A29E; --accent: #1C8055; --accent-bright: #2EB67C; --accent-soft: #E9F6EF;
  --amber: #D97706; --amber-soft: #FFF6E8; --blue: #3B6FE0; --red: #DC2626; --shadow: 0 1px 2px rgba(28,25,23,.04), 0 12px 32px -14px rgba(28,25,23,.14);
  font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); -webkit-font-smoothing: antialiased; color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) { --frame: #131211; --panel: #1B1A19; --sunk: #201F1D; --line: #2C2A28; --line-soft: #242321; --hover: rgba(255,255,255,.06); --sel: #22262A; --ink: #F5F4F2; --ink-2: #D6D3D1; --muted: #A09A94; --faint: #6F6A65; --accent: #34B27B; --accent-soft: #17271F; --amber-soft: #2A2113; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 16px 40px -14px rgba(0,0,0,.6); color-scheme: dark; } }
:root[data-theme=dark] { --frame: #131211; --panel: #1B1A19; --sunk: #201F1D; --line: #2C2A28; --line-soft: #242321; --hover: rgba(255,255,255,.06); --sel: #22262A; --ink: #F5F4F2; --ink-2: #D6D3D1; --muted: #A09A94; --faint: #6F6A65; --accent: #34B27B; --accent-soft: #17271F; --amber-soft: #2A2113; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 16px 40px -14px rgba(0,0,0,.6); color-scheme: dark; }
* { box-sizing: border-box; }
html, body, #app { margin: 0; height: 100%; background: var(--frame); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
input, textarea, select { font: inherit; color: inherit; }
svg { width: 16px; height: 16px; flex: none; }
:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 1px; border-radius: 6px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .bold { font-weight: 600; } .grow { flex: 1; min-width: 0; }
.line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.err { color: var(--red); font-size: 13px; }
kbd { font: 600 12px/1 ui-monospace, Menlo, monospace; padding: 3px 5px; border-radius: 4px; background: rgba(127,127,127,.18); color: inherit; opacity: .75; margin-left: 2px; }

.btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); font-weight: 500; font-size: 13px; white-space: nowrap; color: var(--ink-2); box-shadow: 0 1px 1px rgba(0,0,0,.03); transition: background .12s, border-color .12s, transform .08s; text-decoration: none; }
.btn:hover { background: var(--sunk); border-color: var(--faint); color: var(--ink); } .btn:active { transform: scale(.98); } .btn:disabled { opacity: .55; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(28,128,85,.3), inset 0 1px 0 rgba(255,255,255,.14); } .btn.primary:hover { filter: brightness(.94); }
.btn svg { width: 15px; height: 15px; } .btn .chev { width: 13px; height: 13px; opacity: .6; }
.iconb { width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); } .iconb:hover { background: var(--hover); color: var(--ink); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; font-style: normal; }
.dot.waiting { background: var(--amber); } .dot.next { background: var(--accent); } .dot.fixed { background: var(--accent-bright); } .dot.new { background: var(--blue); } .dot.done { background: var(--faint); } .dot.spam { background: var(--red); }

.login { height: 100%; display: flex; align-items: center; justify-content: center; padding: 20px; }
.card { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 30px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.card h1 { font-size: 20px; margin: 8px 0 2px; letter-spacing: -.02em; }
.card input, .form input, .form textarea, .dlg textarea, .dlg select { height: 38px; border: 1px solid var(--line); border-radius: 9px; padding: 0 12px; outline: none; background: var(--panel); width: 100%; transition: border-color .12s, box-shadow .12s; }
.card input:focus, .form input:focus, .form textarea:focus, .dlg textarea:focus, .dlg select:focus { border-color: var(--accent-bright); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-bright) 22%, transparent); }
.mark { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: var(--panel); display: flex; align-items: center; justify-content: center; } .mark svg { width: 16px; height: 16px; }

.shell { height: 100%; display: flex; padding: 10px 10px 10px 0; position: relative; }
.side { width: 244px; flex: none; padding: 12px 10px 10px 12px; display: flex; flex-direction: column; gap: 8px; overflow: auto; }
.ws { position: relative; }
.wsb { display: flex; align-items: center; gap: 9px; width: 100%; height: 40px; padding: 0 8px; border-radius: 10px; font-weight: 600; font-size: 14px; letter-spacing: -.01em; } .wsb:hover, .wsb[aria-expanded=true] { background: var(--hover); }
.wsn { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .chev { color: var(--faint); width: 14px; height: 14px; }
.tile { width: 24px; height: 24px; border-radius: 7px; flex: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: #fff; background: hsl(var(--h, 150) 45% 42%); }
.tile.ghost { background: var(--line-soft); color: var(--muted); } .tile.ghost svg { width: 14px; height: 14px; }
.menu { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 30; }
.pop { position: absolute; top: 44px; left: 0; min-width: 236px; animation: pop .14s ease-out; transform-origin: top left; } .stwrap { position: relative; } .stwrap .pop { top: 36px; min-width: 190px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.mlab { font-size: 13px; font-weight: 600; color: var(--faint); padding: 6px 8px 4px; letter-spacing: .04em; text-transform: uppercase; }
.mi { display: flex; align-items: center; gap: 9px; width: 100%; height: 34px; padding: 0 8px; border-radius: 8px; font-weight: 500; color: var(--ink-2); } .mi:hover { background: var(--hover); color: var(--ink); } .mi.on { color: var(--ink); } .tick { color: var(--accent); width: 15px; height: 15px; }
.sep { height: 1px; background: var(--line); margin: 6px 4px; }
.cnt { font-size: 13px; font-weight: 500; color: var(--faint); font-variant-numeric: tabular-nums; }
.addbtn { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); font-weight: 500; color: var(--ink-2); box-shadow: 0 1px 1px rgba(0,0,0,.03); } .addbtn:hover { border-color: var(--faint); color: var(--ink); } .addbtn kbd { margin-left: auto; }
.navs { display: flex; flex-direction: column; gap: 1px; margin-top: 4px; }
.nav { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: 9px; color: var(--ink-2); font-weight: 500; width: 100%; transition: background .1s; } .nav svg { color: var(--muted); }
.nav:hover { background: var(--hover); } .nav.on { background: var(--panel); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(0,0,0,.05); color: var(--ink); } .nav.on svg { color: var(--ink); }
.foot { display: flex; flex-direction: column; gap: 1px; }
.main { flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow); }
.top { display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 52px; border-bottom: 1px solid var(--line); flex: none; }
.top h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; } .burger { display: none; margin-left: -6px; }
.seg { display: inline-flex; background: var(--line-soft); border-radius: 9px; padding: 2px; } .seg button { height: 30px; padding: 0 11px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--muted); } .seg button.on { background: var(--panel); color: var(--ink); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(0,0,0,.05); }
.split { flex: 1; display: flex; min-height: 0; }
.list { width: 420px; flex: none; border-right: 1px solid var(--line); overflow: auto; padding: 6px; scrollbar-gutter: stable; } .detail { scrollbar-gutter: stable; } .overlay { position: relative; z-index: 60; } .skw { display: block; }
.item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border-radius: 10px; transition: background .1s; } .item.fresh { animation: rise .2s ease-out backwards; }
.item:hover { background: var(--hover); } .item.on { background: var(--sel); box-shadow: inset 0 0 0 1px var(--line); }
@keyframes rise { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.ti { width: 28px; height: 28px; border-radius: 8px; background: var(--line-soft); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; flex: none; } .ti svg { width: 15px; height: 15px; }
.tx { flex: 1; min-width: 0; } .item .t { font-size: 15.5px; font-weight: 500; color: var(--ink); } .item .sub { color: var(--muted); font-size: 13px; margin-top: 1px; }
.detail { flex: 1; min-width: 0; overflow: auto; }
.art { padding: 26px 32px 40px; max-width: 720px; } .back { display: none; margin-bottom: 14px; }
.meta2 { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; flex-wrap: wrap; } .meta2 .ti { margin-right: 4px; }
.hd { margin: 12px 0 8px; font-size: 21px; font-weight: 650; letter-spacing: -.02em; line-height: 1.3; }
.msg { white-space: pre-wrap; font-size: 16px; line-height: 1.65; color: var(--ink); margin: 6px 0 16px; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 14px 0 18px; }
.inl { display: inline; vertical-align: -3px; margin-right: 6px; color: var(--muted); } .art a { color: var(--accent); }
.card2 { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 12px 0; background: var(--sunk); } .card2.prop { background: var(--amber-soft); border-color: transparent; } .card2 p { margin: 4px 0 0; }
.lab2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 10px; } .card2 .lab2 { margin-top: 0; }
.commit { display: flex; gap: 8px; align-items: center; margin-top: 8px; font-size: 13px; } .commit code { background: var(--line-soft); padding: 2px 7px; border-radius: 6px; font: 13px ui-monospace, Menlo, monospace; }
.det { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; } .det summary { cursor: pointer; font-weight: 550; color: var(--muted); list-style: none; display: inline-flex; align-items: center; gap: 6px; } .det summary::before { content: "›"; display: inline-block; transition: transform .15s; font-size: 16px; line-height: 1; } .det[open] summary::before { transform: rotate(90deg); } .det summary:hover { color: var(--ink); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 14px; margin: 12px 0; font-size: 13px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }
pre { background: var(--sunk); border: 1px solid var(--line-soft); border-radius: 9px; padding: 9px 11px; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; overflow: auto; margin: 6px 0; white-space: pre-wrap; }
.empty { padding: 64px 24px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 4px; } .empty b { color: var(--ink); font-size: 15px; margin-top: 6px; } .empty p { margin: 0 0 10px; max-width: 300px; }
.eic { width: 44px; height: 44px; border-radius: 14px; background: var(--line-soft); display: flex; align-items: center; justify-content: center; color: var(--faint); } .eic svg { width: 21px; height: 21px; }
.sk { display: flex; gap: 12px; padding: 12px; animation: pulse 1.3s ease-in-out infinite; } .sk i { width: 28px; height: 28px; border-radius: 8px; background: var(--line-soft); } .sk div { flex: 1; display: flex; flex-direction: column; gap: 7px; } .sk b { height: 11px; width: 70%; border-radius: 5px; background: var(--line-soft); } .sk u { height: 9px; width: 40%; border-radius: 5px; background: var(--line-soft); }
@keyframes pulse { 50% { opacity: .5; } }
.scroll { flex: 1; overflow: auto; padding: 22px 32px 40px; }
.dg { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.form { display: grid; gap: 14px; max-width: 640px; } .form h3 { margin: 0; font-size: 17px; letter-spacing: -.01em; } .form label { display: grid; gap: 5px; font-weight: 550; font-size: 13px; } .form label small { font-weight: 400; color: var(--muted); }
.form input { height: 36px; } .form textarea { height: auto; padding: 8px 12px; min-height: 64px; }
.sw { display: flex; align-items: center; gap: 8px; font-weight: 550; } .sw input { width: 16px; height: 16px; }
.scrim { position: fixed; inset: 0; background: rgba(20,18,16,.38); backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; z-index: 50; animation: fade .15s ease-out; } @keyframes fade { from { opacity: 0; } }
.dlg { width: 100%; max-width: 520px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.35); padding: 18px 18px 16px; animation: pop .18s ease-out; }
.dh { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; } .dh h3 { margin: 0; font-size: 17px; letter-spacing: -.01em; }
.dlg textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 110px; line-height: 1.5; }
.df { display: flex; align-items: center; gap: 8px; margin-top: 12px; } .pl { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); } .dlg select { height: 36px; width: auto; padding: 0 8px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--panel); padding: 10px 16px; border-radius: 10px; font-weight: 500; box-shadow: var(--shadow); z-index: 60; animation: rise .2s ease-out; max-width: calc(100vw - 32px); }
.veil { display: none; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 900px) {
  .shell { padding: 0; } .main { border-radius: 0; border: 0; box-shadow: none; } .burger { display: inline-flex; }
  .side { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: 280px; max-width: 86vw; background: var(--frame); transform: translateX(-102%); transition: transform .22s ease-out; box-shadow: var(--shadow); padding-top: 16px; }
  .shell.drawer .side { transform: none; } .shell.drawer .veil { display: block; position: fixed; inset: 0; background: rgba(20,18,16,.4); z-index: 35; }
  .list { width: 100%; border: 0; } .split .detail { display: none; } .split.has-detail .list { display: none; } .split.has-detail .detail { display: block; } .back { display: inline-flex; }
  .art { padding: 18px 16px 40px; } .scroll { padding: 18px 16px 40px; } .scrim { padding-top: 8vh; }
}

.btn.dec.on { background: var(--ink); border-color: var(--ink); color: var(--panel); } .btn.dec.on kbd { opacity: .6; }
.iconbtn { padding: 0; width: 32px; justify-content: center; } .pop.right { left: auto; right: 0; top: 36px; min-width: 170px; transform-origin: top right; }
.card2.ok { background: var(--accent-soft); border-color: transparent; }
.acts .stwrap { display: inline-block; }

.acts .btn, .acts .dec { height: 40px; padding: 0 16px; font-size: 14px; min-width: 44px; }
.nav { min-height: 38px; }
.item { padding: 13px 12px; }
@media (max-width: 760px) { .acts .btn { height: 44px; } }
