/* Shared iPhone + PC shell for every VPS Notify surface. */
:root {
  color-scheme: dark;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --tap: 32px;
  --notify-bg: #0b1020;
  --notify-ink: #e8eef8;
  --notify-muted: #93a4bf;
  --notify-line: rgba(148, 163, 184, 0.28);
  --notify-panel: rgba(15, 23, 42, 0.92);
  --notify-accent: #14b8a6;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }

.notify-home,
.notify-page {
  min-height: 100dvh;
  min-height: 100svh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--notify-ink);
  background:
    radial-gradient(ellipse at 12% -8%, rgba(20, 184, 166, 0.22), transparent 42%),
    radial-gradient(ellipse at 100% 0%, rgba(245, 158, 11, 0.14), transparent 36%),
    var(--notify-bg);
}

.notify-page {
  padding: max(8px, var(--safe-top)) max(10px, var(--safe-right)) max(12px, var(--safe-bottom)) max(10px, var(--safe-left));
}

.notify-page main {
  width: min(100%, 1080px);
  margin: 0 auto;
}

.notify-page.notify-page-light {
  color-scheme: light;
  --notify-bg: #f3f5f8;
  --notify-ink: #16202a;
  --notify-muted: #5d6b78;
  --notify-line: #d5dde6;
  --notify-panel: #fff;
  --notify-accent: #0b63ce;
  background: var(--notify-bg);
  color: var(--notify-ink);
}

.notify-page header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.notify-page h1 { margin: 0; font-size: clamp(1.05rem, 3.2vw, 1.35rem); letter-spacing: -0.03em; }
.notify-page h2 { margin: 0 0 8px; font-size: 0.85rem; }
.notify-page .muted { color: var(--notify-muted); }
.notify-page section,
.notify-page .panel-card {
  background: var(--notify-panel);
  border: 1px solid var(--notify-line);
  border-radius: 10px;
  padding: 10px;
  margin: 8px 0;
}

.notify-page button,
.notify-page .button,
.notify-home button {
  min-height: var(--tap);
  min-width: 0;
  padding: 6px 10px;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.notify-page input,
.notify-page textarea,
.notify-home input {
  width: 100%;
  min-height: var(--tap);
  font-size: 16px; /* iOS does not zoom this size */
  border-radius: 8px;
  padding: 7px 10px;
}

.notify-page table { width: 100%; border-collapse: collapse; }
.notify-page th, .notify-page td { text-align: left; padding: 10px 8px; vertical-align: top; }
.notify-page pre, .notify-page code { overflow-wrap: anywhere; }

@media (max-width: 720px) {
  .notify-page header,
  .notify-page .actions,
  .notify-page .grid,
  .notify-page .stats,
  .notify-page .two-col,
  .notify-page .packet-grid,
  .notify-page .ban-form {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }
  .notify-page table, .notify-page thead, .notify-page tbody, .notify-page tr, .notify-page th, .notify-page td {
    display: block;
    width: 100%;
  }
  .notify-page thead { display: none; }
  .notify-page tr {
    border: 1px solid var(--notify-line);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: color-mix(in srgb, var(--notify-panel) 88%, transparent);
  }
  .notify-page td { padding: 4px 0; border: 0; }
}

@media (min-width: 900px) {
  .notify-page .stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .notify-page .two-col,
  .notify-page .packet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .notify-page .grid { display: grid; grid-template-columns: minmax(0, 1fr) 140px auto; gap: 10px; align-items: end; }
}

/* Home observatory */
.notify-home .shell {
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: max(10px, var(--safe-top)) max(12px, var(--safe-right)) max(16px, var(--safe-bottom)) max(12px, var(--safe-left));
  display: grid;
  gap: 12px;
}

.notify-home .panel {
  border: 1px solid var(--notify-line);
  border-radius: 18px;
  padding: 16px;
  background: var(--notify-panel);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.notify-home .setup-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
}

.notify-home .metrics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 520px) {
  .notify-home .setup-actions { grid-template-columns: 1fr 1fr; }
  .notify-home .metrics-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 900px) {
  .notify-home .setup-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .notify-home .metrics-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1100px) {
  .notify-home .shell {
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    align-items: start;
  }
  .notify-home .metrics-panel { grid-column: 2; grid-row: 1 / span 2; }
  .notify-home .terminal-panel { grid-column: 1 / -1; }
  .notify-home .setup-actions { grid-template-columns: 1fr; }
  .notify-home .metrics-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (min-width: 1400px) {
  .notify-home .shell { width: min(100%, 1680px); }
}

/* iPhone: slightly smaller scale so panels are not oversized. */
@media (max-width: 480px) {
  :root { --tap: 30px; }
  html { font-size: 14px; }
  .notify-page,
  .notify-home { font-size: 13px; }
  .notify-page h1 { font-size: 1.05rem; }
  .notify-home h1 { font-size: 1.05rem; }
  .notify-page button,
  .notify-page .button,
  .notify-home button {
    min-height: var(--tap);
    min-width: 0;
    font-size: 12px;
    padding: 5px 9px;
  }
  .notify-page input,
  .notify-page textarea,
  .notify-home input {
    min-height: 34px;
    font-size: 16px;
    padding: 6px 9px;
  }
  .notify-page th, .notify-page td { padding: 6px 4px; }
  .notify-home .panel { padding: 10px; border-radius: 12px; }
  .notify-home .shell { padding: max(6px, var(--safe-top)) max(8px, var(--safe-right)) max(10px, var(--safe-bottom)) max(8px, var(--safe-left)); gap: 8px; }
}
