:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --panel: #fff;
  --text: #17181a;
  --muted: #646970;
  --line: #dfe2e7;
  --accent: #24262b;
  --focus: #6d5dfc;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
a { color: inherit; }
button, input, textarea, select { font: inherit; }

.app-header {
  min-height: 68px;
  padding: 14px clamp(18px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand { font-size: 1.15rem; font-weight: 800; text-decoration: none; letter-spacing: -.03em; }
.brand span { color: var(--muted); font-weight: 600; }
.app-main { width: min(1080px, calc(100% - 32px)); margin: 42px auto; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .75fr); gap: 24px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: clamp(22px, 4vw, 38px); box-shadow: 0 14px 38px rgb(30 35 45 / 7%); }
.auth-panel { width: min(560px, 100%); margin: 9vh auto 0; }
.detail { grid-column: 1 / -1; }
.kicker { display: block; margin-bottom: 8px; color: var(--muted); font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2 { margin: 0 0 12px; letter-spacing: -.035em; }
p { line-height: 1.6; }
.form { display: grid; gap: 16px; margin-top: 24px; }
label { display: grid; gap: 7px; color: #32353a; font-size: .9rem; font-weight: 700; }
input, textarea, select { width: 100%; border: 1px solid #cbd0d8; border-radius: 8px; padding: 11px 12px; background: #fff; color: var(--text); }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus, button:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 30%, transparent); outline-offset: 2px; border-color: var(--focus); }
.actions, .profile-bar, .operator-controls { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; }
.button { min-height: 42px; border: 1px solid var(--accent); border-radius: 8px; padding: 9px 16px; cursor: pointer; font-weight: 750; }
.button.primary { background: var(--accent); color: #fff; }
.button.secondary { background: #fff; color: var(--accent); }
.button:disabled { cursor: wait; opacity: .6; }
.text-button { border: 0; padding: 0; margin-bottom: 24px; background: none; cursor: pointer; font-weight: 750; }
.message { min-height: 1.3em; margin: 0; color: #29613d; }
.message.error { color: #a22c2c; }
.muted, .support-link, .optional { color: var(--muted); font-weight: 400; }
.hidden { display: none !important; }
.ticket-list, .thread { display: grid; gap: 12px; margin-top: 22px; }
.account-card { border: 1px solid var(--line); border-radius: 10px; padding: 16px; background: #fff; }
.account-card[role="button"] { cursor: pointer; }
.account-card[role="button"]:hover { border-color: #9ca3af; background: #fafafa; }
.account-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.status-pill, .operator-badge { display: inline-flex; border-radius: 999px; padding: 4px 9px; background: #eceef2; font-size: .75rem; font-weight: 800; }
.status-pill[data-status="open"] { background: #e5f4ea; color: #20683b; }
.status-pill[data-status="pending"] { background: #fff2cf; color: #785a00; }
.status-pill[data-status="closed"] { background: #e5e7eb; color: #4b5563; }
.operator-badge { background: #ece9ff; color: #4a3ab4; align-self: center; }
.operator-controls { margin: 22px 0; padding: 16px; border: 1px solid #cbc4ff; border-radius: 10px; background: #f7f5ff; }
.operator-controls strong { width: 100%; }
.operator-controls label { min-width: 190px; flex: 1; }
.reply { border-top: 1px solid var(--line); padding-top: 24px; }

@media (max-width: 760px) {
  .app-header, .profile-bar { align-items: flex-start; }
  .app-header { flex-direction: column; }
  .workspace { grid-template-columns: 1fr; }
  .app-main { margin: 22px auto; }
  .panel { padding: 22px; }
}
