:root {
  --bg: #0d1117; --panel: #161b22; --line: #30363d; --text: #e6edf3; --muted: #8b949e;
  --blue: #1f6feb; --blue-text: #58a6ff; --green: #238636; --green-text: #3fb950;
  --red: #da3633; --red-text: #f85149; --yellow-text: #d29922;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--blue-text); }
header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--panel); }
header h1 { font-size: 17px; margin: 0; }
header .grow { flex: 1; }
main { max-width: 1100px; margin: 0 auto; padding: 20px 24px 60px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.card h2, .card h3 { margin: 0 0 10px; font-size: 15px; }
.hint, .muted { color: var(--muted); font-size: 12.5px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); flex: 1; min-width: 160px; }
input, select, textarea { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font: inherit; width: 100%; }
textarea { min-height: 70px; resize: vertical; }
.btn { background: #21262d; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px 14px; font: inherit; cursor: pointer; text-decoration: none; display: inline-block; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.danger { color: var(--red-text); }
.btn.small { padding: 4px 10px; font-size: 12.5px; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); color: var(--muted); }
.badge.ok { color: var(--green-text); border-color: var(--green); }
.badge.expiring { color: var(--yellow-text); border-color: var(--yellow-text); }
.badge.expired, .badge.revoked { color: var(--red-text); border-color: var(--red); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
.table-wrap { overflow-x: auto; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--line); padding: 10px 16px; border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; }
.toast.error { border-color: var(--red); color: var(--red-text); }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--line); flex: none; }
.list-item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.list-item:last-child { border-bottom: 0; }
.grow { flex: 1; min-width: 0; }
.copy { font-family: ui-monospace, monospace; font-size: 12px; word-break: break-all; background: var(--bg); padding: 8px; border-radius: 6px; border: 1px solid var(--line); }
.nav a { color: var(--muted); text-decoration: none; margin-right: 14px; }
.nav a.active { color: var(--text); font-weight: 600; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.thumb { position: relative; width: 110px; height: 138px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--bg); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.logo { width: 200px; height: 90px; background: repeating-conic-gradient(#8883 0% 25%, transparent 0% 50%) 0 0 / 16px 16px; }
.thumb.logo img { object-fit: contain; padding: 8px; box-sizing: border-box; }
.thumb button { position: absolute; top: 4px; right: 4px; background: var(--panel); }
.platform-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.platform { display: flex; flex-direction: column; gap: 10px; }
.platform .head { display: flex; gap: 12px; align-items: center; }
.tip { border-bottom: 1px dotted var(--muted); cursor: help; }
@media (max-width: 640px) {
  header, main { padding-left: 16px; padding-right: 16px; }
}
.tabs { display: flex; gap: 4px; padding: 10px 24px 0; flex-wrap: wrap; border-bottom: 1px solid var(--line); background: var(--panel); align-items: flex-end; }
.tabs:empty { display: none; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 8px 12px; font: inherit; cursor: pointer; }
.tab.active { color: var(--text); border-bottom-color: #f78166; font-weight: 600; }
@media (max-width: 640px) { .tabs { padding-left: 16px; padding-right: 16px; } }
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.subtab { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 8px 12px; font: inherit; cursor: pointer; }
.subtab.active { color: var(--text); border-bottom-color: #f78166; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 12.5px; border: 1px solid var(--line); background: var(--bg); }
.chip.ok { border-color: var(--green); color: var(--green-text); }
.chip.expiring { border-color: var(--yellow-text); color: var(--yellow-text); }
.chip.expired { border-color: var(--red); color: var(--red-text); }
.chip-check { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.chip-check input[type=checkbox] { width: auto; }
.switch { display: flex; gap: 8px; align-items: center; }
.switch input { width: auto; }
.pillar { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); margin-bottom: 10px; }
.pillar.off { opacity: .6; }
.pillar-head { display: flex; gap: 8px; align-items: center; padding: 10px 12px; flex-wrap: wrap; }
.pillar-title { background: none; border: 0; color: var(--text); font: inherit; font-weight: 600; text-align: left; cursor: pointer; padding: 4px 0; }
.pillar-title:hover { color: var(--blue); }
.pillar-body { padding: 12px; border-top: 1px solid var(--line); }
.as-fab { position: fixed; right: 20px; bottom: 20px; z-index: 50; background: var(--blue); color: #fff; border: 0; border-radius: 999px; padding: 12px 18px; font: inherit; font-weight: 600; cursor: pointer; box-shadow: 0 6px 20px #0006; }
.as-panel { position: fixed; right: 20px; bottom: 20px; z-index: 50; width: 380px; max-width: calc(100vw - 32px); height: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px #0008; }
.as-head { display: flex; gap: 6px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.as-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.as-msg { padding: 8px 10px; border-radius: 10px; max-width: 88%; line-height: 1.45; font-size: 13.5px; overflow-wrap: anywhere; }
.as-msg.user { align-self: flex-end; background: var(--blue); color: #fff; }
.as-msg.assistant { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); }
.as-suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 8px; }
.as-suggest:empty { display: none; }
.as-input { display: flex; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); }
.as-input textarea { flex: 1; resize: none; min-height: 0; }
@media (max-width: 640px) { .as-panel { right: 16px; bottom: 16px; height: calc(100vh - 32px); } .as-fab { right: 16px; bottom: 16px; } }
.acc-pills { display: flex; gap: 6px; flex-wrap: wrap; padding-bottom: 6px; }
.acc-pill { display: inline-flex; gap: 6px; align-items: center; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.acc-pill.active { border-color: var(--blue); background: #1f6feb22; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.green { background: var(--green-text); } .dot.yellow { background: var(--yellow-text); } .dot.red { background: var(--red-text); }
.statusbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 14px; margin-bottom: 12px; background: #1f6feb14; border: 1px solid var(--line); border-radius: 8px; font-size: 13.5px; }
.savebar { position: sticky; bottom: 0; display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 10px 170px 10px 0; margin-top: 12px; background: var(--bg); border-top: 1px solid var(--line); z-index: 5; }
.topic-row { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.topic-row:last-child { border-bottom: 0; }
.topic-row.off input:not([type=checkbox]) { opacity: .55; }
.muted-card { opacity: .65; }
pre.prompt { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-size: 12.5px; max-height: 420px; overflow: auto; margin-top: 8px; }
@media (max-width: 640px) { .savebar { padding-right: 0; padding-bottom: 70px; } }
