@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,300..700;1,6..72,300..700&family=Inter:wght@400;500;600&display=swap');

/* ============================================================
   Luz & Kiko — design tokens
   Editorial e minimalista: fundo branco, tinta quase preta,
   linhas finas, muito espaço. Amarelo (Luz) e azul (Kiko)
   aparecem só onde contam.
   ============================================================ */
:root {
  color-scheme: light;

  --bg:      #FFFFFF;
  --bg-2:    #F6F6F3;
  --surface: #FFFFFF;

  --ink:   #131417;
  --ink-2: #5B5E66;
  --ink-3: #9A9DA4;
  --line:  #E8E8E4;
  --line-2:#D5D5D0;

  --yellow:      #F4C43D;
  --yellow-soft: #FFF3C7;
  --yellow-ink:  #8A6906;

  --blue:       #3563D9;
  --blue-soft:  #E6EDFB;
  --blue-ink:   #2B4FB0;
  --blue-light: #8FB0F0;

  --lilac:      #C4B3F2;
  --lilac-soft: #F1ECFC;
  --lilac-ink:  #6A52C9;

  --green:      #9DD4A8;
  --green-soft: #E6F5E9;
  --green-ink:  #2E7D46;

  --pink:       #F3B7C8;
  --pink-soft:  #FCEBF0;
  --pink-ink:   #B3446A;

  --danger:      #C6403A;
  --danger-soft: #FBE9E7;

  /* Globo: mar, países por marcar, e a linha entre eles */
  --globe-sea:   #F3F4F6;
  --globe-land:  #DCDFE4;
  --globe-line:  #FFFFFF;
  --globe-hover: rgba(19, 20, 23, .10);

  --shadow-sm: 0 1px 2px rgba(19,20,23,.06);
  --shadow-md: 0 4px 16px rgba(19,20,23,.08), 0 1px 3px rgba(19,20,23,.06);
  --shadow-lg: 0 24px 60px rgba(19,20,23,.18);

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-full: 999px;

  --sans:  'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Newsreader', ui-serif, Georgia, 'Times New Roman', serif;

  --nav-h: 60px;
  --maxw: 1080px;
  --readw: 700px;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg:      #0F1013;
  --bg-2:    #17181C;
  --surface: #141518;

  --ink:   #ECECEA;
  --ink-2: #A5A7AE;
  --ink-3: #6F7278;
  --line:  #24262B;
  --line-2:#34363C;

  --yellow:      #E8C048;
  --yellow-soft: #2A2410;
  --yellow-ink:  #F0CF6A;

  --blue:       #6B93EE;
  --blue-soft:  #172238;
  --blue-ink:   #9DB9F5;
  --blue-light: #4A6CC4;

  --lilac:      #9B88E0;
  --lilac-soft: #241F3A;
  --lilac-ink:  #BFB0F2;

  --green:      #7FC08C;
  --green-soft: #1B2E20;
  --green-ink:  #9BDCA8;

  --pink:       #E08FA8;
  --pink-soft:  #3A2029;
  --pink-ink:   #F0A9BF;

  --danger:      #E4746C;
  --danger-soft: #3A1E1C;

  --globe-sea:   #121317;
  --globe-land:  #2B2E34;
  --globe-line:  #0F1013;
  --globe-hover: rgba(255, 255, 255, .10);

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,.4);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.6);
}

/* ============================================================
   Reset e base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img, svg, canvas { display: block; max-width: 100%; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -.015em;
}

::selection { background: var(--yellow-soft); color: var(--ink); }
:root[data-theme="dark"] ::selection { background: #3A3418; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

/* ============================================================
   Tipografia
   ============================================================ */
.eyebrow {
  font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600;
}
.deck {
  font-family: var(--serif); font-size: 20px; line-height: 1.45;
  color: var(--ink-2); font-weight: 400;
}
.muted { color: var(--ink-3); }
.small { font-size: 13px; }

/* ============================================================
   Layout
   ============================================================ */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }

main { padding-block: 48px 96px; }

.page-head { margin-bottom: 36px; max-width: var(--readw); }
.page-head .eyebrow { margin-bottom: 14px; }
.page-head h1 { font-size: clamp(36px, 5.5vw, 56px); letter-spacing: -.02em; line-height: 1.02; }
.page-head .deck { margin-top: 14px; }
.page-head .actions { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; }

.section { margin-top: 64px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding-bottom: 14px; border-bottom: 1px solid var(--ink); margin-bottom: 4px;
}
.section-head h2 { font-size: 26px; }
.section-head a {
  font-size: 13.5px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 4px;
  white-space: nowrap;
}
.section-head a:hover { color: var(--ink); }

.row { display: flex; gap: 10px; align-items: center; }
.row.wrap-row { flex-wrap: wrap; }
.spacer { flex: 1; }
.hairline { height: 1px; background: var(--line); border: 0; }

/* ============================================================
   Cabeçalho
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  height: var(--nav-h);
  display: flex; align-items: center; gap: 28px;
  width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 24px;
}

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand .mark { width: 22px; height: 22px; flex-shrink: 0; }
.brand .name {
  font-family: var(--serif); font-size: 21px; font-weight: 500; letter-spacing: -.01em;
  white-space: nowrap;
}
.brand .name .amp { font-style: italic; color: var(--ink-2); padding-inline: 1px; }

.nav-links { display: flex; align-items: center; gap: 22px; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  padding: 4px 0; border-bottom: 1px solid transparent; white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); border-bottom-color: var(--ink); }

.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* Countdown: discreto, tabular, com um ponto amarelo a pulsar */
.countdown {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums;
  position: relative; cursor: default;
  padding: 5px 11px; border-radius: var(--r-full); border: 1px solid var(--line);
}
.countdown .cd-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--yellow);
  animation: pulse 2.4s ease-in-out infinite; flex-shrink: 0;
}
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }
.countdown .cd-units { display: flex; align-items: baseline; gap: 6px; }
.cd-unit { display: flex; align-items: baseline; }
.cd-unit b { font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.cd-unit span { font-size: 11px; color: var(--ink-3); margin-left: 1px; }
.countdown .cd-tip {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--ink); color: var(--bg);
  font-size: 12px; padding: 6px 10px; border-radius: 8px;
  white-space: nowrap; opacity: 0; pointer-events: none;
  transform: translateY(-3px); transition: opacity .15s, transform .15s;
  box-shadow: var(--shadow-md);
}
.countdown:hover .cd-tip { opacity: 1; transform: translateY(0); }
.countdown.done { border-color: var(--yellow); background: var(--yellow-soft); }

.theme-btn {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  color: var(--ink-2); transition: background .15s, color .15s;
}
.theme-btn:hover { background: var(--bg-2); color: var(--ink); }

.nav-auth { display: flex; align-items: center; }
.nav-auth:empty { display: none; }
.nav-user {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 11px; border-radius: var(--r-full);
  font-size: 13px; font-weight: 500; color: var(--ink-2); border: 1px solid var(--line);
  transition: border-color .15s, color .15s;
}
.nav-user:hover { border-color: var(--ink-3); color: var(--ink); }
.nav-user .dot { width: 7px; height: 7px; }

@media (max-width: 820px) {
  .nav-inner { flex-wrap: wrap; height: auto; padding-block: 10px; gap: 12px 20px; }
  .nav-links { order: 3; width: 100%; gap: 18px; }
}
@media (max-width: 420px) {
  .cd-unit.sec { display: none; }
  .brand .name { font-size: 19px; }
}

/* ============================================================
   Botões
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px; border-radius: var(--r-md);
  font-size: 14px; font-weight: 500;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  transition: border-color .15s, background .15s, color .15s, opacity .15s, transform .1s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; pointer-events: none; }

.btn-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-primary:hover { opacity: .86; border-color: var(--ink); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg-2); color: var(--ink); border-color: transparent; }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }

.icon-btn {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  color: var(--ink-3); transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--bg-2); color: var(--ink); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

/* ============================================================
   Campos
   ============================================================ */
input[type="text"], input[type="url"], input[type="date"], input[type="password"],
input[type="search"], input[type="number"], textarea, select {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink); font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select {
  padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239A9DA4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
input[type="date"] { font-variant-numeric: tabular-nums; min-width: 0; }
/* No iPhone, um campo com letra abaixo de 16px faz a página dar um
   salto de zoom quando se carrega nele. Por isso, no telemóvel, 16px. */
@media (max-width: 640px) {
  input[type="text"], input[type="url"], input[type="date"], input[type="password"],
  input[type="search"], input[type="number"], textarea, select { font-size: 16px; }
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 8%, transparent);
}
label.lbl { font-size: 12.5px; font-weight: 500; color: var(--ink-2); display: block; margin-bottom: 6px; }
.field-hint { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; min-height: 1em; }
.field-hint.err { color: var(--danger); }
.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .form-grid.two { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--ink); margin: 0; }

/* ============================================================
   Etiquetas, filtros, vazios
   ============================================================ */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px; border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 500; letter-spacing: .01em;
  background: var(--bg-2); color: var(--ink-2); border: 1px solid var(--line);
}
.chip.yellow { background: var(--yellow-soft); color: var(--yellow-ink); border-color: transparent; }
.chip.blue   { background: var(--blue-soft);   color: var(--blue-ink);   border-color: transparent; }
.chip.green  { background: var(--green-soft);  color: var(--green-ink);  border-color: transparent; }
.chip.pink   { background: var(--pink-soft);   color: var(--pink-ink);   border-color: transparent; }
.chip.lilac  { background: var(--lilac-soft);  color: var(--lilac-ink);  border-color: transparent; }
.chip.red    { background: var(--danger-soft); color: var(--danger);     border-color: transparent; }

.segmented {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--bg-2); border-radius: var(--r-md); border: 1px solid var(--line);
}
.segmented button {
  height: 28px; padding: 0 12px; border-radius: 7px;
  font-size: 13px; font-weight: 500; color: var(--ink-2); transition: background .15s, color .15s;
}
.segmented button:hover { color: var(--ink); }
.segmented button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pills button {
  height: 28px; padding: 0 11px; border-radius: var(--r-full);
  border: 1px solid var(--line-2); font-size: 13px; color: var(--ink-2);
  transition: background .15s, color .15s, border-color .15s;
}
.pills button:hover { border-color: var(--ink-3); color: var(--ink); }
.pills button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pills button .dot { width: 7px; height: 7px; margin-right: 7px; vertical-align: 1px; }

.empty {
  text-align: center; padding: 56px 20px; color: var(--ink-3);
  border: 1px dashed var(--line-2); border-radius: var(--r-lg);
}
.empty .big { font-family: var(--serif); font-size: 30px; color: var(--ink-2); margin-bottom: 8px; }
.empty p { font-size: 14.5px; max-width: 38ch; margin-inline: auto; }
.empty .btn { margin-top: 18px; }

code {
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;
  font-size: .88em; padding: 1px 6px; border-radius: 6px;
  background: var(--bg-2); border: 1px solid var(--line);
}

/* ============================================================
   Início
   ============================================================ */
.hero { padding-block: 56px 20px; max-width: var(--readw); }
.hero .eyebrow { margin-bottom: 18px; }
.hero h1 { font-size: clamp(52px, 9vw, 96px); letter-spacing: -.03em; line-height: .95; }
.hero h1 .amp { font-style: italic; font-weight: 300; color: var(--ink-2); }
.hero .deck { margin-top: 22px; font-size: 22px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 30px; }
.hero-actions .btn { height: 42px; padding: 0 18px; font-size: 14.5px; }

.next-list { display: flex; flex-direction: column; }
.next-row {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 18px; align-items: center;
  padding: 16px 0; border-bottom: 1px solid var(--line);
}
.next-row:hover .nr-title { text-decoration: underline; text-underline-offset: 3px; }
.nr-date { font-family: var(--serif); line-height: 1; }
.nr-date b { display: block; font-size: 30px; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.nr-date span {
  display: block; margin-top: 4px; font-family: var(--sans);
  font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); font-weight: 600;
}
.nr-main { min-width: 0; }
.nr-title { display: block; font-size: 17px; font-weight: 500; line-height: 1.35; }
.nr-sub { display: block; font-size: 13.5px; color: var(--ink-2); margin-top: 3px; }
.nr-kind { font-size: 12px; color: var(--ink-3); white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }

.index-list { display: flex; flex-direction: column; }
.index-row {
  display: grid; grid-template-columns: 44px 1fr auto 24px; gap: 18px; align-items: center;
  padding: 26px 0; border-bottom: 1px solid var(--line);
}
.index-row .num { font-family: var(--serif); font-size: 15px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.index-row h3 { font-size: 26px; letter-spacing: -.01em; }
.index-row p { color: var(--ink-2); font-size: 14.5px; margin-top: 3px; }
.index-row .meta { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.index-row .arrow { color: var(--ink-3); transition: transform .2s, color .2s; }
.index-row:hover .arrow { transform: translateX(4px); color: var(--ink); }
@media (max-width: 600px) {
  .index-row { grid-template-columns: 1fr 24px; padding: 20px 0; }
  .index-row .num, .index-row .meta { display: none; }
  .index-row h3 { font-size: 22px; }
}

.photo-strip {
  display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px;
  scroll-snap-type: x mandatory; scrollbar-width: thin;
}
.photo-strip a {
  flex: 0 0 auto; height: 180px; scroll-snap-align: start;
  border-radius: var(--r-sm); overflow: hidden; background: var(--bg-2); position: relative;
}
.photo-strip img { height: 100%; width: auto; max-width: 320px; object-fit: cover; }
.photo-strip .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 10px 8px;
  font-size: 12px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.55));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ============================================================
   To-do
   ============================================================ */
.todo-add { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; margin-bottom: 24px; }
.todo-add select { width: auto; min-width: 96px; }
.todo-add input[type="date"] { width: 150px; }
@media (max-width: 640px) {
  .todo-add { grid-template-columns: 1fr 1fr; }
  .todo-add input[type="text"], .todo-add .btn { grid-column: 1 / -1; }
  .todo-add select, .todo-add input[type="date"] { width: 100%; }
}

.todo-toolbar {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding-bottom: 12px; border-bottom: 1px solid var(--ink);
}
.todo-toolbar .sum { font-size: 13px; color: var(--ink-3); margin-left: auto; white-space: nowrap; }
.progress { height: 2px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ink); transition: width .3s; }

.todo-list { display: flex; flex-direction: column; }
.todo-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 4px; border-bottom: 1px solid var(--line);
}
.todo-item.done .todo-text { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-2); }

.tick {
  width: 20px; height: 20px; flex-shrink: 0; margin-top: 3px;
  border-radius: 50%; border: 1.5px solid var(--line-2);
  display: grid; place-items: center; color: var(--bg);
  transition: background .15s, border-color .15s, transform .1s;
}
.tick:hover { border-color: var(--ink); transform: scale(1.06); }
.tick.on { background: var(--ink); border-color: var(--ink); }
.tick svg { opacity: 0; transition: opacity .1s; }
.tick.on svg { opacity: 1; }

.todo-body { flex: 1; min-width: 0; }
.todo-text { font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; cursor: text; }
.todo-text input {
  height: 32px; padding: 0 8px; font-size: 16px; border-radius: 6px; margin: -4px 0;
}
.todo-sub { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.todo-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.todo-item:hover .todo-actions, .todo-item:focus-within .todo-actions { opacity: 1; }
@media (hover: none) { .todo-actions { opacity: 1; } }

.todo-done-head {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 22px 4px 8px; color: var(--ink-3); font-size: 13px; font-weight: 500;
  cursor: pointer; user-select: none;
}
.todo-done-head svg { transition: transform .2s; }
.todo-done-head.closed svg { transform: rotate(-90deg); }
.todo-done-head .btn { margin-left: auto; }

/* ============================================================
   Globo
   ============================================================ */
/* A página do globo cabe toda no ecrã: sem scroll, sem rodapé. O globo
   estica para preencher o que sobra entre o título e a legenda. */
.globe-body { height: 100vh; height: 100dvh; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.globe-body .nav { flex: none; }
.globe-page {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 18px 24px 14px;
}
.globe-title { flex: none; font-size: clamp(30px, 4.5vw, 44px); letter-spacing: -.02em; line-height: 1.02; margin-bottom: 10px; }

/* O palco reserva o espaço e recebe o rato; o canvas é maior do que ele,
   transparente, de uma ponta à outra do ecrã, para a esfera poder
   crescer sobre a página quando se aproxima. */
.globe-stage {
  position: relative; width: 100%; flex: 1 1 auto; min-height: 200px;
  touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
}
.globe-stage:active { cursor: grabbing; }
/* Halo atrás da esfera; o tamanho acompanha o zoom (--globe-d vem do JS) */
.globe-stage::before {
  content: ""; position: absolute; left: 50%; top: 50%; border-radius: 50%; pointer-events: none;
  width: var(--globe-d, 0px); height: var(--globe-d, 0px);
  transform: translate(-50%, -50%);
  box-shadow:
    0 0 70px 14px color-mix(in srgb, var(--blue) 16%, transparent),
    0 34px 60px -24px rgba(19, 20, 23, .28);
}
:root[data-theme="dark"] .globe-stage::before {
  box-shadow: 0 0 90px 20px color-mix(in srgb, var(--blue) 22%, transparent);
}
.globe-stage canvas { position: absolute; pointer-events: none; max-width: none; }
.globe-hint {
  position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  font-size: 12px; color: var(--ink-3); pointer-events: none; white-space: nowrap;
  transition: opacity .4s; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.globe-tip {
  position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none;
  opacity: 0; transform: translate(-50%, calc(-100% - 14px));
  background: var(--ink); color: var(--bg);
  font-size: 12.5px; font-weight: 500; line-height: 1.3;
  padding: 7px 10px; border-radius: 8px; white-space: nowrap;
  box-shadow: var(--shadow-md); transition: opacity .1s;
}
.globe-tip.on { opacity: 1; }
.globe-tip small { display: block; opacity: .7; font-size: 11px; font-weight: 400; margin-top: 1px; }

.globe-legend {
  display: flex; gap: 8px 26px; justify-content: center; flex-wrap: wrap;
  margin-top: 10px; font-size: 13px; color: var(--ink-2);
  position: relative; z-index: 1; flex: none;
}
.globe-legend span { display: inline-flex; align-items: center; gap: 8px; }
.globe-legend em { font-style: normal; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot.casa     { background: var(--lilac); }
.dot.visitado { background: var(--yellow); }
.dot.marcado  { background: var(--blue); }
.dot.evento   { background: var(--yellow); }
.dot.anual    { background: transparent; box-shadow: inset 0 0 0 1.5px var(--yellow); }
.dot.nosso    { background: var(--lilac); }
.dot.green    { background: var(--green); }
.dot.blue     { background: var(--blue); }
.dot.pink     { background: var(--pink); }
.dot.yellow   { background: var(--yellow); }
.dot.lilac    { background: var(--lilac); }
.globe-legend .line { display: inline-block; width: 14px; height: 4px; border-radius: 2px; background: var(--blue); }
.cal-legend { justify-content: flex-start; margin-top: 14px; }

/* ============================================================
   Destino (fotografias de um país)
   ============================================================ */
.dest-head { margin-bottom: 32px; }
.dest-head .flag { font-size: 40px; line-height: 1; margin-bottom: 14px; }
.dest-head h1 { font-size: clamp(40px, 6vw, 64px); letter-spacing: -.02em; line-height: 1; }
.dest-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 16px; font-size: 14px; color: var(--ink-2); }
.dest-meta span { display: inline-flex; align-items: center; gap: 7px; }
.dest-meta a:hover { text-decoration: underline; text-underline-offset: 3px; }
.dest-note {
  max-width: var(--readw); margin-top: 20px;
  font-family: var(--serif); font-size: 20px; line-height: 1.5; color: var(--ink-2); font-style: italic;
  white-space: pre-wrap;
}
.dest-note button {
  font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--ink-3);
  border-bottom: 1px dashed var(--line-2); line-height: 1.3;
}
.dest-note button:hover { color: var(--ink); border-color: var(--ink); }
.dest-note.has { cursor: text; }
.dest-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }

.gallery { columns: 3; column-gap: 14px; }
@media (max-width: 900px) { .gallery { columns: 2; } }
@media (max-width: 520px) { .gallery { columns: 1; } }

.ph { break-inside: avoid; margin-bottom: 14px; position: relative; }
.ph .ph-box {
  position: relative; overflow: hidden; border-radius: var(--r-sm); background: var(--bg-2);
}
.ph img { width: 100%; height: auto; cursor: zoom-in; transition: transform .5s ease; }
.ph:hover img { transform: scale(1.015); }
.ph figcaption { padding: 8px 2px 2px; font-family: var(--serif); font-size: 15.5px; color: var(--ink-2); line-height: 1.4; }
.ph figcaption small { display: block; font-family: var(--sans); font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.ph .ph-act { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.ph:hover .ph-act, .ph:focus-within .ph-act { opacity: 1; }
@media (hover: none) { .ph .ph-act { opacity: 1; } }
.ph .ph-act button {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: rgba(255,255,255,.92); color: #222; box-shadow: var(--shadow-sm);
}
.ph .ph-act button:hover { background: #fff; }
.ph .ph-act button.danger:hover { color: var(--danger); }
.ph.pending .ph-box { opacity: .5; }
.ph .ph-box.missing {
  min-height: 120px; display: grid; place-items: center; padding: 20px;
  font-size: 12.5px; color: var(--ink-3); text-align: center; line-height: 1.4;
}

.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none;
  flex-direction: column; align-items: center; justify-content: center;
  background: rgba(10,10,12,.94); padding: 24px;
  touch-action: pan-y;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%; max-height: calc(100vh - 130px); max-height: calc(100dvh - 130px);
  object-fit: contain; border-radius: 4px; box-shadow: var(--shadow-lg);
  -webkit-user-select: none; user-select: none;
}
.lightbox .lb-cap {
  color: rgba(255,255,255,.82); font-family: var(--serif); font-size: 17px;
  margin-top: 16px; text-align: center; max-width: 60ch; line-height: 1.4;
}
.lightbox .lb-cap small { display: block; font-family: var(--sans); font-size: 12px; opacity: .6; margin-top: 4px; }
.lightbox .lb-btn {
  position: absolute; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.1); color: #fff; display: grid; place-items: center;
  transition: background .15s;
}
.lightbox .lb-btn:hover { background: rgba(255,255,255,.22); }
.lightbox .lb-x { top: 18px; right: 18px; }
.lightbox .lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-count { position: absolute; top: 30px; left: 24px; color: rgba(255,255,255,.75); font-size: 13px; font-variant-numeric: tabular-nums; }
/* No telemóvel os botões saem de cima da fotografia e vão para
   baixo, com mais área para o dedo (e arrastar também muda de foto). */
@media (max-width: 640px) {
  .lightbox { padding: 16px 12px calc(20px + env(safe-area-inset-bottom)); }
  .lightbox img { max-height: calc(100dvh - 190px); }
  .lightbox .lb-btn { width: 52px; height: 52px; background: rgba(255,255,255,.14); }
  .lightbox .lb-x { top: calc(12px + env(safe-area-inset-top)); right: 12px; }
  .lightbox .lb-prev { left: 22px; top: auto; bottom: calc(18px + env(safe-area-inset-bottom)); transform: none; }
  .lightbox .lb-next { right: 22px; top: auto; bottom: calc(18px + env(safe-area-inset-bottom)); transform: none; }
  .lightbox .lb-cap { margin-top: 12px; margin-bottom: 64px; font-size: 15px; }
  .lightbox .lb-count { top: calc(26px + env(safe-area-inset-top)); left: 18px; }
}

/* ============================================================
   Calendário
   ============================================================ */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; align-items: start; }
@media (max-width: 960px) {
  .cal-layout { grid-template-columns: 1fr; gap: 36px; }
  /* empilhado, o painel não tem onde colar-se */
  .cal-panel { position: static; }
}

.cal-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.cal-toolbar h2 { font-size: 30px; letter-spacing: -.01em; min-width: 0; }
.cal-toolbar h2 span { color: var(--ink-3); font-weight: 300; font-style: italic; margin-left: 6px; }
.cal-toolbar .nav-btns { display: flex; gap: 2px; }
.cal-toolbar .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.cal { border-top: 1px solid var(--ink); }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); padding: 10px 0 8px; border-bottom: 1px solid var(--line); }
.cal-dow span {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600; padding-left: 8px;
}
.cal-week {
  --lane-h: 19px;
  position: relative; display: grid; grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--line);
}
.cal-day {
  min-height: 96px; padding: 8px; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  text-align: left; transition: background .15s;
}
.cal-day:last-child { border-right: 0; }
.cal-day:hover, .cal-day.sel { background: var(--bg-2); }
.cal-day .n {
  font-size: 13px; font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums;
  width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%;
}
.cal-day.out .n { color: var(--ink-3); opacity: .55; }
.cal-day.today .n { background: var(--ink); color: var(--bg); font-weight: 600; }
.cal-day.nosso { background: var(--lilac-soft); }
.cal-day.nosso:hover, .cal-day.nosso.sel { background: color-mix(in srgb, var(--lilac) 38%, var(--bg-2)); }
.cal-day.nosso .n { color: var(--lilac-ink); font-weight: 600; }
.cal-day.nosso.today .n { background: var(--lilac-ink); color: var(--bg); }
.cal-day .dots { display: flex; gap: 4px; align-items: center; padding-left: 7px; min-height: 6px; }
.cal-day .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--yellow); display: block; }
.cal-day .dots i.anual { background: transparent; box-shadow: inset 0 0 0 1.5px var(--yellow); }
.cal-day .dots i.nosso { background: var(--lilac); width: 7px; height: 7px; }
.cal-day .dots b { font-size: 10px; color: var(--ink-3); font-weight: 500; line-height: 1; }
.cal-day.out .dots { opacity: .5; }

.cal-week[style*="--lanes"] .cal-day { min-height: calc(52px + var(--lanes) * var(--lane-h)); }
.cal-bars { position: absolute; inset: 0; pointer-events: none; }
.bar {
  position: absolute; height: 5px; background: var(--blue);
  bottom: calc(8px + var(--lane, 0) * var(--lane-h));
}
.bar.s { border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
.bar.e { border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
.bar i {
  position: absolute; left: 0; bottom: 7px; padding-left: 1px;
  font-style: normal; font-size: 11px; font-weight: 500; color: var(--blue-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
@media (max-width: 640px) {
  .cal-week { --lane-h: 8px; }
  .cal-day { min-height: 66px; padding: 5px; gap: 4px; }
  .cal-day .n { width: 22px; height: 22px; font-size: 12px; }
  .cal-day .dots { padding-left: 6px; }
  .bar { height: 3px; }
  .bar i { display: none; }
}

.cal-panel { position: sticky; top: calc(var(--nav-h) + 24px); }
.cal-panel .eyebrow { margin-bottom: 8px; }
.cal-panel h2 { font-size: 28px; line-height: 1.1; margin-bottom: 14px; }
.cal-items { display: flex; flex-direction: column; border-top: 1px solid var(--ink); }
.cal-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cal-item .ico { width: 12px; flex-shrink: 0; margin-top: 8px; display: grid; place-items: center; }
.cal-item .ico i { display: block; width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); }
.cal-item .ico i.anual { background: transparent; box-shadow: inset 0 0 0 1.5px var(--yellow); }
.cal-item .ico i.nosso { background: var(--lilac); width: 10px; height: 10px; }
.cal-item .ico i.trip { width: 12px; height: 4px; border-radius: 2px; background: var(--blue); }
.cal-item.nosso .ci-title { color: var(--lilac-ink); }
.cal-item .ci-body { flex: 1; min-width: 0; }
.cal-item .ci-title { font-size: 15.5px; font-weight: 500; line-height: 1.35; text-align: left; }
.cal-item button.ci-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.cal-item .ci-sub { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.cal-item .ci-sub a:hover { text-decoration: underline; text-underline-offset: 3px; }
.cal-item .ci-note { font-family: var(--serif); font-size: 15px; color: var(--ink-2); margin-top: 5px; line-height: 1.45; white-space: pre-wrap; }
.cal-item .ci-act { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.cal-item:hover .ci-act, .cal-item:focus-within .ci-act { opacity: 1; }
@media (hover: none) { .cal-item .ci-act { opacity: 1; } }
.cal-panel .quiet { font-size: 14px; color: var(--ink-3); padding: 12px 0; border-bottom: 1px solid var(--line); }
.cal-panel .panel-actions { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }

.month-list { margin-top: 36px; }
.month-list h3 {
  font-family: var(--sans); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600; padding-bottom: 8px; border-bottom: 1px solid var(--ink);
}
.ml-row {
  display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid var(--line); text-align: left; width: 100%;
}
.ml-row:hover .ml-t { text-decoration: underline; text-underline-offset: 3px; }
.ml-row .ml-d { font-family: var(--serif); font-size: 16px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.ml-row .ml-t { font-size: 14px; display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.ml-row .ml-t em { font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-row .ml-t small { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.ml-row .ml-t .dot { width: 7px; height: 7px; align-self: center; }
.ml-row .ml-t .line { width: 10px; height: 4px; border-radius: 2px; background: var(--blue); align-self: center; flex-shrink: 0; }
.month-list .none { font-size: 13.5px; color: var(--ink-3); padding: 10px 0; }

/* ============================================================
   Modal, toast, rodapé
   ============================================================ */
.modal-bg {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(10,10,12,.45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: none; place-items: center; padding: 20px;
}
.modal-bg.open { display: grid; }
.modal {
  background: var(--surface); border-radius: var(--r-lg); padding: 26px;
  width: min(480px, 100%); box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  max-height: 90vh; overflow-y: auto;
  animation: modalIn .18s cubic-bezier(.2,.8,.3,1);
}
.modal.wide { width: min(560px, 100%); }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.modal h3 { font-size: 24px; margin-bottom: 4px; }
.modal .modal-sub { font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.modal .modal-body { margin-top: 18px; }
.modal .modal-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 22px; }
.modal.shake { animation: shake .4s; }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}

.toast-wrap {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 120;
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none;
}
.toast {
  background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: var(--r-md);
  font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-md);
  animation: toastIn .22s cubic-bezier(.2,.8,.3,1);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.foot { border-top: 1px solid var(--line); padding-block: 28px; margin-top: 48px; }
.foot .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.foot p:empty { display: none; }
.foot a:hover { color: var(--ink); }

/* ============================================================
   Telemóvel
   Fica no fim de propósito: estas regras têm de vir depois de
   todas as outras para ganharem sem precisar de !important.
   Menos margens, mais área para o dedo — o que se toca tem de
   ter uns 44px de lado.
   ============================================================ */
@media (max-width: 640px) {
  main { padding-block: 28px 56px; }
  .globe-page { padding: 12px 18px 10px; }
  .globe-title { font-size: 26px; margin-bottom: 6px; }
  .globe-legend { font-size: 12px; gap: 4px 14px; margin-top: 6px; }
  .globe-legend em { display: none; }
  .globe-legend .dot { width: 9px; height: 9px; }
  .hero { padding-block: 32px 12px; }
  .page-head { margin-bottom: 26px; }
  .section { margin-top: 44px; }
  .deck, .hero .deck { font-size: 18px; }
  .btn { height: 42px; padding: 0 16px; }
  .btn-sm { height: 36px; padding: 0 12px; }
  .hero-actions .btn { height: 44px; }
  .icon-btn { width: 38px; height: 38px; }
  .pills button, .segmented button { height: 34px; }
  .tick { width: 24px; height: 24px; margin-top: 1px; }
  .todo-text { font-size: 16.5px; }
  .ph .ph-act button { width: 36px; height: 36px; }
  .modal { padding: 20px; max-height: 88dvh; }
  .modal .modal-foot .btn { flex: 1; }
  .foot { padding-block: 22px; margin-top: 36px; }
  .toast-wrap { bottom: calc(18px + env(safe-area-inset-bottom)); width: 100%; padding-inline: 16px; }
}
@media (max-width: 520px) {
  .wrap, .nav-inner { padding-inline: 18px; }
  /* O cabeçalho encolhe: nas páginas que cabem todas no ecrã (globo,
     passaporte) cada linha que ele poupa é espaço para a figura. */
  .nav-inner { padding-block: 8px; gap: 8px 16px; }
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 13.5px; padding: 2px 0; }
  .countdown { padding: 4px 9px; font-size: 12.5px; }
  .cal-toolbar h2 { font-size: 25px; width: 100%; order: -1; }
  .cal-toolbar .acts { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
