:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  color: #f5f5fa;
  background: #10121a;
  --text: #f5f5fa;
  --muted: #adafc1;
  --line: #303244;
  --panel: #1a1c28;
  --accent: #c4b8ff;
  --good: #8de5ba;
  --warn: #f5ce92;
  --danger: #ffb1b7;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: radial-gradient(ellipse at 40% 0%, #232036, #10121a 30rem);
}

.shell {
  max-width: 35rem;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right))
    max(28px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}

.topbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: -.015em; }
.brand img { border-radius: 9px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 8vw, 2.6rem); line-height: 1.1; letter-spacing: -.045em; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; }
.secondary { color: var(--muted); font-size: .875rem; line-height: 1.45; }
.caption { color: var(--accent); font-size: .84rem; font-weight: 650; }
.section-title { margin-block: 24px 10px; font-size: 1.05rem; font-weight: 680; }

.pairing { margin-top: 34px; padding: clamp(20px, 6vw, 32px); }
.pairing .caption { margin-bottom: 10px; }
.pairing .secondary { margin-top: 12px; }
.pairing .primary { margin-top: 10px; }
.pair-form { display: grid; gap: 9px; margin-top: 26px; }
.pair-form label { font-size: .9rem; font-weight: 600; }
.pair-form input {
  min-width: 0;
  min-height: 52px;
  padding: 12px;
  border: 1px solid #53566c;
  border-radius: 10px;
  color: var(--text);
  background: #11131c;
  font-size: 1rem;
}

.primary, .text-button { min-height: 44px; border-radius: 10px; font-weight: 650; }
.primary { padding: 11px 16px; border: 1px solid transparent; background: var(--accent); color: #20143f; }
.text-button { padding: 8px 10px; border: 1px solid transparent; color: var(--accent); background: transparent; }
.primary:disabled, .text-button:disabled { opacity: .65; }
.status-panel {
  margin-top: 20px;
  padding: 10px 18px 18px;
  background: linear-gradient(120deg, #26223a, #1a1c28 70%);
}
.status-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.status-top .text-button { margin-right: -10px; }
.pc-state-line { display: flex; align-items: center; gap: 11px; margin: 5px 0 7px; font-size: 1.55rem; font-weight: 700; letter-spacing: -.03em; }
.connection-dot { width: .65rem; height: .65rem; flex: 0 0 auto; border-radius: 50%; background: var(--muted); }
.connection-dot[data-state="online"] { background: var(--good); box-shadow: 0 0 0 4px #8de5ba20; }
.connection-dot[data-state="offline"] { background: var(--warn); box-shadow: 0 0 0 4px #f5ce9220; }

.actions { display: grid; gap: 8px; }
.actions .section-title { margin-bottom: 2px; }
.action {
  width: 100%;
  min-height: 74px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 12px;
  align-items: center;
  gap: 12px;
  text-align: start;
  color: var(--text);
}
.action:enabled:active, .text-button:enabled:active { background: #343047; }
.action:disabled .action-title { color: #babaca; }
.action:disabled .chevron { visibility: hidden; }
.action-label { display: grid; gap: 3px; }
.action-title { font-size: .96rem; font-weight: 690; line-height: 1.19; }
.action-icon { position: relative; width: 36px; height: 36px; border-radius: 10px; color: var(--accent); background: #342c4e; }
.folder-icon::before { content: ""; position: absolute; inset: 14px 8px 9px; border: 1.5px solid currentColor; border-radius: 3px; }
.folder-icon::after { content: ""; position: absolute; top: 10px; left: 9px; width: 8px; height: 5px; border: 1.5px solid currentColor; border-bottom: none; border-radius: 3px 3px 0 0; }
.health-icon { color: #a4e7d4; background: #24423e; }
.health-icon::before, .health-icon::after { content: ""; position: absolute; top: 9px; left: 17px; width: 2px; height: 18px; border-radius: 2px; background: currentColor; }
.health-icon::after { transform: rotate(90deg); }
.chevron { width: 7px; height: 7px; border: solid var(--accent); border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); }

.feedback { padding-top: 4px; color: var(--warn); font-size: .875rem; line-height: 1.45; }
.notice { margin-top: 14px; padding: 10px 13px; border: 1px solid #624f37; border-radius: 12px; background: #2a231e; color: #f6ddb5; font-size: .875rem; line-height: 1.45; }
.notice .text-button { margin-left: -10px; }
.recovery .text-button + .text-button { margin-left: 0; }
.empty-tasks { padding: 0 0 10px; }
.task-list { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.task { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.task-title { font-size: .875rem; font-weight: 610; }
.task-state { font-size: .78rem; line-height: 1.3; text-align: end; color: var(--accent); }
.task-state[data-state="completed"] { color: var(--good); }
.task-state[data-state="failed"], .task-state[data-state="denied"] { color: var(--danger); }
.task-state[data-state="expired"], .task-state[data-state="unknown"] { color: var(--warn); }
.task time, .task .task-detail { grid-column: 1 / -1; }
.task time { font-size: .75rem; }
