/* Koyu raf: siyah zemin, Bebas Neue basliklar, sari vurgu. Fiziki kitaplar yesil cerceveli. */
:root {
  --bg: #0E0F12;
  --surface: #17191E;
  --surface2: #1A1C22;
  --line: #2A2D35;
  --fg: #F2F0EB;
  --mute: #A3A3AD;
  --faint: #6F717B;
  --accent: #F2B33D;
  --on-accent: #1A1406;
  --phys: #3FBF6E;
  --display: "Bebas Neue", Impact, "Arial Narrow", sans-serif;
  --body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tabs-h: 64px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--body); -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
img { max-width: 100%; }
[hidden] { display: none !important; }

#app { min-height: 100%; display: flex; flex-direction: column; }
#top {
  position: sticky; top: 0; z-index: 5; background: var(--bg);
  display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
}
.titles { flex: 1; min-width: 0; }
#title { margin: 0; font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1; letter-spacing: .5px; text-wrap: balance; overflow-wrap: anywhere; }
#subtitle { font-size: 13px; color: var(--mute); margin-top: 4px; }
.iconbtn { width: 44px; height: 44px; margin-left: -10px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; border-radius: 22px; }
.iconbtn:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#view { flex: 1; padding: 4px max(16px, env(safe-area-inset-right, 0px)) calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px) + 28px) max(16px, env(safe-area-inset-left, 0px)); outline: none; }

#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(14, 15, 18, .94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 6px) max(8px, env(safe-area-inset-left, 0px));
}
#tabs a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; color: var(--mute); text-decoration: none; font-size: 11px; font-weight: 500; }
#tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#tabs a[aria-current="page"] { color: var(--accent); }

.label { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--mute); }
.stack { display: flex; flex-direction: column; gap: 24px; }
.muted { color: var(--mute); }
.small { font-size: 12px; }
.empty { padding: 28px 16px; border: 1px dashed var(--line); border-radius: 16px; color: var(--mute); text-align: center; line-height: 1.5; }

/* ana ekran kutulari */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { position: relative; display: block; padding: 0; border: 0; border-radius: 16px; overflow: hidden; background: var(--surface); text-align: left; text-decoration: none; color: var(--fg); }
.tile img { display: block; width: 100%; height: 150px; object-fit: cover; }
.tile .t { display: block; padding: 10px 12px 12px; }
.tile .n { display: block; font-family: var(--display); font-size: 24px; line-height: 1; }
.tile .m { display: block; font-size: 12px; color: var(--mute); margin-top: 4px; }
.tile.phys { box-shadow: inset 0 0 0 2px var(--phys); }
.rowlink { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--surface); color: var(--fg); text-decoration: none; }
.rowlink img { width: 54px; height: 80px; object-fit: cover; border-radius: 6px; flex: 0 0 auto; background: var(--surface2); }
.rowlink .t { flex: 1; min-width: 0; }
.rowlink b { display: block; font-size: 15px; overflow-wrap: anywhere; }
.rowlink span.s { display: block; font-size: 13px; color: var(--mute); margin-top: 2px; }
.list { display: flex; flex-direction: column; gap: 10px; }

.bar { flex: 1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.barrow { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--mute); font-variant-numeric: tabular-nums; }

/* kapak izgarasi */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 10px; }
.grid.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } .grid.wide { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { display: block; padding: 0; border: 0; background: transparent; text-align: left; text-decoration: none; color: var(--fg); cursor: pointer; min-width: 0; }
.cv { position: relative; display: block; aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden; background: var(--surface); }
.cv.sq { aspect-ratio: 6 / 7; }
.cv img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card.phys .cv { box-shadow: inset 0 0 0 3px var(--phys); }
.card.phys .cv img { padding: 3px; border-radius: 10px; }
.card .n { display: block; font-weight: 700; font-size: 13px; line-height: 1.25; margin-top: 7px; overflow-wrap: anywhere; }
.card .m { display: block; font-size: 12px; color: var(--mute); margin-top: 2px; overflow-wrap: anywhere; }
.dot { position: absolute; top: 6px; right: 6px; width: 12px; height: 12px; border-radius: 6px; border: 2px solid var(--bg); }
.dot.reading { background: var(--accent); }
.dot.done { background: var(--phys); }
.badge { position: absolute; left: 6px; bottom: 6px; padding: 3px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; background: rgba(14, 15, 18, .82); color: var(--fg); }
.badge.here { background: var(--accent); color: var(--on-accent); }
.card.read .cv img { opacity: .45; }
.card.here .cv { outline: 2px solid var(--accent); outline-offset: 2px; }
.issuehead { display: flex; justify-content: space-between; align-items: baseline; margin-top: 6px; gap: 4px; }
.issuehead b { font-size: 13px; }
.issuehead span { font-size: 11px; color: var(--mute); white-space: nowrap; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { padding: 7px 12px; border: 0; border-radius: 999px; background: var(--surface2); color: #D6D4CF; font-size: 13px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); font-weight: 700; }
.tag { display: inline-block; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; color: #D6D4CF; }
.tag.phys { border-color: var(--phys); color: var(--phys); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* seri basligi */
.hero { display: flex; gap: 14px; align-items: flex-end; margin-bottom: 14px; }
.hero img { width: 108px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 10px; flex: 0 0 auto; background: var(--surface); }
.hero .t { flex: 1; min-width: 0; font-size: 13px; color: var(--mute); line-height: 1.45; }
.hero .t b { display: block; color: var(--fg); font-size: 15px; margin-top: 8px; }
.path { margin: 18px 0 0; font-size: 12px; color: var(--faint); overflow-wrap: anywhere; }

/* detay */
.detail { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.detail img.big { width: min(78vw, 360px); border-radius: 14px; background: var(--surface); }
.detail img.big.phys { box-shadow: 0 0 0 3px var(--phys); }
.detail h2 { font-family: var(--display); font-weight: 400; font-size: 32px; line-height: 1.05; margin: 14px 0 0; text-wrap: balance; }
.btn { height: 50px; padding: 0 18px; border: 0; border-radius: 14px; background: var(--surface2); color: var(--fg); font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.danger { background: transparent; color: #FF8A80; border: 1px solid #5a2b2b; }
.btnrow { display: flex; gap: 10px; width: 100%; margin-top: 18px; }
.btnrow .btn { flex: 1; }

/* alt sayfa (yer imi) */
.sheet { position: fixed; inset: 0; z-index: 20; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.sheet-card { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto; background: #15171C; border-radius: 22px 22px 0 0; padding: 10px max(18px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 18px) max(18px, env(safe-area-inset-left, 0px)); }
.sheet-card::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: #3A3D47; margin: 0 auto 14px; }
.sheet h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1; }
.pagebig { font-family: var(--display); font-size: 44px; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; accent-color: var(--accent); height: 32px; }
.stepper { display: grid; grid-template-columns: 52px 1fr 52px; gap: 10px; align-items: center; margin-top: 8px; }
.stepper button { height: 44px; border: 0; border-radius: 12px; background: var(--surface2); font-size: 22px; cursor: pointer; }

/* form */
form.add { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--mute); }
.field input, .field select { height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--fg); font-size: 16px; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.photo { position: relative; height: 210px; border: 1px dashed #3A3D47; border-radius: 16px; background: #15171C; color: #D6D4CF; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; overflow: hidden; cursor: pointer; }
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #0b0c0f; }
.photo input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.checks { display: flex; gap: 8px; flex-wrap: wrap; }
.checks label { display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; border-radius: 999px; background: var(--surface2); font-size: 14px; color: var(--fg); cursor: pointer; }
.checks input { accent-color: var(--accent); width: 18px; height: 18px; }

.search { position: relative; margin-bottom: 16px; }
.search input { width: 100%; height: 48px; padding: 0 16px 0 44px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 16px; }
.search svg { position: absolute; left: 14px; top: 14px; width: 20px; height: 20px; fill: none; stroke: var(--mute); stroke-width: 2; }

#toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px) + 16px); transform: translateX(-50%); z-index: 30; padding: 10px 16px; border-radius: 999px; background: var(--fg); color: var(--bg); font-size: 14px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100vw - 32px); text-align: center; }
#toast.show { opacity: 1; }
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }
