:root {
  --bg: #0e1117;
  --panel: #151a23;
  --panel-2: #11161f;
  --line: #232a36;
  --text: #e8edf5;
  --muted: #97a3b6;
  --accent: #4f8cff;
  --accent-2: #3f74d8;
  --danger: #ea5b5b;
  --danger-2: #c94b4b;
  --free: #5dcf8f;
  --busy: #f2b76b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Manrope", "Segoe UI", sans-serif;
  background: radial-gradient(circle at 20% -20%, #1f2736, transparent 45%), var(--bg);
  color: var(--text);
}

p,
h1,
h2,
h3 {
  margin: 0;
}

.app-shell {
  width: min(680px, 100%);
  margin: 0 auto;
  padding: 18px 14px 28px;
  display: grid;
  gap: 12px;
}

.hero-kicker {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin-top: 6px;
  font-size: clamp(1.45rem, 5vw, 1.9rem);
}

.status-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.status-badge {
  border-radius: 999px;
  font-size: 0.86rem;
  padding: 6px 10px;
  font-weight: 700;
}

.status-badge.free {
  background: rgba(93, 207, 143, 0.16);
  color: var(--free);
}

.status-badge.busy {
  background: rgba(242, 183, 107, 0.17);
  color: var(--busy);
}

.status-main {
  margin-top: 8px;
  color: var(--muted);
}

.status-grid {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-block {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}

.metric-label {
  color: var(--muted);
  font-size: 0.82rem;
}

.metric-value {
  margin-top: 4px;
  font-size: 1rem;
  font-weight: 700;
}

.meta-line {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.panel-hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.inline-form {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.inline-form label {
  font-size: 0.9rem;
}

input,
button {
  font: inherit;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  background: #0f141d;
  color: var(--text);
  border-radius: 10px;
  padding: 11px 12px;
}

input:focus-visible,
button:focus-visible {
  outline: 2px solid rgba(79, 140, 255, 0.7);
  outline-offset: 1px;
}

.preset-buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.ghost-button,
.solid-button,
.danger-button {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 700;
}

.ghost-button {
  background: #1b2330;
  border-color: #2a3342;
  color: #c5d0e3;
}

.ghost-button.is-active {
  border-color: rgba(79, 140, 255, 0.7);
  color: #e7efff;
}

.solid-button {
  background: var(--accent);
  color: #f6f9ff;
}

.solid-button:hover {
  background: var(--accent-2);
}

.danger-button {
  margin-top: 10px;
  width: 100%;
  background: rgba(234, 91, 91, 0.15);
  border-color: rgba(234, 91, 91, 0.35);
  color: #ffb8b8;
}

.danger-button:hover {
  background: rgba(234, 91, 91, 0.24);
  color: #ffd6d6;
}

.solid-button:disabled,
.ghost-button:disabled,
.danger-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.history-empty {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.history-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 8px;
}

.history-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  padding: 9px 10px;
}

.history-main {
  font-weight: 700;
  font-size: 0.95rem;
}

.history-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.84rem;
}

.flash {
  min-height: 1.2em;
  color: #9db8ff;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0 2px;
}

.flash.error {
  color: #ff8f8f;
}

.pin-dialog {
  width: min(360px, calc(100% - 24px));
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  padding: 0;
}

.pin-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.pin-form {
  padding: 14px;
  display: grid;
  gap: 8px;
}

.pin-form label {
  font-size: 0.9rem;
}

.pin-error {
  min-height: 1.2em;
  color: #ff8f8f;
  font-size: 0.9rem;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

@media (max-width: 560px) {
  .status-grid {
    grid-template-columns: 1fr;
  }

  .preset-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dialog-actions {
    grid-template-columns: 1fr;
  }
}
