:root { color-scheme: light; --paper: #fff; --chrome: #f4f5f6; --ink: #25282d; --muted: #606773; --line: #dce0e5; --accent: #294ec9; --green: #287650; --danger: #a92d3b; }
:root[data-skin=safelight] { color-scheme: dark; --paper: #202225; --chrome: #191b1e; --ink: #e8eaee; --muted: #a1a7b1; --line: #3a3e45; --accent: #a9beff; --green: #91cda8; --danger: #ffa0ac; }
* { box-sizing: border-box; letter-spacing: 0; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 13px/1.5 "Inter", sans-serif; }
button, input, select { font: inherit; color: inherit; }
button, a, select { touch-action: manipulation; }
button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 8px 12px; border: 1px solid transparent; border-radius: 5px; background: none; cursor: pointer; }
button:hover { background: var(--chrome); }
button:disabled { opacity: .55; cursor: default; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
svg, i[data-lucide] { width: 17px; height: 17px; flex-shrink: 0; stroke-width: 1.6; }
i[data-lucide] { display: inline-block; }
h1, h2, p { margin: 0; }
h1 { font: 36px/1.2 "Fraunces", Georgia, serif; }
h2 { font: 27px/1.3 "Fraunces", Georgia, serif; }
[hidden] { display: none !important; }
.icon { width: 38px; padding: 8px; flex-shrink: 0; }
.primary { background: #294ec9; color: #fff; border-color: #294ec9; font-weight: 500; }
.primary:hover { background: #203da2; }
.secondary { border-color: var(--line); background: var(--paper); }
.danger { background: #a92d3b; color: #fff; }
.danger:hover { background: #852330; }
.full { width: 100%; }
.row { display: flex; align-items: center; gap: 12px; }
.spacer { flex: 1; }
.text-button { color: var(--accent); }
.topbar { min-height: 66px; padding: 12px 32px; display: flex; align-items: center; gap: 22px; border-bottom: 1px solid var(--line); background: var(--chrome); }
.brand { font: 24px/1.2 "Fraunces", Georgia, serif; white-space: nowrap; }
.brand span, .library-heading h1 span { color: var(--accent); }
.workspace-label { padding-left: 22px; border-left: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.account { position: relative; }
.avatar { width: 34px; height: 34px; min-height: 34px; padding: 0; border-radius: 50%; background: #dfebec; color: #285d61; font-size: 11px; font-weight: 600; }
.account-menu { position: absolute; right: 0; top: 45px; z-index: 10; width: min(280px, calc(100vw - 36px)); padding: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 10px 35px #0002; }
.account-menu p { padding: 8px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.account-menu button { width: 100%; justify-content: flex-start; }
.opening { margin: 70px auto; text-align: center; color: var(--muted); }
.library { max-width: 1064px; margin: 0 auto; padding: 66px 40px 70px; }
.library-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 36px; }
.library-heading p { margin-top: 10px; min-height: 18px; color: var(--muted); font-size: 12px; }
.library-tools { display: flex; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); margin-bottom: 7px; }
.filters { display: flex; align-items: center; gap: 24px; flex-shrink: 0; }
.filters button { border-radius: 0; padding: 14px 0; min-height: 49px; color: var(--muted); border-bottom: 2px solid transparent; }
.filters button[aria-pressed=true] { color: var(--ink); border-bottom-color: var(--accent); }
.count { font-size: 10px; padding: 2px 6px; background: var(--chrome); border-radius: 4px; }
.search { display: flex; align-items: center; gap: 9px; max-width: 220px; margin-left: auto; color: var(--muted); }
.search input { width: 100%; min-width: 0; background: none; border: 0; outline: none; padding: 10px 0; }
.search:focus-within { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 3px; }
input::placeholder { color: var(--muted); }
.list-label { display: flex; justify-content: space-between; align-items: center; margin: 18px 0 2px; color: var(--muted); font-size: 10px; }
.list-label select { padding: 6px 0; color: var(--muted); border: 0; background: var(--paper); max-width: 155px; font-size: 11px; }
#story-list { list-style: none; margin: 0; padding: 0; }
.story-row { display: grid; grid-template-columns: 132px minmax(0, 1fr) auto; align-items: center; gap: 28px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.story-cover { width: 132px; height: 146px; border-radius: 4px; overflow: hidden; background: var(--chrome); }
.story-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blank-cover { display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); background: repeating-linear-gradient(0deg, transparent, transparent 21px, var(--line) 22px), var(--chrome); }
.blank-cover svg { width: 26px; height: 26px; background: var(--chrome); }
.story-main { min-width: 0; }
.story-title { font: 26px/1.3 "Fraunces", Georgia, serif; overflow-wrap: anywhere; }
.story-title:hover { color: var(--accent); }
.story-meta { color: var(--muted); font-size: 11px; margin: 8px 0 19px; display: flex; gap: 12px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.badge.shared { color: var(--green); }
.badge svg { width: 13px; height: 13px; }
.story-actions { display: flex; align-items: center; gap: 12px; }
.resume { font-size: 12px; display: inline-flex; align-items: center; gap: 8px; min-height: 38px; }
.resume:hover { color: var(--accent); }
.del { color: var(--muted); }
.del:hover { color: var(--danger); }
.story-note { display: flex; align-items: center; gap: 7px; margin-top: 25px; color: var(--muted); font-size: 11px; }
.story-note svg { width: 13px; height: 13px; }
.empty { padding: 65px 12px; text-align: center; }
.empty > svg { width: 30px; height: 30px; color: var(--muted); margin-bottom: 18px; }
.empty h2 { font-size: 25px; margin-bottom: 10px; }
.empty p { color: var(--muted); margin-bottom: 20px; }
.signin { max-width: 400px; margin: 0 auto; padding: 92px 12px 60px; }
.signin-mark { margin-bottom: 25px; color: var(--accent); }
.signin-mark svg { width: 34px; height: 34px; }
.signin h1 { font-size: 37px; margin-bottom: 9px; overflow-wrap: anywhere; }
.intro { color: var(--muted); margin-bottom: 30px; }
.field { display: block; font-size: 12px; font-weight: 500; margin-bottom: 9px; }
input[type=email], #new-name { display: block; width: 100%; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); min-height: 44px; }
.signin form .primary { margin-top: 14px; min-height: 44px; }
.signin-foot { margin-top: 22px; display: flex; justify-content: center; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.signin-foot svg { width: 13px; height: 13px; }
.signin-success p { color: var(--muted); line-height: 1.7; margin: 15px 0; }
.signin-success strong { display: block; color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.signin-success .secondary { margin-top: 10px; min-height: 44px; }
.signin-success .text-button { margin-top: 9px; }
.error { margin-top: 14px; color: var(--danger); font-size: 12px; overflow-wrap: anywhere; }
.error:empty { display: none; }
dialog { width: min(440px, calc(100% - 32px)); max-height: calc(100dvh - 32px); border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); padding: 25px; box-shadow: 0 18px 70px #0003; }
dialog::backdrop { background: #12151b66; }
dialog h2 { margin-bottom: 26px; }
dialog strong { overflow-wrap: anywhere; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 25px; }
.hint { margin-top: 14px; font-size: 12px; color: var(--muted); }
@media (min-width: 1550px) { .library { padding-top: 85px; } .signin { padding-top: 110px; } }
@media (max-width: 700px) {
  .topbar { padding: 12px 18px; min-height: 60px; gap: 12px; }
  .workspace-label { display: none; }
  .brand { font-size: 23px; }
  .library { padding: 35px 22px 50px; }
  .library-heading { align-items: flex-start; margin-bottom: 25px; gap: 12px; }
  .library-heading h1 { font-size: 30px; }
  .library-heading .row { gap: 4px; }
  .library-heading .primary { padding: 8px 11px; font-size: 12px; white-space: nowrap; }
  .library-tools { flex-wrap: wrap; gap: 0 16px; }
  .filters { gap: 22px; order: 2; }
  .search { order: 1; max-width: none; width: 100%; margin: 0; border-bottom: 1px solid var(--line); }
  .filters button { min-height: 46px; }
  .story-row { grid-template-columns: 83px minmax(0, 1fr); gap: 10px 16px; padding: 21px 0; }
  .story-cover { height: 116px; width: 83px; }
  .story-title { font-size: 23px; }
  .story-meta { gap: 5px 10px; margin-bottom: 13px; font-size: 11px; }
  .story-actions { grid-column: 2; justify-content: space-between; margin-top: -8px; }
  .resume { color: var(--accent); }
  .signin { padding: 55px 24px 50px; max-width: 420px; }
  .signin h1 { font-size: 33px; }
  input[type=email], #new-name { font-size: 16px; }
}
@media (max-width: 380px) {
  .library { padding-left: 16px; padding-right: 16px; }
  .library-heading { flex-wrap: wrap; }
  .library-heading h1 { font-size: 29px; }
  .story-title { font-size: 21px; }
  .story-meta { display: block; }
  .story-meta span, .story-meta time { display: block; margin-top: 4px; }
  .filters { gap: 18px; }
  .dialog-actions { flex-wrap: wrap; }
}
