:root {
  color-scheme: light dark;
  --bg: #f4f1ea;
  --surface: #fbfaf6;
  --fg: #1b1a17;
  --muted: #5f5c54;
  --line: #d8d3c7;
  --accent: #c8321f;
  --accent-fg: #ffffff;
  --ok: #1f7a4d;
  --warn: #b26a00;
  --bad: #c8321f;
  --code-bg: #1b1a17;
  --code-fg: #f4f1ea;
  --chart: #2a78d6;
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --s4: #eda100;
  --s5: #e87ba4;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151412;
    --surface: #1e1c19;
    --fg: #f0ede5;
    --muted: #a8a397;
    --line: #35322c;
    --accent: #ef5a44;
    --accent-fg: #151412;
    --ok: #4cc38a;
    --warn: #e0a03c;
    --bad: #ef5a44;
    --code-bg: #0e0d0c;
    --code-fg: #f0ede5;
    --chart: #3987e5;
    --s1: #3987e5;
    --s2: #d95926;
    --s3: #199e70;
    --s4: #c98500;
    --s5: #d55181;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
}

a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { width: min(70rem, 100%); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 48rem) { .wrap { padding-inline: 32px; } }

/* Üst menü */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 4px 20px; padding-block: 14px;
}
.brand { font-family: var(--serif); font-size: 1.375rem; font-weight: 700; text-decoration: none; letter-spacing: -.01em; }
.brand span { color: var(--accent); }
.site-nav { display: flex; flex-wrap: wrap; gap: 2px 18px; font-size: 1rem; }
.site-nav a { text-decoration: none; padding-block: 4px; border-bottom: 2px solid transparent; }
.site-nav a[aria-current="page"] { border-bottom-color: var(--accent); }

/* Giriş bölümü */
.hero {
  display: grid; gap: 40px; padding-block: 56px 48px; border-bottom: 1px solid var(--line);
}
@media (min-width: 56rem) {
  .hero { grid-template-columns: minmax(0, 1.6fr) minmax(18rem, 1fr); align-items: end; padding-block: 88px 64px; }
}
h1, h2, h3 { font-family: var(--serif); line-height: 1.12; letter-spacing: -.015em; margin: 0; }
h1 { font-size: clamp(2.5rem, 7vw, 4.75rem); font-weight: 600; }
.lead { font-size: 1.25rem; color: var(--muted); max-width: 36rem; margin: 20px 0 28px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 18px;
  border: 1px solid var(--fg); border-radius: 4px; background: var(--fg); color: var(--bg);
  font: inherit; font-size: 1rem; font-weight: 600; text-decoration: none; cursor: pointer;
}
.button:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.button:disabled { opacity: .45; cursor: not-allowed; background: var(--fg); border-color: var(--fg); color: var(--bg); }
.button-quiet { background: transparent; color: var(--fg); }
.button-quiet:disabled { background: transparent; color: var(--fg); }

/* Durum paneli */
.status-panel { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 20px; }
.status-label { margin: 0; font-size: .8125rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.status-headline { margin: 4px 0 14px; font-family: var(--serif); font-size: 1.5rem; }
.status-list { list-style: none; margin: 0; padding: 0; }
.status-list li {
  display: flex; align-items: center; gap: 10px; padding-block: 8px; border-top: 1px solid var(--line); font-size: 1rem;
}
.status-list [data-status-text] { margin-left: auto; color: var(--muted); }
.lamp { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
[data-state="up"] .lamp { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
[data-state="pending"] .lamp { background: var(--warn); }
[data-state="down"] .lamp { background: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 22%, transparent); }

/* Bölümler */
.section { padding-block: 48px; border-bottom: 1px solid var(--line); }
@media (min-width: 56rem) {
  .section { display: grid; grid-template-columns: 16rem minmax(0, 1fr); gap: 32px; padding-block: 64px; }
}
.section > h2 { font-size: 1.75rem; margin-bottom: 20px; }
.feature-grid { display: grid; gap: 28px; }
@media (min-width: 40rem) { .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 40px; } }
.feature h3 { font-size: 1.3125rem; margin-bottom: 6px; }
.feature p { margin: 0; color: var(--muted); }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); padding-block: 14px; border-top: 1px solid var(--line); }
.steps li:first-child { border-top: 0; padding-top: 0; }
.steps li::before { content: counter(step); font-family: var(--serif); font-size: 1.5rem; line-height: 1.2; color: var(--accent); }
.steps strong { display: block; }
.steps span { color: var(--muted); }

.rules { margin: 0; padding-left: 1.2rem; }
.rules li { margin-bottom: 8px; }
.tag { display: inline-block; margin-left: 8px; padding: 1px 8px; border: 1px solid var(--line); border-radius: 99px; font-family: var(--sans); font-size: .75rem; font-weight: 600; letter-spacing: 0; color: var(--muted); vertical-align: middle; }

.site-footer { padding-block: 28px; color: var(--muted); font-size: .9375rem; }
.site-footer p { margin: 0; }

/* Bildirim ve mesajlar */
.notice { margin: 0 0 20px; padding: 12px 16px; border-left: 3px solid var(--warn); background: var(--surface); }
.form-message { min-height: 1.5em; margin: 12px 0 0; color: var(--muted); font-size: 1rem; }
.form-message.is-error { color: var(--bad); }

/* Formlar */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; margin-bottom: 6px; font-size: .9375rem; font-weight: 600; }
input, textarea, select {
  width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--surface); color: var(--fg); font: inherit; font-size: 1rem;
}
input:disabled, textarea:disabled, select:disabled { opacity: .6; cursor: not-allowed; }

/* Giriş sayfası */
.auth-page { width: min(26rem, 100%); margin-inline: auto; padding: 56px 16px; }
.auth-page h1 { font-size: clamp(2.25rem, 7vw, 3rem); margin-bottom: 10px; }
.auth-page > p { color: var(--muted); }
.google-box .button { width: 100%; }
.divider { margin: 14px 0; color: var(--muted); font-size: .9375rem; text-align: center; }
.text-button { padding: 0; margin-top: 12px; border: 0; background: none; color: inherit; font: inherit; font-size: .9375rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Sohbet */
body.chat-body { display: flex; flex-direction: column; height: 100dvh; }
.chat-page { flex: 1; min-height: 0; display: flex; flex-direction: column; width: min(50rem, 100%); margin-inline: auto; padding: 16px; }
.chat-toolbar { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.chat-toolbar .field { flex: 1 1 12rem; max-width: 20rem; margin: 0; }
.chat-log { flex: 1; min-height: 8rem; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-block: 8px; }
.chat-empty { margin: auto; max-width: 28rem; text-align: center; color: var(--muted); }
.chat-empty h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); color: var(--fg); margin-bottom: 8px; }
.bubble { padding: 10px 14px; border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble-user { align-self: flex-end; max-width: 85%; background: var(--fg); color: var(--bg); }
.bubble-assistant { align-self: stretch; background: var(--surface); border: 1px solid var(--line); }
.bubble.is-pending { color: var(--muted); font-style: italic; }
.bubble.is-error { border-color: var(--bad); color: var(--bad); }
.chat-form { display: flex; align-items: flex-end; gap: 8px; padding-top: 12px; }
.chat-form textarea { flex: 1; min-width: 0; resize: none; }
.chat-hint { margin: 8px 0 0; color: var(--muted); font-size: .8125rem; }

/* API sayfası */
.doc-page { padding-block: 48px 64px; }
.doc-page h1 { font-size: clamp(2.25rem, 6vw, 3.5rem); margin-bottom: 12px; }
.doc-page .lead { margin-bottom: 8px; }
.doc-section { padding-top: 40px; margin-top: 40px; border-top: 1px solid var(--line); max-width: 50rem; }
.doc-section h2 { font-size: 1.625rem; margin-bottom: 12px; }
.doc-section p { margin: 0 0 14px; }
.code-block { position: relative; margin: 0 0 16px; }
pre { margin: 0; padding: 16px; padding-top: 44px; overflow-x: auto; border-radius: 6px; background: var(--code-bg); color: var(--code-fg); font-family: var(--mono); font-size: .875rem; line-height: 1.5; }
code { font-family: var(--mono); font-size: .9em; overflow-wrap: anywhere; }
.copy-button { position: absolute; top: 8px; right: 8px; padding: 3px 10px; border: 1px solid #6a665d; border-radius: 4px; background: transparent; color: var(--code-fg); font: inherit; font-size: .8125rem; cursor: pointer; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 1rem; }
th, td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: .875rem; color: var(--muted); }
.key-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.key-form .field { flex: 1 1 14rem; margin: 0; }
.key-created { margin-top: 16px; }
.key-created p { margin-bottom: 8px; font-weight: 600; }
.key-list { list-style: none; margin: 20px 0 0; padding: 0; }
.key-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-block: 12px; border-top: 1px solid var(--line); }
.key-meta { display: block; color: var(--muted); font-family: var(--mono); font-size: .8125rem; overflow-wrap: anywhere; }
.key-empty { color: var(--muted); }

/* Yönetim paneli */
.panel-page { padding-block: 40px 64px; }
.panel-page h1 { font-size: clamp(2.25rem, 6vw, 3.5rem); margin-bottom: 20px; }
.panel-tabs { display: flex; gap: 18px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.panel-tabs button { padding: 8px 0; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.panel-tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }
.panel-count { margin-left: 6px; padding: 0 7px; border-radius: 99px; background: var(--accent); color: var(--accent-fg); font-size: .75rem; }
.user-list { list-style: none; margin: 0; padding: 0; }
.user-row { display: grid; gap: 12px; padding-block: 16px; border-top: 1px solid var(--line); }
@media (min-width: 56rem) { .user-row { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.4fr); align-items: center; } }
.user-name { display: block; font-weight: 600; overflow-wrap: anywhere; }
.user-meta { display: block; color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.badge { display: inline-block; margin-right: 6px; padding: 1px 8px; border: 1px solid var(--line); border-radius: 99px; font-size: .75rem; font-weight: 600; }
.badge[data-tone="ok"] { border-color: var(--ok); color: var(--ok); }
.badge[data-tone="warn"] { border-color: var(--warn); color: var(--warn); }
.badge[data-tone="bad"] { border-color: var(--bad); color: var(--bad); }
.user-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.user-actions .button { min-height: 36px; padding: 4px 12px; font-size: .875rem; }
.user-actions select, .user-actions input { width: auto; min-height: 36px; padding: 4px 8px; font-size: .875rem; }
.user-actions input { width: 8rem; }
.server-grid { display: grid; gap: 12px 32px; margin: 0 0 24px; }
@media (min-width: 40rem) { .server-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.server-grid div { padding-block: 8px; border-top: 1px solid var(--line); }
.server-grid dt { color: var(--muted); font-size: .875rem; }
.server-grid dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.command-list { list-style: none; margin: 16px 0 0; padding: 0; }
.command-list li { padding-block: 12px; border-top: 1px solid var(--line); }
.command-list pre { margin-top: 8px; padding-top: 16px; max-height: 18rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Kullanım sekmesi */
.usage-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; margin-bottom: 8px; }
.usage-filters .field { flex: 0 1 11rem; margin: 0; }
.usage-filters .field > span { font-size: .8125rem; }
.usage-custom { display: flex; gap: 10px; }
.chart-grid-wrap { display: grid; gap: 24px; margin-bottom: 28px; }
@media (min-width: 62rem) { .chart-grid-wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.chart-box { position: relative; margin: 0; min-width: 0; }
.chart-box figcaption { margin-bottom: 6px; font-weight: 600; font-size: .9375rem; }
.chart { display: block; width: 100%; height: auto; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-axis { fill: var(--muted); font-size: 11px; }
.chart-bar { fill: var(--chart); }
.chart-hit { fill: transparent; }
.chart-hit:hover { fill: color-mix(in srgb, var(--fg) 7%, transparent); }
.chart-tip { position: absolute; top: 26px; z-index: 1; padding: 3px 8px; border-radius: 4px; background: var(--code-bg); color: var(--code-fg); font-size: .8125rem; white-space: nowrap; pointer-events: none; }
.chart-table { grid-column: 1 / -1; font-size: .9375rem; }
.chart-table summary { cursor: pointer; color: var(--muted); }
.usage-grid { display: grid; gap: 28px; }
@media (min-width: 62rem) { .usage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.usage-block { min-width: 0; }
.usage-wide { grid-column: 1 / -1; }
.usage-block h3 { margin-bottom: 8px; font-size: 1.25rem; }
.usage-records { margin-top: 12px; }
.data-table { font-size: .875rem; }
.data-table th, .data-table td { white-space: nowrap; }
.data-table td:first-child { white-space: normal; min-width: 7rem; }
.data-table .text-button { margin: 0; font-size: inherit; }
.usage-pager { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 12px; }

/* İnfografik */
.info { display: grid; gap: 36px; margin-top: 12px; margin-bottom: 36px; }
.info-headline { margin: 0; max-width: 46rem; font-family: var(--serif); font-size: clamp(1.5rem, 3.6vw, 2.25rem); line-height: 1.25; letter-spacing: -.01em; }
.info-headline strong { font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 5px; }
.info-section { min-width: 0; padding-top: 16px; border-top: 2px solid var(--fg); }
.info-section h3 { margin-bottom: 18px; font-size: 1.375rem; }
.info-big-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 20px 28px; }
.info-big { display: flex; flex-direction: column; min-width: 0; }
.info-big-value { font-family: var(--serif); font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 600; line-height: 1.1; letter-spacing: -.02em; overflow-wrap: anywhere; }
.info-big-label { margin-top: 6px; font-weight: 600; font-size: .9375rem; }
.info-big-note { color: var(--muted); font-size: .8125rem; }
.info-hero { padding-block: 22px; border-block: 2px solid var(--fg); }
.info-hero { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.info-hero .info-big-value { font-size: clamp(2.25rem, 4.2vw, 3rem); }
.info-two { display: grid; gap: 36px; }
@media (min-width: 62rem) { .info-two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; } }
.meter-list { display: grid; gap: 10px; margin-top: 20px; }
.meter-row { display: grid; grid-template-columns: minmax(7rem, 9.5rem) minmax(0, 1fr) 4.5rem; align-items: center; gap: 10px; font-size: .875rem; }
.meter { display: block; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.meter-fill { display: block; height: 100%; border-radius: 4px; background: var(--s1); }
.meter-value { text-align: right; font-weight: 600; }
.stack { display: flex; gap: 2px; height: 26px; margin-top: 8px; }
.stack-tall { height: 34px; margin-top: 16px; }
.stack-part { display: flex; align-items: center; justify-content: center; flex: 1 1 0; min-width: 3px; overflow: hidden; color: #fff; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.stack-part:first-child { border-radius: 4px 0 0 4px; }
.stack-part:last-child { border-radius: 0 4px 4px 0; }
.stack-part:only-child { border-radius: 4px; }
.slot-1 { background: var(--s1); }
.slot-2 { background: var(--s2); color: #10100f; }
.slot-3 { background: var(--s3); color: #10100f; }
.slot-4 { background: var(--s4); color: #10100f; }
.slot-5 { background: var(--s5); color: #10100f; }
.tone-ok { background: var(--ok); }
.tone-warn { background: var(--warn); }
.tone-bad { background: var(--bad); }
.tone-muted { background: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: .8125rem; }
.legend strong { color: var(--fg); }
.legend-mark { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 2px; vertical-align: -1px; }
.share-grid { display: grid; gap: 24px 40px; }
@media (min-width: 48rem) { .share-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.share-title { font-weight: 600; font-size: .9375rem; }
.info-callout { margin: 0 0 12px; }
.heat { display: grid; grid-template-columns: 2.5rem repeat(24, minmax(14px, 1fr)); gap: 2px; min-width: 30rem; }
.heat-hour, .heat-day { color: var(--muted); font-size: .6875rem; }
.heat-day { align-self: center; }
.heat-cell { display: block; min-height: 18px; border-radius: 2px; }
.heat-0 { background: color-mix(in srgb, var(--line) 45%, transparent); }
.heat-1 { background: color-mix(in srgb, var(--s1) 25%, var(--bg)); }
.heat-2 { background: color-mix(in srgb, var(--s1) 50%, var(--bg)); }
.heat-3 { background: color-mix(in srgb, var(--s1) 75%, var(--bg)); }
.heat-4 { background: var(--s1); }
.heat-scale { display: flex; align-items: center; gap: 3px; margin-top: 8px; color: var(--muted); font-size: .75rem; }
.heat-scale .heat-cell { width: 18px; min-height: 12px; }
.rank { margin: 0; padding: 0; list-style: none; }
.rank li { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr) auto; gap: 8px; align-items: start; padding-block: 10px; border-bottom: 1px solid var(--line); }
.rank-no { font-family: var(--serif); font-size: 1.25rem; color: var(--muted); }
.rank-body { min-width: 0; }
.rank-name { display: block; margin: 0; font-size: .9375rem; font-weight: 600; text-align: left; overflow-wrap: anywhere; }
.rank-bar { display: block; height: 6px; margin-block: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.rank-fill { display: block; height: 100%; border-radius: 3px; background: var(--s1); }
.rank-value { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; }
.info-tip { position: fixed; z-index: 10; padding: 3px 8px; border-radius: 4px; background: var(--code-bg); color: var(--code-fg); font-size: .8125rem; white-space: nowrap; pointer-events: none; }
.usage-details { margin-bottom: 28px; border-top: 1px solid var(--line); padding-top: 12px; }
.usage-details summary { margin-bottom: 16px; font-weight: 600; cursor: pointer; }

/* Sohbette görsel */
.chat-attachments { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 10px; }
.chat-thumb { position: relative; width: 64px; height: 64px; }
.chat-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.chat-thumb button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: var(--fg); color: var(--bg); font: inherit; font-size: .875rem; line-height: 1; cursor: pointer; }
.bubble-image { display: block; max-width: min(100%, 16rem); margin-top: 8px; border-radius: 4px; }
.chat-hint.is-error { color: var(--bad); }
@media (max-width: 40rem) {
  .chat-form { flex-wrap: wrap; justify-content: space-between; }
  .chat-form textarea { flex: 1 1 100%; order: -1; }
}
