@font-face {
  font-family: 'Pacifico';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/pacifico-latin-v23.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #0b1d2a;
  --panel: #102a3c;
  --panel-border: #1e3e55;
  --text: #e8f1f8;
  --muted: #8fb0c6;
  --accent: #4fc3f7;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.4;
}

header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--panel-border);
}

.logo {
  width: 26px;
  height: 26px;
  color: #fff;
  flex: 0 0 auto;
}

header h1 {
  margin: 0;
  font-family: "Pacifico", cursive;
  font-weight: 400;
  font-size: 1.45rem;
  letter-spacing: 0.3px;
  color: #fff;
  line-height: 1;
}

.subtitle {
  margin-left: 0.3rem;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  padding: 0.6rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 0.6rem 0.7rem 0.7rem;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 450px;
}

.panel h2 {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
}

.frame {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: 4px;
  overflow: hidden;
}

.frame--16x9    { aspect-ratio: 16 / 9; }
.frame--tall    { aspect-ratio: 3 / 4; }

.frame__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.panel__footer {
  margin: 0.45rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.panel__footer a {
  color: var(--accent);
  text-decoration: none;
}

.panel__footer a:hover { text-decoration: underline; }

.consent {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem;
  text-align: center;
  background: #0a1620;
}

.consent__body {
  max-width: 320px;
}

.consent__text {
  margin: 0 0 0.7rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.consent__text strong {
  color: var(--text);
  font-weight: 600;
}

.consent__btn {
  background: var(--accent);
  color: #06141f;
  border: 0;
  padding: 0.45rem 0.85rem;
  border-radius: 4px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.consent__btn:hover { filter: brightness(1.1); }

.consent__hint {
  margin: 0.55rem 0 0;
  font-size: 0.7rem;
  color: var(--muted);
  opacity: 0.7;
}

.site-footer {
  padding: 0.3rem 0.85rem 0.7rem;
  text-align: right;
}

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 0.72rem;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(143, 176, 198, 0.4);
}

.link-btn:hover { color: var(--text); }

.dashboard__col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
}

.linkout {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.85rem;
  background: #0a1620;
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}

.linkout:hover {
  background: #0d1d2c;
  border-color: var(--accent);
}

.linkout__icon {
  width: 26px;
  height: 26px;
  color: var(--accent);
  flex: 0 0 auto;
}

.linkout__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

.linkout__title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
}

.linkout__sub {
  font-size: 0.75rem;
  color: var(--muted);
}

.linkout__arrow {
  color: var(--accent);
  font-size: 1.1rem;
  flex: 0 0 auto;
}

.linkout--sm {
  padding: 0.5rem 0.65rem;
  margin-top: 0.4rem;
}

.linkout--sm .linkout__title { font-size: 0.85rem; }
.linkout--sm .linkout__sub   { font-size: 0.7rem; }

@media (min-width: 901px) {
  .panel--sessions { grid-column: 1 / -1; }
  .panel--wind .frame--tall {
    aspect-ratio: unset;
    flex: 1;
    min-height: 0;
  }
}

@media (max-width: 900px) {
  .dashboard {
    grid-template-columns: 1fr;
    gap: 0.45rem;
    padding: 0.45rem;
  }
  .dashboard__col {
    gap: 0.45rem;
  }
  header {
    padding: 0.45rem 0.6rem;
  }
  header h1 {
    font-size: 1.3rem;
  }
  .logo {
    width: 22px;
    height: 22px;
  }
  .panel {
    padding: 0.5rem 0.6rem 0.6rem;
    min-height: 300px;
  }
  .expand-btn--wide,
  .expand-btn--tall { display: none; }
  .panel--wide { grid-column: unset; }
  .panel--tall { grid-row: unset; }
  .site-footer {
    padding: 0.25rem 0.6rem 0.55rem;
  }
}

/* ── Kite log panel ──────────────────────────────────── */
.session-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
}

.session-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  align-items: center;
}

.session-input {
  background: var(--bg);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  padding: 0.35rem 0.5rem;
  min-width: 0;
}

.session-input:focus {
  outline: none;
  border-color: var(--accent);
}

.session-input--date { width: 130px; }
.session-input--time { width: 82px; }
.session-input--gear { flex: 1 1 90px; }
.session-input--comment { flex: 2 1 160px; resize: none; line-height: 1.4; }

.session-sep {
  color: var(--muted);
  font-size: 0.9rem;
}

.session-add-btn {
  background: var(--accent);
  color: #06141f;
  border: 0;
  padding: 0.38rem 0.85rem;
  border-radius: 4px;
  font-size: 0.84rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.session-add-btn:hover { filter: brightness(1.1); }

.kite-rating {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.kite-btn {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  line-height: 0;
  color: #fff;
  opacity: 0.22;
  transition: opacity 0.1s, transform 0.1s;
}

.kite-btn.kite-hover,
.kite-btn.kite-selected { opacity: 1; }

.kite-btn:hover { transform: scale(1.15); }

.kite-label {
  margin-left: 0.3rem;
  font-size: 0.75rem;
  color: var(--muted);
  min-width: 56px;
}

.session-status {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.session-status.is-error { color: #ef5350; }

.log-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.session-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.session-empty {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.3rem 0;
}

.session-item {
  background: var(--bg);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  padding: 0.45rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.session-item__main {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.session-item__time {
  font-size: 0.82rem;
  font-weight: 600;
}

.session-item__wind {
  font-size: 0.8rem;
  color: var(--accent);
  white-space: nowrap;
}

.session-item__gear {
  font-size: 0.76rem;
  color: var(--muted);
}

.session-item__footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.1rem;
}

.session-item__rating { display: flex; gap: 0.15rem; }

.kite-icon { color: #fff; opacity: 0.2; line-height: 0; display: inline-block; }
.kite-icon--on { opacity: 1; }

.session-item__comment {
  font-size: 0.75rem;
  color: var(--muted);
  flex: 1;
}

.session-item__edit {
  margin-left: auto;
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.1rem;
  opacity: 0.45;
  transition: opacity 0.15s, color 0.15s;
}

.session-item__edit:hover { color: var(--accent); opacity: 1; }

.session-item__delete {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0.1rem;
  opacity: 0.55;
}

.session-item__delete:hover { color: #ef5350; opacity: 1; }

.session-cancel-btn {
  background: none;
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  padding: 0.35rem 0.7rem;
  white-space: nowrap;
}

.session-cancel-btn:hover { border-color: var(--accent); color: var(--text); }

/* ── Windfinder wrap ─────────────────────────────────── */
.wf-wrap {
  min-height: 160px;
}

.consent--inline {
  position: static;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem 0.9rem;
  text-align: center;
  background: #0a1620;
  border-radius: 4px;
}

/* ── Drag & drop ─────────────────────────────────────── */
.drag-handle {
  display: inline-block;
  cursor: grab;
  color: var(--muted);
  opacity: 0.45;
  font-size: 1rem;
  line-height: 1;
  vertical-align: middle;
  user-select: none;
  margin-right: 0.15rem;
}

.drag-handle:active { cursor: grabbing; }

.panel--ghost {
  opacity: 0.35;
  background: var(--panel-border) !important;
}

.panel--chosen {
  box-shadow: 0 0 0 2px var(--accent);
}

/* ── Tile expand / collapse ──────────────────────────── */
.panel--wide { grid-column: span 2; }
.panel--tall { grid-row: span 2; }
.panel--tall .frame { flex: 1; min-height: 0; aspect-ratio: unset; }

.expand-btns {
  margin-left: auto;
  display: flex;
  gap: 0.05rem;
}

.expand-btn {
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.35;
  font-size: 0.95rem;
  padding: 0 0.15rem;
  line-height: 1;
  color: var(--muted);
  font-family: inherit;
  transition: opacity 0.15s, color 0.15s;
}

.expand-btn:hover { opacity: 1; color: var(--text); }
.expand-btn.active { opacity: 1; color: var(--accent); }

.minimize-btn {
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.35;
  font-size: 0.95rem;
  padding: 0 0.15rem;
  line-height: 1;
  color: var(--muted);
  font-family: inherit;
  transition: opacity 0.15s, color 0.15s;
}

.minimize-btn:hover { opacity: 1; color: var(--text); }
.minimize-btn.active { opacity: 1; color: var(--accent); }

/* ── Minimised panel ─────────────────────────────────── */
.panel--minimized {
  min-height: 0 !important;
  align-self: start;       /* don't stretch to match row-mates */
  padding-bottom: 0.6rem; /* match top padding */
}

.panel--minimized h2 {
  margin-bottom: 0;
}

.panel--minimized > *:not(h2) {
  display: none;
}

.panel--minimized .expand-btn--wide,
.panel--minimized .expand-btn--tall {
  display: none;
}

/* ── Header logo link (dashboard) ────────────────────── */
.logo-link {
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
  border-radius: 4px;
}
.logo-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Landing page (home) ─────────────────────────────── */
body.home {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.home-header {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--panel-border);
}

.home-mark {
  font-family: "Pacifico", cursive;
  font-size: 1.15rem;
  color: #fff;
  letter-spacing: 0.3px;
}

.home-main {
  flex: 1;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 2.4rem 1.2rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 2.4rem;
}

.home-hero {
  text-align: left;
}

.home-title {
  font-family: "Pacifico", cursive;
  font-weight: 400;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  margin: 0 0 0.6rem;
  color: #fff;
  letter-spacing: 0.4px;
  line-height: 1.05;
}

.home-lede {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
  max-width: 56ch;
}

.home-tiles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 720px) {
  .home-tiles {
    grid-template-columns: 2fr 1fr;
  }
}

.tile {
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
  padding: 1.4rem 1.4rem 1.5rem;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

a.tile:hover,
a.tile:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: #143349;
  outline: none;
}

a.tile:focus-visible {
  box-shadow: 0 0 0 2px var(--accent);
}

.tile__icon {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  color: var(--accent);
  background: rgba(79, 195, 247, 0.08);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile__icon svg {
  width: 42px;
  height: 42px;
}

.tile__body {
  flex: 1;
  min-width: 0;
}

.tile__title {
  margin: 0 0 0.25rem;
  font-family: "Pacifico", cursive;
  font-weight: 400;
  font-size: 1.45rem;
  color: #fff;
  line-height: 1.1;
}

.tile__sub {
  margin: 0 0 0.7rem;
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.tile__desc {
  margin: 0 0 0.9rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text);
}

.tile__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
}

.tile--placeholder {
  border-style: dashed;
  background: transparent;
  color: var(--muted);
  cursor: default;
}

.tile--placeholder .tile__title {
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.footer-credit {
  color: var(--muted);
  font-size: 0.78rem;
  margin-left: auto;
}

@media (max-width: 600px) {
  .footer-credit { margin-left: 0; }
}
