:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-muted: #eef2f5;
  --line: #d9e0e6;
  --text: #17212b;
  --muted: #687684;
  --accent: #0d766e;
  --accent-dark: #095b56;
  --accent-soft: #dff1ee;
  --orange: #bd6c25;
  --red: #b63b48;
  --green: #2e8554;
  --shadow: 0 8px 24px rgba(24, 39, 52, 0.07);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

.public-onboarding { min-height: 100vh; display: grid; place-items: center; padding: 32px; background: #f3f6f8; }
.onboarding-panel { width: min(720px, 100%); padding: 32px; background: #fff; border: 1px solid #d8e0e5; box-shadow: 0 16px 40px rgba(20, 42, 56, .08); }
.onboarding-panel h1 { margin: 0 0 12px; }
.onboarding-panel .management-form { margin-top: 20px; }
.download-links { margin-top: 28px; padding-top: 20px; border-top: 1px solid #e1e7ea; display: grid; gap: 10px; }
.download-links a { color: #0c5f72; font-weight: 600; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; overflow-x: hidden; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
img { width: 16px; height: 16px; object-fit: contain; }
.hidden { display: none !important; }
.muted, .small-muted { color: var(--muted); }
.small-muted { font-size: 12px; }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 11px; font-weight: 750; letter-spacing: 0.12em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: 27px; letter-spacing: 0; }
h2 { margin-bottom: 0; font-size: 18px; letter-spacing: 0; }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #eaf0f2; }
.login-form { width: min(390px, 100%); padding: 34px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 18px; background: var(--accent); color: white; border-radius: 8px; font-weight: 800; letter-spacing: 0.05em; }
.brand-mark.small { width: 30px; height: 30px; margin: 0; border-radius: 6px; font-size: 11px; }
.login-form label, .sidebar label, .test-grid label { display: block; margin: 16px 0 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
input, textarea, select { width: 100%; border: 1px solid var(--line); background: white; color: var(--text); border-radius: 5px; outline: none; }
input, select { min-height: 38px; padding: 8px 10px; }
textarea { min-height: 70px; padding: 10px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(13, 118, 110, 0.12); }
.primary-button, .secondary-button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 5px; min-height: 38px; padding: 8px 13px; font-weight: 750; }
.primary-button { background: var(--accent); color: white; }
.primary-button:hover { background: var(--accent-dark); }
.secondary-button { background: var(--surface-muted); color: var(--text); border-color: var(--line); }
.icon-button { width: 36px; height: 36px; padding: 8px; background: transparent; border-color: transparent; }
.icon-button:hover { background: var(--surface-muted); }
.full-width { width: 100%; }
.error-text { min-height: 18px; margin: 12px 0 0; color: var(--red); font-size: 12px; }

.topbar { height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand-lockup, .top-actions, .rail-heading, .composer-footer, .section-heading, .panel-heading { display: flex; align-items: center; }
.brand-lockup { gap: 10px; }
.brand-lockup strong { display: block; font-size: 14px; }
.brand-lockup span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.top-actions { gap: 8px; }
.status-pill { padding: 6px 9px; border-radius: 99px; font-size: 11px; font-weight: 750; }
.status-pill.pass { background: #e1f2e7; color: var(--green); }
.status-pill.degraded { background: #fff0db; color: var(--orange); }
.status-pill.failed { background: #fce5e7; color: var(--red); }
.status-pill.pending { background: var(--surface-muted); color: var(--muted); }

.layout { min-height: calc(100vh - 64px); display: grid; grid-template-columns: 260px minmax(0, 1fr) 230px; }
.sidebar, .right-rail { background: var(--surface); }
.sidebar { display: flex; flex-direction: column; padding: 16px; border-right: 1px solid var(--line); }
.right-rail { padding: 18px 16px; border-left: 1px solid var(--line); }
.sidebar-section { padding-bottom: 17px; margin-bottom: 17px; border-bottom: 1px solid var(--line); }
.sidebar-section:last-of-type { border-bottom: 0; }
.section-heading { justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: 12px; font-weight: 750; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; background: var(--surface-muted); border: 1px solid var(--line); border-radius: 6px; }
.segment { min-height: 32px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 800; }
.segment.active { background: white; color: var(--accent-dark); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.direct-only.is-disabled { opacity: .48; pointer-events: none; }
.input-with-icon { position: relative; }
.input-with-icon img { position: absolute; left: 9px; top: 11px; opacity: .55; }
.input-with-icon input { padding-left: 31px; }
#modelSelect { font-size: 12px; }
.parameters-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.parameters-grid label { margin-top: 0; }
.parameters-grid input { margin-top: 6px; }
.sidebar-footer { margin-top: auto; padding-top: 10px; }

.main-content { min-width: 0; min-height: 0; overflow: hidden; padding: 18px 20px 24px; }
.view-tabs { display: flex; min-width: 0; max-width: 100%; gap: 5px; margin-bottom: 16px; overflow-x: auto; overflow-y: hidden; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.view-tab { display: inline-flex; align-items: center; gap: 7px; padding: 10px 13px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 750; }
.view-tab.active { border-bottom-color: var(--accent); color: var(--accent-dark); }
.view-panel { min-height: calc(100vh - 150px); }
.chat-messages { min-height: 460px; max-height: calc(100vh - 270px); overflow: auto; padding: 6px 4px 18px; }
.empty-state { display: grid; place-items: center; min-height: 420px; text-align: center; color: var(--muted); }
.empty-state img { width: 30px; height: 30px; margin-bottom: 10px; opacity: .55; }
.empty-state h2 { color: var(--text); }
.empty-state p { margin-bottom: 0; }
.message { max-width: 820px; margin: 0 auto 14px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: 0 2px 8px rgba(24,39,52,.035); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.52; }
.message.user { border-left: 3px solid var(--accent); }
.message.assistant { border-left: 3px solid var(--orange); }
.message-label { margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.composer { max-width: 820px; margin: 0 auto; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; box-shadow: var(--shadow); }
.composer textarea { border: 0; box-shadow: none; min-height: 70px; }
.composer textarea:focus { box-shadow: none; }
.composer-footer { justify-content: flex-end; gap: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.checkbox-label { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; color: var(--muted); font-size: 12px; }
.checkbox-label input { width: auto; min-height: auto; }

.panel-heading { justify-content: space-between; margin-bottom: 18px; }
.test-grid { display: grid; grid-template-columns: minmax(220px, 320px) auto; align-items: end; gap: 12px; max-width: 650px; }
.test-grid label { margin: 0; }
.test-grid select { margin-top: 6px; }
.result-box { min-height: 260px; margin-top: 20px; padding: 14px; border: 1px solid var(--line); border-radius: 7px; background: #17212b; color: #dbe7ec; overflow: auto; white-space: pre-wrap; }
.health-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 8px; margin-bottom: 18px; }
.health-chip { padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.health-chip strong { display: block; margin-bottom: 5px; font-size: 12px; }
.health-chip span { font-size: 11px; font-weight: 800; }
.health-chip.pass span { color: var(--green); }
.health-chip.degraded span, .health-chip.blocked span { color: var(--orange); }
.health-chip.failed span { color: var(--red); }
.worker-summary { display: grid; grid-template-columns: repeat(5, minmax(100px, 1fr)); gap: 8px; margin-bottom: 18px; }
.documentation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.documentation-grid article { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.documentation-grid h3 { margin: 0 0 8px; font-size: 14px; }
.documentation-grid p { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.documentation-grid a { color: var(--accent-dark); font-size: 12px; font-weight: 750; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
.table-status { font-weight: 800; }
.table-status.pass { color: var(--green); }
.table-status.failed { color: var(--red); }
.table-status.degraded { color: var(--orange); }
.management-form { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)); gap: 12px; align-items: end; margin-bottom: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.management-form label { margin: 0; }
.management-form label input, .management-form label select { margin-top: 6px; }
.management-form .primary-button { min-height: 38px; }
.compact-form { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
.form-check { align-self: center; margin: 0 !important; padding-bottom: 10px; }
.form-check input { width: auto; min-height: auto; margin: 0 6px 0 0 !important; }
.form-result { min-height: 18px; margin: 8px 0 12px; color: var(--muted); font-size: 12px; }
.form-result.error { color: var(--red); }
.form-result.success { color: var(--green); }
.key-result { padding: 10px; border-left: 3px solid var(--orange); background: #fff7eb; color: #7c481d; overflow-wrap: anywhere; }
.management-table { margin-bottom: 20px; }
.subheading { margin-top: 20px; }
.activity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.activity-grid .table-wrap { max-height: 420px; overflow: auto; }
.action-button { min-height: 30px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-muted); color: var(--text); font-size: 11px; font-weight: 750; }
.action-button:hover { border-color: var(--accent); color: var(--accent-dark); }
.status-cell { font-weight: 800; }
.status-cell.active, .status-cell.pass { color: var(--green); }
.status-cell.cooldown, .status-cell.exhausted, .status-cell.unknown { color: var(--orange); }
.status-cell.invalid, .status-cell.disabled { color: var(--red); }
.status-cell.pending { color: var(--orange); }
.status-cell.approved { color: var(--green); }
.status-cell.rejected { color: var(--red); }

.context-help, .help-article { margin-bottom: 20px; }
.help-intro { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.help-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--line); }
.help-grid article { min-width: 0; padding: 14px; background: var(--surface); }
.help-grid h3 { margin: 0 0 7px; font-size: 12px; color: var(--accent-dark); }
.help-grid p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.help-catalog, .download-tabs, .download-client-tabs { display: flex; gap: 6px; margin-bottom: 16px; overflow-x: auto; }
.help-topic, .download-tab { min-height: 36px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--muted); font-weight: 750; white-space: nowrap; }
.help-topic.active, .download-tab.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }

.download-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.download-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.download-card h3 { margin: 0 0 5px; font-size: 16px; }
.download-card p { margin: 0; color: var(--muted); font-size: 12px; }
.download-card dl { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; margin: 0; }
.download-card dl div { min-width: 0; padding-top: 8px; border-top: 1px solid var(--line); }
.download-card dt { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.download-card dd { margin: 4px 0 0; font-size: 12px; overflow-wrap: anywhere; }
.download-action { grid-column: 2; grid-row: 1; text-decoration: none; }
.signature-state { color: var(--orange); font-weight: 700; }

.model-filters { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px); gap: 10px; margin-bottom: 14px; }
.model-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.model-card { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.model-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.model-card-heading span:first-child { color: var(--muted); font-size: 11px; }
.model-card h3 { margin: 4px 0 0; font-size: 13px; overflow-wrap: anywhere; }
.model-status { flex: 0 0 auto; padding: 5px 7px; border-radius: 4px; background: var(--surface-muted); font-size: 10px; font-weight: 800; }
.model-status.calisiyor { background: #e1f2e7; color: var(--green); }
.model-status.yavaş, .model-status.test-edilmedi { background: #fff0db; color: var(--orange); }
.model-status.bozuk { background: #fce5e7; color: var(--red); }
.capability-row, .probe-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.capability { padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 10px; }
.capability.passed { border-color: #a9d5b9; color: var(--green); }
.capability.failed { border-color: #e4aab1; color: var(--red); }
.model-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 11px; color: var(--muted); font-size: 10px; }

.bank-transfer-box { margin-bottom: 14px; padding: 14px; border-left: 4px solid var(--orange); background: #fff7eb; }
.bank-transfer-box strong { display: block; margin-bottom: 6px; }
.bank-transfer-box p { margin: 3px 0; }
.bank-transfer-box span { color: var(--muted); font-size: 12px; }
.onboarding-steps { display: grid; gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--line); }
.onboarding-step { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; padding: 16px; background: var(--surface); }
.onboarding-step > strong { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 6px; background: var(--accent); color: white; }
.onboarding-step h3 { margin: 0 0 5px; font-size: 14px; }
.onboarding-step p { margin: 0; color: var(--muted); line-height: 1.5; }

.rail-heading { justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.rail-heading img { opacity: .6; }
.rail-list { display: grid; gap: 8px; margin-top: 12px; }
.rail-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
.rail-row span:last-child { font-weight: 800; }
.rail-row .pass { color: var(--green); }
.rail-row .degraded, .rail-row .blocked { color: var(--orange); }
.rail-row .failed { color: var(--red); }
.rail-divider { height: 1px; margin: 18px 0; background: var(--line); }
.rail-model { margin-top: 10px; padding: 10px; border-left: 3px solid var(--accent); background: var(--accent-soft); color: var(--accent-dark); font-size: 12px; font-weight: 800; overflow-wrap: anywhere; }
.security-note { display: flex; gap: 8px; margin-top: 9px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.dot { flex: 0 0 auto; width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; }
.dot.green { background: var(--green); }

@media (max-width: 1100px) { .layout { grid-template-columns: 240px minmax(0, 1fr); } .right-rail { display: none; } .management-form, .compact-form { grid-template-columns: repeat(2, minmax(150px, 1fr)); } .activity-grid { grid-template-columns: 1fr; } .help-grid, .documentation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .worker-summary { grid-template-columns: repeat(3, minmax(100px, 1fr)); } }
@media (max-width: 760px) { .topbar { padding: 0 13px; } .layout { display: block; } .sidebar { border-right: 0; border-bottom: 1px solid var(--line); } .main-content { padding: 14px; } .view-panel { min-height: auto; } .chat-messages { min-height: 300px; max-height: none; } .test-grid, .management-form, .compact-form, .help-grid, .download-grid, .model-grid, .model-filters, .documentation-grid { grid-template-columns: 1fr; } .worker-summary { grid-template-columns: repeat(2, minmax(100px, 1fr)); } .download-card { grid-template-columns: 1fr; } .download-action { grid-column: 1; grid-row: auto; } .top-actions .status-pill { display: none; } .view-tabs { overflow-x: auto; } .view-tab { white-space: nowrap; } .model-meta { flex-direction: column; } }
