/* rk-anotasyon — IBM Plex ailesi; sorgu serif, araç kimlikleri mono, arayüz sans.
   Renk: soğuk gri zemin + tek doygun vurgu (çam yeşili). NONE farklı bir cevap
   türü olduğu için farklı (kehribar) renk taşır — süs değil, bilgi. */

:root {
  --ground:  #f4f6f7;
  --surface: #ffffff;
  --sunken:  #eceff1;
  --line:    #dde2e6;
  --line-2:  #c8d0d6;
  --ink:     #14181c;
  --ink-2:   #3d474f;
  --muted:   #6b7780;
  --accent:  #0d6f68;
  --accent-2:#0a5a54;
  --accent-w:#e2f1ef;
  --none:    #9a5b09;
  --none-w:  #fbeedb;
  --unsure:  #6a6478;
  --unsure-w:#eeecf3;
  --danger:  #a32d1f;
  --ok:      #2f6d3f;
  --shadow:  0 1px 2px rgba(20,24,28,.05), 0 4px 14px rgba(20,24,28,.05);
  --radius:  12px;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "IBM Plex Serif", ui-serif, Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground:  #0e1114;
    --surface: #161a1f;
    --sunken:  #1c2127;
    --line:    #272d34;
    --line-2:  #38414a;
    --ink:     #e5e9ed;
    --ink-2:   #b6bfc8;
    --muted:   #8b96a1;
    --accent:  #3fb0a5;
    --accent-2:#57c4b9;
    --accent-w:#12302e;
    --none:    #d79a45;
    --none-w:  #33260f;
    --unsure:  #a9a1bd;
    --unsure-w:#221f2b;
    --danger:  #e0705f;
    --ok:      #6cc283;
    --shadow:  0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
  }
}
:root[data-theme="dark"] {
  --ground:#0e1114; --surface:#161a1f; --sunken:#1c2127; --line:#272d34; --line-2:#38414a;
  --ink:#e5e9ed; --ink-2:#b6bfc8; --muted:#8b96a1;
  --accent:#3fb0a5; --accent-2:#57c4b9; --accent-w:#12302e;
  --none:#d79a45; --none-w:#33260f; --unsure:#a9a1bd; --unsure-w:#221f2b;
  --danger:#e0705f; --ok:#6cc283;
  --shadow:0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 400 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.25; text-wrap: balance; font-weight: 600; letter-spacing: -.011em; }
h1 { font-size: 1.4rem; } h2 { font-size: 1.2rem; } h3 { font-size: .95rem; }
p { margin: 0 0 .8em; }
kbd {
  font: 500 .78em/1 var(--mono); background: var(--sunken); color: var(--ink-2);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px;
  padding: .22em .42em; white-space: nowrap;
}

/* ───────── kabuk ───────── */
.screen.center { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }

/* ───────── giriş ───────── */
.login { width: min(400px, 100%); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--accent);
  position: relative; margin-bottom: 2px;
}
.mark::after {
  content: ""; position: absolute; inset: 0;
  background: no-repeat center/60% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5 5L20 6.5'/%3E%3C/svg%3E");
}
.login h1 { margin: 0; font-size: 1.25rem; }
.sub { color: var(--muted); margin: 0; font-size: .9rem; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: .82rem; color: var(--ink-2); font-weight: 500; }
input[type=text], input[type=password], input:not([type]), textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: 8px; padding: 9px 11px; width: 100%;
}
input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.fine { font-size: .8rem; color: var(--muted); margin: 0; }
.err { color: var(--danger); font-size: .85rem; margin: 0; }

/* ───────── düğmeler ───────── */
.btn {
  font: 500 .92rem/1 var(--sans); padding: 10px 16px; border-radius: 8px;
  border: 1px solid transparent; cursor: pointer; background: var(--sunken); color: var(--ink);
  transition: background .12s ease, border-color .12s ease;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn.primary { background: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn.primary, :root:not([data-theme="light"]) .btn.primary { color: #06201e; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .btn.primary { color: #fff; } }
.btn.primary:hover:not(:disabled) { background: var(--accent-2); }
.btn.ghost { background: transparent; border-color: var(--line-2); color: var(--ink-2); }
.btn.ghost:hover { background: var(--sunken); }
.btn.danger { color: var(--danger); border-color: var(--line-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon {
  width: 30px; height: 30px; border-radius: 7px; border: 1px solid transparent;
  background: transparent; color: var(--muted); cursor: pointer;
  font: 500 15px/1 var(--sans); display: grid; place-items: center;
}
.icon:hover { background: var(--sunken); color: var(--ink); }

/* ───────── onam ───────── */
.consent { width: min(620px, 100%); padding: 30px; }
.prose { color: var(--ink-2); font-size: .93rem; }
.prose h3 { color: var(--ink); margin-top: 1.2em; }
.prose ul { margin: 0 0 .9em; padding-left: 1.15em; }
.prose li { margin-bottom: .35em; }
.check { display: flex; gap: 9px; align-items: flex-start; margin: 18px 0 16px; font-size: .92rem; }
.check input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; }

/* ───────── üst çubuk ───────── */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.bar-inner {
  max-width: 760px; margin: 0 auto; padding: 9px 16px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
}
.who { display: flex; align-items: center; gap: 7px; font-size: .88rem; min-width: 0; }
.who strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.counter { font: 500 .95rem/1 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.counter .slash { color: var(--muted); margin: 0 1px; }
.counter .left { color: var(--muted); font-size: .78rem; margin-left: 8px; }
.tools { display: flex; gap: 2px; justify-self: end; }
.rail { height: 2px; background: var(--sunken); }
.rail-fill { height: 100%; background: var(--accent); width: 0; transition: width .25s ease; }

/* ───────── çalışma alanı ───────── */
.work { max-width: 760px; margin: 0 auto; padding: 18px 16px 60px; }
.itemhead {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: .8rem; color: var(--muted); margin-bottom: 8px;
}
.itemhead .ord b { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.saved { font-size: .78rem; }
.saved.ok { color: var(--ok); } .saved.wait { color: var(--muted); } .saved.err { color: var(--danger); }

.item { padding: 22px; }
.qlabel, .olabel {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); font-weight: 600; margin: 0 0 6px;
}
.olabel { margin-top: 22px; }
.query {
  font: 400 1.28rem/1.45 var(--serif); color: var(--ink); margin: 0;
  padding: 2px 0 2px 14px; border-left: 3px solid var(--line-2); text-wrap: pretty;
}

/* ───────── seçenekler ───────── */
.options { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.opt {
  display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start;
  width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
  padding: 11px 13px; font: inherit; color: var(--ink);
  transition: border-color .1s ease, background .1s ease;
}
.opt:hover { border-color: var(--line-2); background: var(--sunken); }
.opt .k {
  font: 500 .8rem/1.5 var(--mono); color: var(--muted);
  background: var(--sunken); border: 1px solid var(--line);
  border-radius: 6px; text-align: center; height: 24px; line-height: 22px;
}
.opt .id { font: 500 .84rem/1.4 var(--mono); color: var(--ink); word-break: break-word; }
.opt .desc { font-size: .88rem; color: var(--ink-2); margin-top: 2px; }
.opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-w); }
.opt[aria-pressed="true"] .k { background: var(--accent); color: #fff; border-color: var(--accent); }
:root[data-theme="dark"] .opt[aria-pressed="true"] .k { color: #06201e; }

.opt.none .desc, .opt.unsure .desc { margin-top: 0; }
.opt.none[aria-pressed="true"] { border-color: var(--none); background: var(--none-w); }
.opt.none[aria-pressed="true"] .k { background: var(--none); color: #fff; border-color: var(--none); }
.opt.unsure[aria-pressed="true"] { border-color: var(--unsure); background: var(--unsure-w); }
.opt.unsure[aria-pressed="true"] .k { background: var(--unsure); color: #fff; border-color: var(--unsure); }
.opt.special { margin-top: 4px; }
.opt.special .id { font-family: var(--sans); font-size: .92rem; }

/* ───────── ekler ───────── */
.extra { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.chip {
  font: 500 .8rem/1 var(--sans); padding: 7px 11px; border-radius: 999px;
  border: 1px solid var(--line-2); background: transparent; color: var(--muted); cursor: pointer;
}
.chip:hover { background: var(--sunken); color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--none-w); border-color: var(--none); color: var(--none); }
.note { margin-top: 10px; resize: vertical; font-size: .9rem; }

.nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; }
.legend { text-align: center; color: var(--muted); font-size: .78rem; margin-top: 22px; line-height: 2.1; }

/* ───────── bitiş ───────── */
.done { width: min(460px, 100%); padding: 32px; text-align: center; }
.tick {
  width: 46px; height: 46px; border-radius: 50%; background: var(--accent-w); color: var(--accent);
  display: grid; place-items: center; font-size: 24px; margin: 0 auto 14px;
}
.stats { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; margin: 18px 0; text-align: left; font-size: .88rem; }
.stats dt { color: var(--muted); }
.stats dd { margin: 0; font: 500 .88rem/1.5 var(--mono); font-variant-numeric: tabular-nums; }
.done .row { justify-content: center; }

/* ───────── kip pencereleri ───────── */
.modal {
  position: fixed; inset: 0; z-index: 60; background: rgba(10,14,18,.5);
  display: grid; place-items: center; padding: 20px; overflow-y: auto;
  backdrop-filter: blur(2px);
}
.sheet { width: min(600px, 100%); padding: 28px; position: relative; max-height: 86dvh; overflow-y: auto; }
.sheet.narrow { width: min(400px, 100%); }
.close {
  position: absolute; top: 12px; right: 12px; width: 30px; height: 30px;
  border: none; background: transparent; color: var(--muted); font-size: 22px;
  cursor: pointer; border-radius: 7px; line-height: 1;
}
.close:hover { background: var(--sunken); color: var(--ink); }
.pwform { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }

/* ───────── bildirim ───────── */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: var(--ink); color: var(--ground); padding: 10px 16px; border-radius: 8px;
  font-size: .87rem; z-index: 80; box-shadow: var(--shadow); max-width: 90vw;
}

/* ───────── yönetici ───────── */
.admin { max-width: 1080px; margin: 0 auto; padding: 24px 16px 70px; }
.admin h1 { font-size: 1.3rem; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin: 18px 0; }
.tile { padding: 16px; }
.tile .lab { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.tile .val { font: 500 1.7rem/1.15 var(--mono); font-variant-numeric: tabular-nums; margin-top: 6px; }
.tile .note2 { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .87rem; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
tbody tr:last-child td { border-bottom: none; }
td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.pbar { width: 110px; height: 6px; background: var(--sunken); border-radius: 3px; overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--accent); }
.sec { margin-top: 30px; }
.sec > h2 { margin-bottom: 4px; }
.sec > .sub { margin-bottom: 12px; }
.dis { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); margin-bottom: 10px; }
.dis .q { font: 400 1.02rem/1.4 var(--serif); margin-bottom: 8px; }
.votes { display: flex; gap: 6px; flex-wrap: wrap; }
.vote { font: 500 .78rem/1 var(--mono); padding: 5px 9px; border-radius: 6px; background: var(--sunken); border: 1px solid var(--line); }

@media (max-width: 560px) {
  .bar-inner { grid-template-columns: auto 1fr auto; }
  .who strong { display: none; }
  .item { padding: 18px 15px; }
  .query { font-size: 1.15rem; }
  .legend { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ───────── kadro rozetleri ve satır işlemleri ───────── */
.tag {
  display: inline-block; font: 500 .72rem/1 var(--sans); padding: 4px 8px;
  border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted);
  white-space: nowrap;
}
.tag-core   { background: var(--accent-w); border-color: var(--accent); color: var(--accent); }
.tag-author { background: var(--sunken); }
.tag-ek     { background: var(--none-w); border-color: var(--none); color: var(--none); }
.btn .tag { margin-left: 7px; }

.rowacts { display: flex; gap: 6px; flex-wrap: wrap; }
.mini {
  font: 500 .74rem/1 var(--sans); padding: 5px 9px; border-radius: 6px;
  border: 1px solid var(--line-2); background: transparent; color: var(--muted); cursor: pointer;
  white-space: nowrap;
}
.mini:hover { background: var(--sunken); color: var(--ink); }

.cred {
  background: var(--sunken); border: 1px solid var(--line-2); border-radius: 9px;
  padding: 14px 16px; margin: 14px 0 10px;
}
.cred .lab { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.credline { font: 500 .88rem/1.7 var(--mono); color: var(--ink); white-space: pre; overflow-x: auto; }
