:root {
  color-scheme: light dark;
  --bg: #f6f3ec;
  --surface: #fffdf9;
  --ink: #17181c;
  --muted: #62635f;
  --line: #dcd7cb;
  --accent: #d33f18;
  --accent-hover: #b53212;
  --on-accent: #fff;
  --soft: #efeadf;
  --ok: #17693c;
  --ok-bg: #e2f2e7;
  --bad: #ad2415;
  --bad-bg: #fbe5e1;
  --warn: #7a5300;
  --warn-bg: #fbf0d3;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(23 24 28 / 5%), 0 14px 36px rgb(23 24 28 / 8%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131416;
    --surface: #1c1d20;
    --ink: #f1efe9;
    --muted: #a6a59f;
    --line: #34353a;
    --accent: #f26a43;
    --accent-hover: #ff8460;
    --on-accent: #1a0d08;
    --soft: #26272b;
    --ok: #79d39b;
    --ok-bg: #173023;
    --bad: #ff9c8d;
    --bad-bg: #3a1c17;
    --warn: #eec668;
    --warn-bg: #352a10;
    --shadow: 0 14px 36px rgb(0 0 0 / 35%);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

main { flex: 1; }

h1, h2 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 3vw, 2.2rem); font-weight: 750; }
h2 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: inherit; text-underline-offset: 3px; }
code { font-size: .92em; background: var(--soft); padding: .1em .35em; border-radius: 4px; }

.wrap { width: min(1120px, 100%); margin-inline: auto; padding-inline: 20px; }
.wrap-narrow { width: min(620px, 100%); }
.page { padding-block: 44px 64px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.hp { position: absolute; left: -9999px; }

/* Üst ve alt alan */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.header-row { display: flex; justify-content: space-between; align-items: center; min-height: 64px; gap: 16px; }
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-size: 1.3rem; font-weight: 750; letter-spacing: -.035em; }
.logo-mark { width: 26px; height: 26px; color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: 18px; font-size: .95rem; }
.site-nav a { text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }
.site-nav form { margin: 0; }
.nav-cta { padding: 6px 14px; border: 1px solid var(--ink); border-radius: 999px; font-weight: 600; }
.site-nav .nav-cta:hover { background: var(--ink); color: var(--bg); text-decoration: none; }
.site-footer { border-top: 1px solid var(--line); padding-block: 26px; font-size: .9rem; color: var(--muted); }
.footer-row { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.footer-row nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.footer-row a { text-decoration: none; }
.footer-row a:hover { text-decoration: underline; color: var(--ink); }
.footer-row p { margin: 0; }

/* Düğmeler ve form alanları */
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: 9px 20px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s;
}
.button:hover { background: var(--accent-hover); }
.button:disabled { background: var(--soft); color: var(--muted); cursor: not-allowed; }
.button-large { width: 100%; min-height: 52px; font-size: 1.05rem; }
.button-quiet { background: var(--soft); color: var(--ink); }
.button-quiet:hover { background: var(--line); }
.button-danger { background: var(--bad); color: var(--surface); }
.button-danger:hover { background: var(--bad); filter: brightness(.9); }
.link-button { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-danger { color: var(--bad); }

:is(a, button, input, select, textarea, summary):focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

input:not([type=checkbox]):not([type=file]), select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
textarea { resize: vertical; }
.field { display: grid; gap: 6px; font-size: .92rem; font-weight: 600; }
.field > * { font-weight: 400; font-size: 1rem; }
.stack { display: grid; gap: 16px; margin-top: 20px; }
.form-foot { margin-top: 18px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }

.alert { padding: 11px 14px; border-radius: 8px; font-size: .95rem; margin: 14px 0; }
.alert-error { background: var(--bad-bg); color: var(--bad); }
.alert-ok { background: var(--ok-bg); color: var(--ok); }
.alert-warn { background: var(--warn-bg); color: var(--warn); }

/* Ana sayfa */
.hero { padding-block: clamp(36px, 7vw, 84px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(28px, 6vw, 80px); align-items: start; }
.hero-copy { padding-top: 22px; }
.hero h1 { font-size: clamp(2.5rem, 6vw, 4.3rem); line-height: 1.02; letter-spacing: -.045em; font-weight: 800; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--muted); max-width: 30em; }
.hero-facts { list-style: none; margin: 30px 0 0; padding: 0; border-top: 1px solid var(--line); }
.hero-facts li { padding: 11px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.hero-facts strong { color: var(--ink); }

.uploader { display: grid; gap: 16px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); min-width: 0; }
.dropzone {
  display: grid;
  place-content: center;
  text-align: center;
  gap: 4px;
  min-height: 210px;
  padding: 24px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  position: relative;
  transition: border-color .15s, background-color .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); }
.dropzone.is-over { background: var(--soft); }
.dropzone:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone-title { font-size: 1.25rem; font-weight: 700; letter-spacing: -.015em; }
.dropzone-sub { color: var(--muted); }

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--soft); border-radius: 9px; }
.tabs button { flex: 1; min-height: 38px; border: 0; border-radius: 6px; background: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.tabs button[aria-selected=true] { background: var(--surface); color: var(--ink); }

.queue { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; max-height: 270px; overflow-y: auto; }
.queue:empty { display: none; }
.queue-item { padding: 8px 10px; background: var(--bg); border-radius: 7px; font-size: .92rem; }
.queue-head { display: flex; align-items: center; gap: 10px; }
.queue-name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.queue-size { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; max-width: 60%; text-align: right; }
.queue-remove { width: 26px; height: 26px; flex: none; border: 0; border-radius: 5px; background: none; color: var(--muted); font-size: 1.15rem; line-height: 1; cursor: pointer; }
.queue-remove:hover { background: var(--line); color: var(--ink); }
.queue-remove[hidden], .queue-bar[hidden] { display: none; }
.queue-bar { display: block; width: 100%; height: 5px; margin-top: 7px; }
.is-failed .queue-size { color: var(--bad); }
progress { appearance: none; border: 0; background: var(--line); border-radius: 99px; overflow: hidden; accent-color: var(--accent); }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }

.options { font-size: .95rem; }
.options summary { cursor: pointer; font-weight: 600; }
.options-body { display: grid; gap: 12px; margin-top: 12px; }

.results { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.results[hidden] { display: none; }
.results-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.results-head h2 { margin: 0; }
.results p { margin: 0; font-size: .92rem; }
.results ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.results li { display: grid; gap: 8px; min-width: 0; }
.result-name { overflow-wrap: anywhere; }
.result-link { display: grid; gap: 3px; min-width: 0; }
.result-label { font-size: .82rem; color: var(--muted); }
.copy-row { display: flex; gap: 8px; min-width: 0; }
.copy-row input { flex: 1; min-width: 0; font-size: .9rem; }
.copy-row .button { flex: none; padding-inline: 14px; }
.results > .link-button { justify-self: start; }

.plans { padding-block: clamp(40px, 6vw, 72px); border-top: 1px solid var(--line); background: var(--surface); }
.plans h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 26px; }
.plans .button { margin-top: 26px; }
.table-scroll { overflow-x: auto; }
.plan-table { width: 100%; min-width: 440px; border-collapse: collapse; }
.plan-table th, .plan-table td { padding: 13px 12px; text-align: left; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.plan-table tbody th { font-weight: 500; color: var(--muted); }
.plan-table thead th { font-size: 1.05rem; }
.plan-table td:last-child, .plan-table thead th:last-child { font-weight: 650; }

/* Dosya sayfası */
.file-card, .empty-card { padding: clamp(22px, 4vw, 36px); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.empty-card { text-align: center; }
.file-icon { display: inline-grid; place-items: center; min-width: 58px; height: 58px; padding-inline: 8px; margin-bottom: 14px; border-radius: 12px; background: var(--soft); font-size: .86rem; font-weight: 750; letter-spacing: .02em; }
.file-name { overflow-wrap: anywhere; font-size: clamp(1.3rem, 3vw, 1.7rem); }
.file-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0 24px; padding-block: 14px; border-block: 1px solid var(--line); }
.file-meta dt, .stats dt { font-size: .82rem; color: var(--muted); }
.file-meta dd, .stats dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.file-foot { margin: 20px 0 0; font-size: .88rem; color: var(--muted); }

.check-list { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 8px; }
.check-list li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-size: .92rem; }
.check-link { overflow-wrap: anywhere; min-width: 0; }
.badge { padding: 1px 9px; border-radius: 99px; font-size: .8rem; font-weight: 650; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }

/* Hesap */
.account-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.account-head h1 { margin-bottom: .1em; }
.quota { margin: 14px 0 28px; }
.quota-text { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; color: var(--muted); margin-bottom: 6px; }
.quota progress { display: block; width: 100%; height: 7px; }
.account-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start; }
.folders h2 { font-size: 1rem; }
.folders ul { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 2px; }
.folders li > a { display: block; padding: 7px 10px; border-radius: 6px; text-decoration: none; overflow-wrap: anywhere; }
.folders a:hover { background: var(--soft); }
.folders a.is-active { background: var(--soft); font-weight: 650; }
.folder-row { display: flex; align-items: center; gap: 8px; }
.folder-row a { flex: 1; min-width: 0; }
.folder-row form { margin: 0; font-size: .82rem; color: var(--muted); }
.inline-form { display: flex; gap: 8px; }
.inline-form input { min-width: 0; }
.file-rows { display: grid; gap: 8px; min-width: 0; }
.file-row { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; }
.file-row summary { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 16px; align-items: center; padding: 12px 14px; cursor: pointer; list-style: none; font-size: .94rem; }
.file-row summary::-webkit-details-marker { display: none; }
.file-row-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }
.file-row-body { display: grid; gap: 16px; padding: 4px 14px 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.file-row-body form { margin: 0; }
.edit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.password-box { margin-top: 36px; max-width: 420px; }
.password-box summary { cursor: pointer; font-weight: 600; }

/* Metin sayfaları */
.prose h2 { margin-top: 1.6em; }
.faq details { border-bottom: 1px solid var(--line); padding-block: 14px; }
.faq summary { font-weight: 650; cursor: pointer; }
.faq p { margin: 10px 0 0; color: var(--muted); }
.post-list { list-style: none; margin: 24px 0 0; padding: 0; }
.post-list a { text-decoration: none; }
.post-list a:hover h2 { text-decoration: underline; }
.post-list .muted { font-size: .88rem; margin-bottom: .5em; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 16px 0 32px; }
.stats div { padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; }
.stats dd { font-size: 1.4rem; }
.admin-card { padding: 14px 16px; margin-bottom: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; overflow-wrap: anywhere; }
.admin-card p { margin-bottom: .4em; }
.admin-actions { display: flex; gap: 8px; margin-top: 10px; }
.admin-actions form { margin: 0; }

@media (max-width: 840px) {
  .hero-grid, .account-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { padding-top: 0; }
  .hero-facts { margin-top: 20px; }
  .dropzone { min-height: 170px; }
  .hide-sm { display: none; }
  .file-row summary { grid-template-columns: minmax(0, 1fr) auto; }
}

@media (max-width: 420px) {
  .wrap { padding-inline: 16px; }
  .uploader { padding: 14px; }
  .file-meta { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Yalın ana sayfa ve şifre ekranı */
.home { width: min(640px, 100%); margin-inline: auto; padding: clamp(40px, 10vh, 110px) 20px 64px; }
.home-locked { text-align: center; }
.home-locked h1 { font-size: clamp(2.3rem, 7vw, 3.9rem); line-height: 1.04; letter-spacing: -.04em; font-weight: 800; margin-bottom: .4em; }
.home-locked .lead { margin-inline: auto; }
.home-open { width: auto; min-width: 240px; margin-top: 14px; }
.uploader[hidden], .home-locked[hidden] { display: none; }
.password-dialog { width: min(420px, calc(100vw - 32px)); padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.password-dialog::backdrop { background: rgb(0 0 0 / 55%); }
.password-dialog .stack { margin: 0; }
.password-dialog h2 { margin: 0; }
.password-dialog .alert { margin: 0; }
.alert[hidden] { display: none; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Panel */
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.panel-head h1 { margin-bottom: .1em; }
.panel-head form { margin: 0; }
.panel-search { display: flex; gap: 8px; max-width: 460px; margin: 18px 0; }
.panel-search input { min-width: 0; }
.panel-table { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-table table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.panel-table th { padding: 10px 12px; text-align: left; font-size: .8rem; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.panel-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.panel-table tr:last-child td { border-bottom: 0; }
.panel-file { max-width: 300px; overflow-wrap: anywhere; }
.panel-file span { display: block; font-size: .86rem; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; min-width: 150px; }
.panel-actions form { margin: 0; }
.button-small { min-height: 34px; padding: 4px 11px; font-size: .86rem; }
.panel-pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 18px; }

@media (max-width: 760px) {
  .panel-table { overflow: visible; }
  .panel-table thead { display: none; }
  .panel-table, .panel-table table, .panel-table tbody, .panel-table tr, .panel-table td { display: block; width: 100%; }
  .panel-table tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .panel-table tr:last-child { border-bottom: 0; }
  .panel-table td { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 10px; padding: 4px 0; border: 0; max-width: none; }
  .panel-table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .84rem; }
  .panel-table td.panel-actions { display: flex; justify-content: flex-start; padding-top: 8px; }
}
