:root {
  --bg: #0c0c0a;
  --panel: #151511;
  --panel-2: #1b1b16;
  --line: rgba(255,255,255,.09);
  --text: #f7f3e7;
  --muted: #9c998f;
  --gold: #d4a72c;
  --gold-soft: rgba(212,167,44,.15);
  --green: #6ecf9a;
  --red: #ed7c70;
  --radius: 18px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 75% -10%, rgba(212,167,44,.13), transparent 28rem), var(--bg); }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 224px 1fr; grid-template-rows: 64px 1fr; max-width: 1440px; margin: auto; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding: 0 30px; border-bottom: 1px solid var(--line); background: rgba(12,12,10,.8); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; color: var(--gold); border: 1px solid rgba(212,167,44,.46); border-radius: 50%; background: radial-gradient(circle at 34% 26%, rgba(212,167,44,.22), transparent 52%), #14140f; box-shadow: inset 0 0 0 4px rgba(212,167,44,.05); }
.brand-mark svg { width: 25px; height: 25px; }
.brand-copy { display: flex; flex-direction: column; gap: 2px; line-height: 1; }
.brand-copy strong { font-size: 11px; font-weight: 850; letter-spacing: .13em; }
.brand-copy small { color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: .15em; }
.app-mark { display: grid; place-items: center; width: 36px; height: 36px; color: var(--gold); border: 1px solid rgba(212,167,44,.28); border-radius: 11px; background: rgba(212,167,44,.07); }
.app-mark svg { width: 23px; height: 23px; }
.sidebar { padding: 20px 14px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.nav-item { display: flex; gap: 12px; align-items: center; width: 100%; padding: 12px 14px; color: var(--muted); background: transparent; border: 0; border-radius: 11px; text-align: left; font-size: 14px; }
.nav-item span { width: 18px; text-align: center; color: currentColor; font-size: 18px; }
.nav-item.active, .nav-item:hover { background: var(--gold-soft); color: var(--gold); }
.hidden { display: none !important; }
.content { width: min(100%, 1120px); padding: 40px clamp(20px, 4vw, 56px) 72px; }
.eyebrow { color: var(--gold); letter-spacing: .14em; font-size: 11px; font-weight: 800; text-transform: uppercase; margin: 0 0 10px; }
h1 { font-size: clamp(30px, 4vw, 46px); line-height: 1.04; margin: 0; letter-spacing: -.045em; }
h2 { font-size: 20px; margin: 0; letter-spacing: -.025em; }
p { color: var(--muted); line-height: 1.5; }
.lead { max-width: 620px; font-size: 16px; margin: 14px 0 0; }
.section-head { display: flex; gap: 16px; justify-content: space-between; align-items: flex-end; margin: 34px 0 14px; }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.card { background: linear-gradient(145deg, rgba(255,255,255,.035), rgba(255,255,255,.012)); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.metric { grid-column: span 4; min-height: 132px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.metric-value { font-size: 32px; font-weight: 760; letter-spacing: -.05em; }
.metric-label { color: var(--muted); font-size: 13px; }
.metric.gold .metric-value { color: var(--gold); }
.metric.expired .metric-value, .metric.expired .metric-icon { color: var(--red); }
.metric-icon { width: 28px; height: 28px; margin-top: 10px; color: rgba(247,243,231,.45); }
.metric.gold .metric-icon { color: var(--gold); }
.subscription-date { white-space: nowrap; font-size: clamp(24px, 3vw, 32px); letter-spacing: -.065em; }
.current-job { grid-column: span 12; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.job-copy { min-width: 0; }
.job-channel { font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; margin-top: 7px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status.running::before, .status.ready::before { background: var(--green); box-shadow: 0 0 0 4px rgba(110,207,154,.11); }
.status.queued::before { background: var(--gold); }
.status.failed::before, .status.error::before, .status.reauthorize::before { background: var(--red); }
.status.limited::before { background: var(--gold); }
.button { border: 0; border-radius: 11px; padding: 12px 16px; font-weight: 750; color: #10100d; background: var(--gold); white-space: nowrap; }
.button:hover { filter: brightness(1.08); }
.button.secondary { color: var(--text); background: var(--panel-2); border: 1px solid var(--line); }
.button.danger { color: var(--red); }
.button:disabled { opacity: .5; cursor: wait; }
.form-card { max-width: 690px; margin-top: 28px; }
.field-label { display: block; margin: 20px 0 8px; color: var(--muted); font-size: 13px; }
.input { width: 100%; padding: 15px 16px; color: var(--text); border: 1px solid var(--line); border-radius: 12px; outline: 0; background: #10100d; }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.form-footer { display: flex; gap: 12px; align-items: center; margin-top: 18px; }
.fine-print { margin: 0; font-size: 12px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.job-row, .account-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; }
.job-meta, .account-meta { display: flex; flex-wrap: wrap; gap: 8px 15px; color: var(--muted); font-size: 12px; margin-top: 8px; }
.job-row .button { align-self: center; }
.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 34px 20px; color: var(--muted); text-align: center; }
.results-head { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin-bottom: 12px; }
.result-list { display: grid; gap: 8px; }
.result-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.018); }
.result-row a { text-decoration: none; color: var(--gold); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-row .contact { color: var(--text); font-weight: 500; }
.date { color: var(--muted); font-size: 12px; white-space: nowrap; }
.notice { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; padding: 15px; border: 1px solid rgba(212,167,44,.28); border-radius: 14px; background: rgba(212,167,44,.07); }
.notice strong { color: var(--gold); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 130px); max-width: min(90vw, 520px); padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: #24231e; box-shadow: 0 14px 40px rgba(0,0,0,.35); opacity: 0; transition: .2s; z-index: 20; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.loading { display: grid; min-height: 45vh; place-content: center; text-align: center; }
.loader { width: 28px; height: 28px; margin: auto; border: 3px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .shell { display: block; padding-bottom: 72px; }
  .topbar { height: 56px; padding: 0 18px; }
  .sidebar { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; padding: 7px 6px calc(7px + env(safe-area-inset-bottom)); flex-direction: row; justify-content: space-around; border: 0; border-top: 1px solid var(--line); background: rgba(15,15,13,.96); backdrop-filter: blur(14px); }
  .nav-item { justify-content: center; flex: 1; padding: 8px 3px; gap: 0; font-size: 0; }
  .nav-item span { font-size: 21px; }
  .content { padding: 28px 16px 36px; }
  .metric { grid-column: span 6; min-height: 128px; }
  /* Третья карточка занимает всю строку: на мобильном нет пустой половины
     экрана, а дата при этом остаётся аккуратно в одну строку. */
  .metric.subscription { grid-column: span 12; }
  .subscription-date { font-size: 25px; }
  .current-job, .job-row, .account-row { display: flex; flex-direction: column; align-items: stretch; }
  .result-row { grid-template-columns: 1fr; gap: 7px; }
  .date { white-space: normal; }
  .brand-copy strong { font-size: 10px; }
  .brand-copy small { font-size: 7px; }
}
