/* Support panel (system.lucksutility.com), in the app's look: dark surfaces, thin borders, mono labels, purple. */
:root {
  color-scheme: dark;
  --bg: #08080b; --panel: #101015; --field: #0c0c10; --hover: #1a1a22;
  --border: #1f1f28; --border-strong: #2c2c38;
  --text: #ececf3; --muted: #8a8a99; --faint: #6c6c7c;
  --accent: #7c6cf2; --accent-hi: #978aff; --accent-soft: rgba(124, 108, 242, .14); --accent-line: rgba(124, 108, 242, .45);
  --ok: #3ddc84; --warn: #f5b942; --bad: #ff5d5d;
  --radius: 16px; --radius-sm: 10px; --ease: cubic-bezier(.22, .9, .24, 1);
  --font: "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, sans-serif;
  --mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { background: var(--bg); }
body { margin: 0; color: var(--text); font: 14.5px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }

/* ---------- buttons and fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--hover); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: border-color .2s var(--ease), background .2s var(--ease); }
.btn:hover { border-color: var(--accent-line); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hi); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: rgba(255, 93, 93, .5); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; color: var(--muted); }
input, select, textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--field); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-line); }
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
select { width: auto; }

/* ---------- sign-in ---------- */
.sign-in { min-height: 100vh; display: grid; place-content: center; gap: 22px; padding: 24px 16px; }
.sign-in .brand { justify-content: center; }
.sign-card { width: min(400px, calc(100vw - 32px)); }
.sign-card h1 { font-size: 22px; margin-bottom: 16px; }
.sign-card .field { margin-bottom: 14px; }
.sign-card .btn + .btn { margin-top: 8px; }
.code { letter-spacing: .3em; font-size: 20px; text-align: center; }
.error { margin-top: 12px; color: var(--bad); font-size: 13.5px; min-height: 1.2em; }

/* ---------- top bar and tabs ---------- */
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { border-radius: 8px; }
.wordmark { font-size: 15px; letter-spacing: .28em; font-weight: 300; white-space: nowrap; }
.wordmark b { font-weight: 700; }
.top { position: sticky; top: 0; z-index: 10; background: rgb(8, 8, 11); border-bottom: 1px solid var(--border); }
.top-row { display: flex; align-items: center; gap: 14px; max-width: 1180px; margin: 0 auto; padding: 14px 32px 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.pill.ok { color: var(--ok); border-color: rgba(61, 220, 132, .35); }
.pill.warn { color: var(--warn); border-color: rgba(245, 185, 66, .35); }
.pill.bad { color: var(--bad); border-color: rgba(255, 93, 93, .35); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; min-width: 0; }
.who { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs { display: flex; gap: 30px; max-width: 1180px; margin: 0 auto; padding: 0 32px; }
.tabs a { position: relative; padding: 12px 0 13px; color: var(--muted); font-size: 15.5px; text-decoration: none; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); font-weight: 600; }
.tabs a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.count:not(:empty) { margin-left: 4px; padding: 0 7px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; }

/* ---------- page ---------- */
#view { max-width: 1180px; margin: 0 auto; padding: 28px 32px 64px; outline: none; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.head h1 { font-size: 26px; line-height: 1.2; font-weight: 650; overflow-wrap: anywhere; }
.back { display: inline-block; margin-bottom: 12px; color: var(--muted); font-size: 13.5px; text-decoration: none; }
.back:hover { color: var(--text); }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; min-width: 0; }
.card + .card, .grid + .card, .card + .grid { margin-top: 14px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.label { font-family: var(--mono); font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.empty { color: var(--muted); }
.search { display: flex; gap: 10px; }
.search input { flex: 1; }

/* rows of facts */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* clickable lists */
.list { display: grid; }
.list a { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; padding: 12px 4px; border-top: 1px solid var(--border); text-decoration: none; }
.list a:first-child { border-top: 0; }
.list a:hover .title { color: var(--accent-hi); }
.list .title { font-weight: 600; overflow-wrap: anywhere; }
.list .meta { grid-column: 1 / -1; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }

/* a key */
.key + .key { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.key-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.key-head .mono { font-size: 15px; font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.actions .hint { color: var(--muted); font-size: 13px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form input { width: 230px; }

/* e-mails and history */
.rows { display: grid; }
.rows li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.rows li:first-child { border-top: 0; }

/* tickets */
.segments { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); margin-bottom: 14px; }
.segments a { padding: 6px 14px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 14px; }
.segments a[aria-current="page"] { background: var(--hover); color: var(--text); font-weight: 600; }
.thread { display: grid; gap: 12px; }
.msg { max-width: 760px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--field); }
.msg.staff { justify-self: end; border-color: var(--accent-line); background: var(--accent-soft); }
.msg .who-line { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.msg p { white-space: pre-wrap; overflow-wrap: anywhere; }
.reply { display: grid; gap: 10px; margin-top: 14px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 30; padding: 10px 16px; border: 1px solid var(--border-strong);
  border-radius: 12px; background: #15151c; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); font-size: 14px; max-width: calc(100vw - 32px); }
.toast.bad { color: var(--bad); }
.notice { margin: 24px; color: var(--warn); }

@media (max-width: 760px) {
  .top-row, .tabs, #view { padding-left: 16px; padding-right: 16px; }
  .grid { grid-template-columns: 1fr; }
  .wordmark { display: none; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 8px; }
  .inline-form input { width: 100%; }
}
.results { margin-top: 14px; }
.grid > .card { margin-top: 0; }
