:root {
  color-scheme: dark;
  --bg: #101216;
  --rail: #15181d;
  --card: #1a1e24;
  --border: #2c323a;
  --text: #f2f4f6;
  --muted: #a6b0bb;
  --accent: #a7e9c9;
  --accent-dark: #16392d;
  font-family: "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.045em; line-height: 1.1; }
h2 { font-size: 1.02rem; font-weight: 660; }
a { color: var(--accent); }
button, input, textarea, select { font: inherit; }
button, .primary, summary, select { cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: .65rem 1rem; border-radius: 9px; font-size: .9rem; font-weight: 650; text-decoration: none; }
.primary { background: var(--accent); border: 1px solid var(--accent); color: #11291e; }
.primary:hover { background: #c4f6dc; }
.secondary { color: var(--text); border: 1px solid var(--border); background: #20252c; }
.secondary:hover { background: #2a3039; }
.eyebrow { color: var(--accent); font-size: .7rem; font-weight: 700; letter-spacing: .17em; }
.muted { color: var(--muted); font-size: .88rem; }
.feedback { color: var(--muted); font-size: .9rem; line-height: 1.45; }
.feedback:empty { display: none; }
.mark { width: 40px; height: 40px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.mark.large { width: 70px; height: 70px; border-radius: 15px; }
.gate { width: min(425px, calc(100% - 32px)); margin: max(12vh, 45px) auto; padding: 42px 30px; display: grid; gap: 15px; justify-items: center; text-align: center; background: var(--card); border: 1px solid var(--border); border-radius: 17px; }
.gate h1 { font-size: 2rem; }
.upload { position: relative; overflow: hidden; margin-top: 6px; }
.upload:focus-within { outline: 2px solid var(--accent); outline-offset: 4px; }
.upload input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.layout { min-height: 100vh; display: grid; grid-template-columns: 218px minmax(0, 1fr); }
.sidebar { background: var(--rail); border-right: 1px solid var(--border); padding: 27px 18px; display: flex; flex-direction: column; gap: 32px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand strong { display: block; font-size: 1.1rem; letter-spacing: -.02em; }
.brand span { display: block; color: var(--muted); font-size: .78rem; margin-top: 2px; }
.navigation { display: grid; gap: 6px; }
.navigation button { border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); display: flex; align-items: center; gap: 10px; text-align: left; padding: .66rem .7rem; font-weight: 600; font-size: .9rem; }
.navigation button:hover { background: #242932; }
.navigation button[aria-current] { color: var(--accent); border-color: #31493f; background: #203129; }
.navigation svg { width: 19px; height: 19px; flex: none; }
.nav-count { margin-left: auto; font-size: .72rem; padding: 2px 7px; border-radius: 99px; color: var(--accent); background: var(--accent-dark); }
.logout { margin-top: auto; }
.workspace { width: min(100%, 1310px); margin-inline: auto; padding: clamp(22px, 4vw, 58px); }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 26px; }
.page-heading .eyebrow { margin-bottom: 7px; }
#panel-error { margin-bottom: 16px; color: #ffb4ac; }
.metrics { display: grid; grid-template-columns: 1fr 1fr .74fr; gap: 15px; margin-bottom: 18px; }
.card { border: 1px solid var(--border); border-radius: 13px; background: var(--card); padding: 20px; min-width: 0; }
.triplet { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin-top: 20px; gap: 7px; }
.triplet > div { min-width: 0; }
.triplet strong, .opening-card strong, .activity-count strong { display: block; font-variant-numeric: tabular-nums; font-size: clamp(1.25rem, 2.15vw, 2.15rem); letter-spacing: -.045em; overflow-wrap: anywhere; }
.triplet span, .opening-card span, .activity-count span { color: var(--muted); font-size: .78rem; }
.opening-card strong { margin-top: 16px; color: var(--accent); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.card-head .muted { margin-top: 5px; }
.segments { display: inline-flex; gap: 3px; background: #111419; border: 1px solid var(--border); border-radius: 9px; padding: 3px; }
.segments button { border: 0; border-radius: 6px; background: transparent; color: var(--muted); padding: 7px 10px; font-size: .82rem; }
.segments button[aria-pressed="true"] { background: #2c353a; color: var(--text); }
.activity-count { margin: 18px 0 6px; }
.chart { min-height: 130px; }
.chart svg { width: 100%; display: block; max-height: 360px; }
.chart text { fill: var(--muted); font-size: 12px; font-family: inherit; }
.chart-grid { stroke: #323940; }
.chart-fill { fill: #a7e9c91f; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linejoin: round; }
.chart-dot { fill: var(--accent); stroke: var(--card); stroke-width: 1; }
.data-details { border-top: 1px solid var(--border); padding-top: 12px; color: var(--muted); font-size: .85rem; }
.data-details table { width: 100%; margin-top: 12px; text-align: left; border-collapse: collapse; }
.data-details td, .data-details th { padding: 6px; border-bottom: 1px solid var(--border); }
.filter-label { color: var(--muted); font-size: .88rem; }
.filter-label select { margin-left: 7px; }
select, input, textarea { color: var(--text); background: #12151a; border: 1px solid #3a414b; border-radius: 7px; padding: .65rem .75rem; }
.ticket-list { display: grid; gap: 9px; margin-top: 16px; }
.ticket { border: 1px solid var(--border); border-radius: 8px; background: #15191e; }
.ticket summary { padding: 13px; display: flex; justify-content: space-between; align-items: center; gap: 12px; list-style: none; }
.ticket summary::-webkit-details-marker { display: none; }
.ticket summary::after { content: "+"; color: var(--muted); margin-left: 2px; }
.ticket[open] summary::after { content: "−"; }
.ticket-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ticket-title small { display: block; color: var(--muted); margin-top: 4px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: .76rem; border-radius: 99px; padding: 4px 8px; font-weight: 650; background: #282e36; }
.source-launcher { color: #c4c0ff; background: #302b48; }
.source-site { color: #a5d7ff; background: #203748; }
.status-open { color: var(--accent); background: var(--accent-dark); }
.status-closed { color: var(--muted); }
.ticket-content { padding: 14px; border-top: 1px solid var(--border); }
.ticket-content p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; margin-bottom: 14px; }
.empty { padding: 24px 6px; text-align: center; color: var(--muted); }
#more-tickets { margin-top: 14px; }
.site-header { margin: auto; width: min(960px, calc(100% - 36px)); padding: 17px 0; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.site-header a { text-decoration: none; font-weight: 620; }
.site-main { width: min(700px, calc(100% - 36px)); margin: 0 auto 52px; }
.hero { display: grid; justify-items: center; text-align: center; gap: 16px; padding: 40px 0 34px; }
.hero-mark { width: 108px; height: 108px; border-radius: 24px; border: 1px solid var(--border); }
.hero h1 { font-size: clamp(3rem, 9vw, 5.2rem); }
.support-card { padding: clamp(16px, 5vw, 30px); }
.support-card h2 { font-size: 1.5rem; margin-bottom: 18px; }
form { display: grid; gap: 13px; }
form label { display: grid; gap: 5px; font-size: .9rem; }
textarea { resize: vertical; }
.form-footer { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.form-footer button { margin-left: auto; }
@media (max-width: 1050px) { .metrics { grid-template-columns: 1fr 1fr; } .opening-card { grid-column: span 2; } }
@media (max-width: 700px) {
  .layout { display: block; }
  .sidebar { position: static; height: auto; display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 13px 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar .navigation { grid-column: 1 / -1; grid-row: 2; grid-template-columns: 1fr 1fr; }
  .logout { margin: 0; }
  .workspace { padding: 21px 14px; }
  .card { padding: 15px; }
}
@media (max-width: 430px) { .metrics { grid-template-columns: 1fr; } .opening-card { grid-column: auto; } .ticket summary { flex-wrap: wrap; } .chart text { font-size: 15px; } }

.content-toolbar, .content-actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.content-toolbar { margin-bottom: 13px; }
.content-toolbar strong, .content-toolbar .muted { display: block; }
.content-toolbar .muted { margin-top: 3px; }
.content-status { margin-bottom: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.content-console { margin-bottom: 15px; }
.content-console summary { cursor: pointer; font-weight: 660; }
.content-console pre { max-height: 230px; overflow: auto; margin: 12px 0 0; padding: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font: .82rem/1.5 Consolas, monospace; }
.content-card { margin-bottom: 15px; }
.content-card form, #content-pack, .content-import { margin-top: 12px; }
.content-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.content-fields :is(input, select) { min-width: 0; width: 100%; }
.content-actions .content-toggle { display: flex; align-items: center; gap: 8px; }
.content-toggle input { accent-color: var(--accent); }
.content-import { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.content-import .upload, .content-lists .upload { margin-top: 0; cursor: pointer; }
.upload:has(input:disabled) { opacity: .6; cursor: wait; }
.content-files { list-style: none; padding: 0; margin: 12px 0 0; max-height: 390px; overflow: auto; }
.content-files:empty { display: none; }
.content-file { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; border-top: 1px solid var(--border); font-size: .85rem; }
.content-file > span { overflow-wrap: anywhere; }
.content-file button { flex-shrink: 0; padding: 5px 8px; min-height: 30px; font-size: .78rem; }
@media (max-width: 530px) { .content-fields { grid-template-columns: 1fr; } }

.content-search { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 12px; }
.content-search input[type="search"] { flex: 1 1 180px; min-width: 0; }
.content-search .upload { margin: 0; }
.mod-menu { flex-shrink: 0; text-align: right; }
.mod-menu summary { list-style: none; padding: 2px 9px; min-height: 28px; }
.mod-menu summary::-webkit-details-marker { display: none; }
.mod-options { display: flex; gap: 6px; margin-top: 5px; }
@media (max-width: 530px) {
  .content-file:has(.mod-menu[open]) { flex-wrap: wrap; }
  .mod-menu[open] { margin-left: auto; }
}

#mod-drop-zone { border: 1px solid transparent; border-radius: 9px; padding: 0 8px 8px; margin: 0 -9px; }
#mod-drop-zone.drop-ready { border-color: var(--accent); background: var(--accent-dark); }
#mod-drop-hint { margin-top: 8px; }
.content-tooltip {
  position: fixed; z-index: 100; width: max-content; max-width: min(270px, calc(100vw - 16px));
  pointer-events: none; color: var(--text); background: #292f37; border: 1px solid #46515e;
  border-radius: 7px; padding: 7px 10px; font-size: .82rem; line-height: 1.4;
  box-shadow: 0 4px 16px #0006;
}

#release-form { margin-top: 14px; }
.release-fields { display: grid; grid-template-columns: minmax(90px, .55fr) minmax(0, 1fr); gap: 12px; }
.release-fields input { min-width: 0; width: 100%; }
.release-feedback { margin-top: 10px; }
.release-notes p { margin-bottom: 0; }
@media (max-width: 530px) { .release-fields { grid-template-columns: 1fr; } }
