@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  color-scheme: light;
  --bg: #f4efe9;
  --ink: #1f1b16;
  --muted: #6b6057;
  --accent: #e07a5f;
  --accent-2: #3d405b;
  --panel: #fffaf3;
  --border: rgba(31, 27, 22, 0.12);
  --shadow: 0 18px 40px rgba(31, 27, 22, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #fff7ec, #f3ede5 55%, #ece5dd);
  min-height: 100vh;
}

.shell {
  min-height: 100vh;
  padding: 36px 44px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mast {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.mast-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mast-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.hero-strip {
  background: #111;
  padding: 10px 44px;
  height: 72px;
  margin: -36px -44px 4px;
  width: calc(100% + 88px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hero-mark {
  width: auto;
  height: 110px;
  margin-top: 13px;
  display: block;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 6vw, 44px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff3e5;
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--accent-2);
  box-shadow: var(--shadow);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #81b29a;
  box-shadow: 0 0 0 5px rgba(129, 178, 154, 0.2);
}

.status.offline {
  background: #3b1616;
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffe1e1;
}

.status.offline .dot {
  background: #e07a5f;
  box-shadow: 0 0 0 5px rgba(224, 122, 95, 0.25);
}

.panel {
  background: transparent;
  border-radius: 0;
  border: 0;
  box-shadow: none;
}

.panel-body {
  padding: 0;
}

.panel-footer {
  padding: 0 24px 20px;
  display: flex;
  justify-content: flex-end;
}

.card {
  background: #fffdf9;
  border-radius: 18px;
  border: 1px solid transparent;
  box-shadow: 0 12px 24px rgba(31, 27, 22, 0.08);
}

.notice {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: #fff3e5;
  border: 1px dashed rgba(31, 27, 22, 0.2);
}

.notice h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.notice p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.notification.attention,
.notification.urgent {
  border-color: rgba(224, 122, 95, 0.6);
  background: #ffe8e2;
}

.notification.urgent {
  background: #ffd4c7;
}

.notification.shake {
  animation: shake 0.5s ease-in-out infinite;
}

.card-link {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 18px;
}

.notification > *:not(.card-link) {
  position: relative;
  z-index: 1;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-3px);
  }
  75% {
    transform: translateX(3px);
  }
}

.notification-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.notification-list .generated-at {
  display: none;
}

.notification {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 18px;
  padding: 14px 16px;
  position: relative;
}

.notification-time {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 16px;
  color: var(--accent-2);
  font-weight: 500;
}

.notification-body h2 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
}

.location {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.notification-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.pill {
  padding: 6px 12px;
  background: rgba(224, 122, 95, 0.15);
  border-radius: 999px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 16px;
}

.foot {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin-top: auto;
  padding: 8px 44px;
  margin-left: -44px;
  margin-right: -44px;
  width: calc(100% + 88px);
  background: var(--bg);
  box-shadow: 0 -6px 16px rgba(31, 27, 22, 0.08);
}

.btn-footer {
  flex-shrink: 0;
}

@media (max-width: 820px) and (max-height: 520px) {
  .shell {
    padding: 20px 24px 0;
    gap: 10px;
  }

  .hero-strip {
    padding: 6px 24px;
    height: 64px;
    margin: -20px -24px 2px;
    width: calc(100% + 48px);
  }

  .hero-mark {
    height: 90px;
    margin-top: 8px;
  }

  .mast {
    gap: 10px;
  }

  h1 {
    font-size: 24px;
  }

  .panel-body {
    padding: 16px;
  }

  .panel-footer {
    padding: 0 16px 12px;
  }

  .notification-list {
    gap: 8px;
  }

  .notification {
    grid-template-columns: 90px 1fr auto;
    gap: 12px;
    padding: 10px 12px;
  }

  .notification-time {
    font-size: 13px;
  }

  .notification-body h2 {
    font-size: 16px;
  }

  .location {
    font-size: 12px;
  }

  .pill {
    padding: 3px 8px;
    font-size: 10px;
  }

  .btn {
    padding: 5px 10px;
    font-size: 11px;
  }

  .status {
    padding: 4px 8px;
    font-size: 11px;
  }

  .foot {
    font-size: 10px;
    letter-spacing: 0.1em;
    padding: 8px 24px;
    margin-left: -24px;
    margin-right: -24px;
    width: calc(100% + 48px);
  }
}

.sep {
  opacity: 0.4;
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(31, 27, 22, 0.15);
}

.btn-primary {
  background: var(--accent);
  color: #fffaf3;
}

.btn-ghost {
  background: transparent;
  color: var(--accent-2);
  border-color: var(--border);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.subtle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.user-pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(61, 64, 91, 0.12);
  color: var(--accent-2);
  border: 1px solid rgba(61, 64, 91, 0.2);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-strip .user-pill {
  background: rgba(255, 248, 241, 0.12);
  color: #fff8f1;
  border-color: rgba(255, 248, 241, 0.25);
}

.hero-strip .btn-ghost {
  color: #fff8f1;
  border-color: rgba(255, 248, 241, 0.35);
}

.input {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 14px;
  background: #fffdf9;
  color: var(--ink);
  width: 100%;
}

.label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 6px;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.display-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.display-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.display-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.calendar-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink);
}

.pair-card {
  padding: 18px;
  gap: 16px;
  max-width: 420px;
}

.auth-card {
  padding: 18px;
  gap: 16px;
}

.login-shell {
  justify-content: center;
}

.login-card {
  max-width: 480px;
  margin: 0 auto;
  align-items: center;
  text-align: center;
  flex-direction: column;
  background: #111;
  color: #fff8f1;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 40px rgba(17, 17, 17, 0.35);
  padding: 12px 16px 16px;
}

.login-logo {
  width: 400px;
  height: auto;
}

.login-copy p {
  margin: 0;
  color: rgba(255, 248, 241, 0.75);
}

.login-btn {
  margin-top: 4px;
}

.login-card .btn-primary {
  background: #f6f2ec;
  color: #1f1b16;
  border-color: rgba(255, 255, 255, 0.6);
}

.pair-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.pair-qr {
  padding: 18px;
  display: flex;
  gap: 24px;
  align-items: center;
}

.qr {
  width: 180px;
  height: 180px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 8px;
}

.pair-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pair-code {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.pair-link {
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 40;
}

.modal:target {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 27, 22, 0.45);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(520px, 92vw);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - 48px);
  overflow: hidden;
}

.card-header,
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.modal-time {
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--accent-2);
}

.modal-block {
  margin-bottom: 16px;
}

.modal-block h3 {
  margin: 0 0 6px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.chip-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(61, 64, 91, 0.12);
  color: var(--accent-2);
  font-size: 12px;
}

.card-body p {
  margin: 0 0 12px;
  color: var(--muted);
}

.modal .card-body {
  overflow-y: auto;
  padding-right: 6px;
}

.card-body p:last-child {
  margin-bottom: 0;
}

@media (max-width: 700px) {
  .shell {
    padding: 32px 24px;
    gap: 16px;
  }

  .hero-strip {
    padding: 12px 24px;
    height: 80px;
    margin: -32px -24px 4px;
    width: calc(100% + 48px);
    flex-direction: column;
    align-items: flex-start;
  }

  .mast {
    flex-direction: column;
    align-items: flex-start;
  }

  .mast-row {
    flex-direction: column;
    align-items: stretch;
  }

  .notification {
    grid-template-columns: 1fr;
  }

  .notification-meta {
    flex-direction: row;
    justify-content: flex-start;
  }

  .panel-footer {
    justify-content: flex-start;
  }

  .display-grid {
    grid-template-columns: 1fr;
  }

  .pair-form {
    flex-direction: column;
    align-items: stretch;
  }

  .pair-qr {
    flex-direction: column;
    align-items: flex-start;
  }
}
