@font-face {
  font-family: 'Playfair Display';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('fonts/PlayfairDisplay-Regular.ttf') format('truetype');
}
@font-face {
  font-family: 'Playfair Display';
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url('fonts/PlayfairDisplay-SemiBold.ttf') format('truetype');
}
@font-face {
  font-family: 'Playfair Display';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('fonts/PlayfairDisplay-Bold.ttf') format('truetype');
}
@font-face {
  font-family: 'Figtree';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('fonts/Figtree-Regular.ttf') format('truetype');
}
@font-face {
  font-family: 'Figtree';
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url('fonts/Figtree-SemiBold.ttf') format('truetype');
}
@font-face {
  font-family: 'Figtree';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('fonts/Figtree-Bold.ttf') format('truetype');
}

:root {
  --color-bg: #f6f8f9;
  --color-surface: #ffffff;
  --color-ink: #544B46;
  --color-muted: #7a6f66;
  --color-accent: #B69A62;
  --color-accent-dark: #544B46;
  --color-tertiary-accent: #163A59;
  --color-danger: #a43131;
  --color-danger-bg: #fdecec;
  --color-success: #1f6a3c;
  --color-border: #e0d8ce;
  --font-heading: Playfair Display, Georgia, 'Times New Roman', serif;
  --font-body: Figtree, -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --radius: 10px;
  --touch: 48px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--color-accent);
  color: white;
  padding: 10px 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-logo {
  height: 36px;
  width: auto;
  flex-shrink: 0;
  background: white;
  border-radius: 6px;
  padding: 4px 6px;
}

.topbar-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.topbar-line-primary {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.topbar-line-secondary {
  font-size: 11px;
  font-weight: 400;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

main#app {
  flex: 1;
  padding: 20px 18px 32px;
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
}

.screen h1 {
  margin: 4px 0 10px;
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-accent-dark);
}

.screen h2 {
  margin: 24px 0 10px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.endpoint-meta {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 18px;
}

.endpoint-meta .line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
}

.endpoint-meta .label {
  color: var(--color-muted);
  font-size: 14px;
}

.endpoint-meta .value {
  font-weight: 600;
  text-align: right;
}

.timer-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 22px 16px;
  text-align: center;
  margin-bottom: 18px;
}

.timer-card-compact {
  padding: 14px 16px;
}

.timer-clock {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 4px 0 2px;
  font-variant-numeric: tabular-nums;
}

.timer-card-compact .timer-clock {
  font-size: 28px;
}

.timer-since {
  color: var(--color-muted);
  font-size: 14px;
}

.btn {
  display: block;
  width: 100%;
  min-height: var(--touch);
  padding: 14px 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  margin-bottom: 12px;
  -webkit-tap-highlight-color: transparent;
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.btn-primary {
  background: var(--color-accent);
  color: white;
}

.btn-primary:active {
  background: var(--color-accent-dark);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-ink);
  border: 1px solid var(--color-border);
}

.btn-danger {
  background: var(--color-surface);
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
}

.btn-danger:active {
  background: var(--color-danger-bg);
}

.checklist {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 6px 14px;
  margin-bottom: 18px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
  min-height: var(--touch);
  cursor: pointer;
}

.checklist-item:last-child {
  border-bottom: none;
}

.checklist-item input[type="checkbox"] {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  accent-color: var(--color-accent);
}

.checklist-item span {
  flex: 1;
  font-size: 16px;
}

textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font: inherit;
  font-size: 16px;
  background: var(--color-surface);
  resize: vertical;
  margin-bottom: 18px;
}

textarea:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: -1px;
}

.banner {
  padding: 12px 14px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 15px;
}

.banner-error {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
}

.banner-success {
  background: #e8f5ee;
  color: var(--color-success);
  border: 1px solid var(--color-success);
}

.banner-info {
  background: #e8eff4;
  color: var(--color-accent-dark);
  border: 1px solid var(--color-accent);
}

.screen-blocked {
  padding: 28px 4px;
  text-align: center;
}

.screen-blocked h1 {
  font-size: 20px;
}

.screen-blocked p {
  color: var(--color-muted);
  font-size: 15px;
}

code {
  background: var(--color-border);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 13px;
}

.muted {
  color: var(--color-muted);
  font-size: 14px;
}

.abort-row {
  text-align: center;
  margin-top: 4px;
  margin-bottom: 8px;
}

.abort-link {
  color: var(--color-muted);
  text-decoration: underline;
  font-size: 14px;
  padding: 12px 16px;
  display: inline-block;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.08);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 100;
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 20px 18px 14px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.modal h2 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  color: var(--color-accent-dark);
  margin: 0 0 10px;
  text-transform: none;
  letter-spacing: 0;
}

.modal p {
  font-size: 15px;
  color: var(--color-ink);
  margin: 0 0 18px;
}

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.modal-buttons .btn {
  margin-bottom: 10px;
}

.modal-buttons .btn:last-child {
  margin-bottom: 0;
}
