:root {
  --navy: #0e2748;
  --blue: #1769c2;
  --paper: #f7f9fc;
  --ink: #182333;
  --muted: #5c6b7d;
  --line: #c9d3df;
  --danger: #aa3d3d;
  --focus: #e18c20;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
}
button,
input,
select {
  font: inherit;
}
button {
  min-height: 44px;
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.shell {
  max-width: 860px;
  margin: clamp(18px, 5vw, 72px) auto;
  background: #fff;
  box-shadow: 0 16px 44px #10203919;
  border: 1px solid #e1e7ee;
}
.masthead {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(20px, 4vw, 36px);
  background: var(--navy);
  color: #fff;
}
.wordmark {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.header-actions {
  display: flex;
  gap: 6px;
}
.text-button {
  color: inherit;
  background: transparent;
  border: 0;
  text-decoration: underline;
  min-height: auto;
  padding: 8px;
}
#timer-view {
  padding: clamp(25px, 5vw, 54px);
}
.timer-block {
  text-align: center;
  padding: 8px 0 26px;
}
.eyebrow {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 0.72rem;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.13em;
  font-weight: bold;
}
#clock {
  display: block;
  font-family: 'Courier New', monospace;
  font-size: clamp(3.2rem, 12vw, 6.5rem);
  line-height: 1;
  font-weight: bold;
  color: var(--navy);
  letter-spacing: -0.08em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rule {
  height: 1px;
  background: var(--line);
  margin-bottom: 28px;
}
.form-grid {
  display: grid;
  gap: 26px;
}
label,
legend {
  display: block;
  font-weight: bold;
  margin-bottom: 9px;
}
select,
input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #99a9ba;
  border-radius: 4px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}
.network-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.network-options label {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 8px;
  border: 1px solid #9baaba;
  border-radius: 4px;
  color: var(--navy);
  text-align: center;
  cursor: pointer;
}
.network-options input {
  width: 18px;
  min-height: 18px;
  margin: 0 8px 0 0;
  accent-color: var(--blue);
}
.controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 32px;
}
button {
  border-radius: 4px;
  font-weight: bold;
  padding: 9px 16px;
}
.primary {
  border: 1px solid var(--blue);
  color: #fff;
  background: var(--blue);
}
.outline {
  color: var(--navy);
  border: 1px solid #6f849b;
  background: #fff;
}
.danger {
  color: var(--danger);
  border: 1px solid #c99898;
  background: #fff;
}
.full {
  width: 100%;
  margin-top: 16px;
}
.status {
  min-height: 1.5em;
  margin: 19px 0 0;
  color: var(--muted);
}
.status.error {
  color: #9e2222;
  font-weight: bold;
}
.status.success {
  color: #176a42;
  font-weight: bold;
}
.login-panel {
  max-width: 430px;
  margin: clamp(32px, 9vw, 92px) auto;
  padding: 0 28px 48px;
}
.login-panel h1,
dialog h2 {
  margin: 0;
  color: var(--navy);
}
.login-panel > p:not(.eyebrow):not(.status) {
  color: var(--muted);
  margin: 8px 0 26px;
}
.login-panel form {
  display: grid;
  gap: 4px;
}
dialog {
  width: min(680px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  border: 0;
  padding: 26px;
  color: var(--ink);
  box-shadow: 0 24px 80px #0c1d32a8;
}
dialog::backdrop {
  background: #07182cb8;
}
dialog header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 17px;
}
dialog > p {
  color: var(--muted);
}
.icon-button {
  border: 0;
  background: #eef2f6;
  color: var(--navy);
  font-size: 1.7rem;
  min-height: 40px;
  width: 40px;
  padding: 0;
}
.add-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}
.moment-list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
  display: grid;
  gap: 8px;
}
.moment-list li {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 7px;
  align-items: center;
  border: 1px solid var(--line);
  padding: 8px;
}
.moment-list button {
  min-height: 36px;
  padding: 5px 10px;
}
.moment-list .remove {
  color: var(--danger);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.login-panel[hidden],
#timer-view[hidden],
[hidden] {
  display: none !important;
}
@media (max-width: 560px) {
  .shell {
    margin: 0;
    min-height: 100dvh;
    border: 0;
  }
  .masthead {
    min-height: 64px;
    align-items: flex-start;
    padding: 12px 18px;
  }
  .header-actions {
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
  }
  .text-button {
    padding: 2px 0;
  }
  .network-options {
    grid-template-columns: 1fr;
  }
  .network-options label {
    justify-content: start;
    padding-left: 16px;
  }
  .controls {
    grid-template-columns: 1fr 1fr;
  }
  .add-row {
    grid-template-columns: 1fr;
  }
  .moment-list li {
    grid-template-columns: 1fr auto auto;
  }
  .moment-list input {
    grid-column: 1/-1;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
