:root {
  --bg: 255 255 255;           /* white base */
  --tint: 255 255 255 / .65;   /* translucent */
  --ink: 20 24 28;             /* text color */
  --ink-weak: 80 90 100;
  --accent: 50 120 255;        /* slightly lighter blue for better readability */
  --ring: 50 120 255 / .25;
  --surface: 246,247,249;      /* light grey used across the app */
  --surface-dim: 240,242,245;  /* slightly darker variant */
  --header-pad-y: 20px;        /* increase for a taller bar */
  --logo-h: 36px;              /* increase logo size to match new height */

  /* Typography system */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;

  /* Type scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;

  /* Line heights */
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

[hidden] {
  display: none !important;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: rgb(var(--ink));
  background: rgb(var(--surface));
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: var(--leading-tight);
  color: rgb(var(--ink));
  margin: 0;
  letter-spacing: -0.025em;
}

h1 {
  font-size: var(--text-5xl);
  font-weight: 700;
  letter-spacing: -0.04em;
}

h2 {
  font-size: var(--text-3xl);
  font-weight: 600;
}

h3 {
  font-size: var(--text-2xl);
}

h4 {
  font-size: var(--text-xl);
}

/* Links */
a {
  color: rgb(var(--accent));
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: rgb(30 90 220);
}

/* Code */
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: rgb(var(--accent) / 0.08);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  color: rgb(var(--accent));
}

/* Strong */
strong {
  font-weight: 600;
  color: rgb(var(--ink));
}

/* Lists */
ul, ol {
  padding-left: 1.5em;
  line-height: var(--leading-relaxed);
}

li {
  margin-bottom: 0.5em;
  color: rgb(var(--ink-weak));
}

/* Responsive adjustments */
@media (max-width: 768px) {
  :root {
    --text-5xl: 2.25rem;
    --text-3xl: 1.5rem;
  }
}

/* Idle session warning modal (CSP-safe: external stylesheet, no inline styles) */
body.harbour-idle-warning-open {
  overflow: hidden;
}

.harbour-idle-warning {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgb(7 17 34 / 0.42);
  backdrop-filter: blur(3px);
}

.harbour-idle-warning[hidden] {
  display: none !important;
}

.harbour-idle-warning__panel {
  width: min(96vw, 540px);
  border-radius: 12px;
  border: 1px solid rgb(11 25 60 / 0.14);
  background: linear-gradient(180deg, #f7faff 0%, #eff4fb 100%);
  box-shadow:
    0 18px 40px rgb(8 18 39 / 0.28),
    inset 0 1px 0 rgb(255 255 255 / 0.7);
  padding: 1rem 1.05rem 0.9rem;
  color: #091b42;
}

.harbour-idle-warning__title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.harbour-idle-warning__copy {
  margin: 0.34rem 0 0.16rem;
  font-size: 0.86rem;
  color: #31466a;
}

.harbour-idle-warning__clock-wrap {
  margin: 0.75rem auto 0.62rem;
  display: grid;
  place-items: center;
}

.harbour-idle-warning__clock {
  position: relative;
  width: 164px;
  height: 164px;
  display: grid;
  place-items: center;
}

.harbour-idle-warning__clock svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}

.harbour-idle-warning__ring-track {
  fill: none;
  stroke: rgb(18 82 217 / 0.15);
  stroke-width: 8;
}

.harbour-idle-warning__ring-progress {
  fill: none;
  stroke: url(#harbour-idle-warning-ring-gradient);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.16s linear;
}

.harbour-idle-warning__seconds {
  line-height: 1;
  text-align: center;
}

.harbour-idle-warning__seconds strong {
  display: block;
  font-size: 2.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #0d63f3;
}

.harbour-idle-warning__seconds span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: #5f7090;
  font-weight: 600;
}

.harbour-idle-warning__actions {
  margin-top: 0.6rem;
  padding-top: 0.48rem;
  border-top: 1px solid rgb(11 25 60 / 0.09);
  display: flex;
  gap: 0.95rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.harbour-idle-warning__btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: #1d2d5a;
  text-decoration: none;
  text-underline-offset: 3px;
  cursor: pointer;
  transition:
    color 0.2s ease,
    text-decoration-color 0.2s ease;
}

.harbour-idle-warning__btn:hover {
  color: #3278ff;
  text-decoration: underline;
}

.harbour-idle-warning__btn:focus-visible {
  outline: 2px solid rgb(50 120 255 / 0.45);
  outline-offset: 2px;
  border-radius: 3px;
}

.harbour-idle-warning__btn--ghost {
  color: #3b4e70;
}

.harbour-idle-warning__btn--primary {
  color: #13284d;
  font-weight: 700;
}

@media (max-width: 520px) {
  .harbour-idle-warning {
    padding: 0.85rem;
  }

  .harbour-idle-warning__panel {
    width: min(100vw, 440px);
    padding: 0.9rem 0.88rem 0.86rem;
  }

  .harbour-idle-warning__actions {
    justify-content: flex-end;
    gap: 0.8rem;
  }
}
