/* SkyPanda — cozy Animal-Crossing-inspired theme */
:root {
  --bg: #f7f1da;
  --card: #fffdf4;
  --card2: #f8f0d9;
  --ink: #5a4a38;
  --ink-soft: #98866f;
  --line: #eadfb8;
  --accent: #e8863f;
  --accent-dark: #c96a26;
  --leaf: #67ab5b;
  --leaf-dark: #4e8f44;
  --sky: #bfe3f2;
  --sky-deep: #5b93b8;
  --field-green: #8ecb7e;
  --good: #67ab5b;
  --warn: #dd9a33;
  --bad: #e0685c;
  --vlifr: #a06bc9;
  --shadow: 0 4px 0 rgba(90, 74, 56, .07), 0 12px 26px rgba(90, 74, 56, .10);
  --r: 24px;
  font-size: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", "Segoe UI", system-ui, sans-serif;
  background:
    linear-gradient(180deg, var(--sky) 0px, #e3f0e2 260px, var(--bg) 420px);
  background-attachment: fixed;
  color: var(--ink);
  min-height: 100vh;
}

/* drifting clouds */
.sky-deco { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.cloud { position: absolute; opacity: .8; }
.cloud.c1 { width: 190px; top: 26px; animation: drift 80s linear infinite; }
.cloud.c2 { width: 130px; top: 110px; animation: drift 115s linear infinite; animation-delay: -50s; opacity: .6; }
@keyframes drift { from { transform: translateX(-240px); } to { transform: translateX(110vw); } }

.wrap { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; padding: 16px 16px 108px; }

/* ---------- header ---------- */
header { display: flex; align-items: center; gap: 14px; padding: 8px 10px 14px; }
.mascot { width: 92px; height: 92px; flex: 0 0 auto; object-fit: contain; animation: bob 3.4s ease-in-out infinite; filter: drop-shadow(0 6px 8px rgba(90,74,56,.18)); }
/* beta notice on the flight-plan page */
.beta-banner { background: #fff4d6; border: 2.5px solid #e9c86a; border-radius: 16px; padding: 12px 16px; margin: 0 0 14px; box-shadow: 0 3px 0 #e9c86a; }
.beta-banner .beta-tag { display: inline-block; background: #e08a2c; color: #fff; font-weight: 800; font-size: .72rem; letter-spacing: .3px; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; }
.beta-banner p { margin: 8px 0 0; color: #6b5327; font-weight: 600; line-height: 1.45; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-7px) rotate(2deg); } }
.title-block h1 {
  margin: 0; font-size: 2rem; color: #fffdf4; letter-spacing: .5px;
  text-shadow: 0 2.5px 0 rgba(90,74,56,.35), 0 5px 14px rgba(90,74,56,.25);
}
.title-block p { margin: 2px 0 0; color: #4a6b7e; font-weight: 600; font-size: .93rem; }

/* ---------- pages & cards ---------- */
.page.pop-in { animation: popIn .34s cubic-bezier(.24, 1.2, .4, 1); }
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }

.card {
  background: var(--card); border: 3px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 16px;
}
.card h2 { margin: 0 0 6px; color: var(--accent-dark); font-size: 1.25rem; }
.card h3 { margin: 16px 0 6px; color: var(--accent-dark); font-size: 1.02rem; }
.hint { color: var(--ink-soft); font-size: .89rem; margin: 6px 0 8px; line-height: 1.55; }

/* ---------- bottom dock ---------- */
#dock {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 60;
  display: flex; gap: 4px; padding: 8px;
  background: rgba(255, 253, 244, .96); backdrop-filter: blur(6px);
  border: 3px solid var(--line); border-radius: 999px;
  box-shadow: 0 8px 24px rgba(90, 74, 56, .22);
  max-width: calc(100vw - 20px); overflow-x: auto;
}
.dock-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 74px; padding: 8px 10px; border: none; cursor: pointer;
  background: transparent; border-radius: 999px; color: var(--ink-soft);
  font-family: inherit; font-size: .68rem; font-weight: 700;
  transition: all .18s ease;
}
.dock-btn svg { width: 23px; height: 23px; }
.dock-btn:hover { color: var(--accent-dark); transform: translateY(-2px); }
.dock-btn.active { background: var(--leaf); color: #fff; box-shadow: 0 3px 0 var(--leaf-dark); }

/* ---------- inputs & buttons ---------- */
.btn {
  padding: 11px 22px; font-size: .97rem; font-family: inherit; font-weight: 700;
  background: var(--accent); color: #fff; border: none; border-radius: 999px; cursor: pointer;
  box-shadow: 0 3.5px 0 var(--accent-dark); transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1.5px); box-shadow: 0 1px 0 var(--accent-dark); }
.btn.secondary { background: var(--sky-deep); box-shadow: 0 3.5px 0 #40708f; }
.btn.big { padding: 13px 26px; font-size: 1.02rem; background: var(--leaf); box-shadow: 0 3.5px 0 var(--leaf-dark); }

.search-row { display: flex; gap: 10px; flex-wrap: wrap; position: relative; }
.search-row input, .plan-grid input, .plan-grid select, .plan-grid textarea,
.duo input, .settings-row input, .settings-row select, .ft-field input {
  padding: 11px 16px; font-size: .96rem; font-family: inherit;
  border: 2.5px solid var(--line); border-radius: 16px; background: #fff; color: var(--ink);
  outline: none; transition: border-color .2s; width: 100%;
}
.search-row input { flex: 1 1 300px; }
.search-row input:focus, .plan-grid input:focus, .ft-field input:focus { border-color: var(--accent); }
.suggestions {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 40; margin-top: 6px;
  background: #fff; border: 2.5px solid var(--line); border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow); max-height: 320px; overflow-y: auto;
}
.suggestions div { padding: 10px 16px; cursor: pointer; font-size: .93rem; }
.suggestions div:hover { background: var(--card2); }
.suggestions b { color: var(--accent-dark); }
.suggestions small { color: var(--ink-soft); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.chip {
  background: var(--card2); border: 2px solid var(--line); border-radius: 999px;
  padding: 5px 14px; cursor: pointer; font-size: .86rem; font-family: inherit; color: var(--ink); font-weight: 600;
}
.chip:hover { border-color: var(--leaf); background: #eef6e7; }

/* from → to strip */
.fromto { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 10px; }
.ft-field { position: relative; flex: 1 1 180px; }
.ft-field label { display: block; font-weight: 700; font-size: .8rem; margin-bottom: 5px; color: var(--ink-soft); }
.ft-arrow { font-size: 1.4rem; color: var(--leaf-dark); padding-bottom: 10px; }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 10px; }
.plan-grid label { display: block; font-weight: 700; margin-bottom: 5px; font-size: .82rem; color: var(--ink-soft); }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
details.adv { margin-top: 12px; }
details.adv summary { cursor: pointer; font-weight: 700; color: var(--sky-deep); font-size: .9rem; }

.wp-list { margin: 8px 0; padding-left: 22px; }
.wp-list li { margin: 7px 0; }
.wp-list small { color: var(--ink-soft); }
.wp-kind { font-size: .64rem; font-weight: 800; border-radius: 8px; padding: 2.5px 7px; color: #fff; background: var(--sky-deep); vertical-align: 1px; }
.wp-kind.vfr { background: #cfa50c; }
.wp-x { border: none; background: var(--card2); color: var(--bad); border-radius: 10px; cursor: pointer; padding: 2px 9px; font-weight: 700; margin-left: 6px; }
.wp-x:hover { background: #fbe3e0; }

/* ---------- weather ---------- */
.wx-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 12px; }
.wx-tile { background: var(--card2); border: 2px solid var(--line); border-radius: 18px; padding: 11px 15px; }
.wx-tile .lbl { font-size: .72rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; font-weight: 700; }
.wx-tile .val { font-size: 1.02rem; font-weight: 700; line-height: 1.45; }
.cat-banner { border-radius: 16px; padding: 11px 18px; font-weight: 700; font-size: 1rem; color: #fff; margin-top: 10px; }
.cat-VFR { background: var(--good); } .cat-MVFR { background: var(--warn); }
.cat-IFR { background: var(--bad); } .cat-LIFR { background: var(--vlifr); }
.raw-box {
  background: #52422e; color: #ffeccb; padding: 12px 16px; border-radius: 14px;
  font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: .84rem;
  white-space: pre-wrap; word-break: break-word; margin-top: 10px; line-height: 1.5;
}
.taf-period { border-left: 5px solid var(--sky-deep); background: var(--card2); border-radius: 0 14px 14px 0; padding: 8px 14px; margin: 8px 0; }
.taf-period .kind { font-weight: 800; color: var(--sky-deep); font-size: .78rem; }
.taf-period pre { margin: 4px 0 0; font-family: ui-monospace, Menlo, monospace; font-size: .82rem; white-space: pre-wrap; }
.notam-item { background: var(--card2); border: 2px solid var(--line); border-radius: 14px; padding: 10px 14px; margin: 8px 0; }
.notam-item pre { margin: 0; font-family: ui-monospace, Menlo, monospace; font-size: .78rem; white-space: pre-wrap; word-break: break-word; max-height: 120px; overflow: hidden; }
.notam-item.open pre { max-height: none; }
.notam-item .more { color: var(--sky-deep); cursor: pointer; font-size: .84rem; font-weight: 700; }
.gfa-imgs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.gfa-frame { text-align: center; }
.gfa-frame img { width: 100%; border-radius: 16px; border: 3px solid var(--line); background: #fff; cursor: zoom-in; }
.gfa-frame .cap { font-size: .8rem; color: var(--ink-soft); margin-top: 4px; }

table.uw { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .9rem; }
table.uw th, table.uw td { padding: 7px 10px; text-align: left; border-bottom: 2px dashed var(--line); }
table.uw th { color: var(--accent-dark); }
.rwy-closed-row td { color: var(--bad); }
.closed-flag { background: var(--bad); color: #fff; font-size: .68rem; font-weight: 800; border-radius: 8px; padding: 2px 8px; margin-left: 6px; }
.closed-flag.end { background: var(--warn); }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 8px; font-size: .95rem; }
.info-grid .lbl { display: block; font-size: .72rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }

/* ---------- airport diagram ---------- */
.apt-diagram { width: 100%; display: block; border-radius: 20px; }
.apt-diagram.compass { max-width: 420px; margin: 0 auto; }
.dg-label { font-size: 12px; font-weight: 800; fill: #6b5b45; font-family: inherit; }
.dg-terminal { font-size: 10.5px; fill: #7a5a2e; font-weight: 700; }
.dg-twy-label { font-size: 10px; font-weight: 800; fill: #fff; font-family: inherit; }
.dg-rwy-ident { font-size: 12px; font-weight: 800; fill: #4c4335; font-family: inherit; }
.dg-rwy-ident.closed { fill: #fff; }
.dg-heli { font-size: 10px; font-weight: 800; fill: #fffdf4; }
.dg-wind-label { font-size: 13px; font-weight: 800; fill: #6b5b45; font-family: inherit; }
.compass-txt { font-size: 17px; font-weight: 800; fill: var(--accent-dark); font-family: inherit; }
.compass-needle { transition: transform 1s cubic-bezier(.3,1.2,.5,1); }
.streamline {
  fill: none; stroke: #ffffff; stroke-width: 3.4; stroke-linecap: round; opacity: 0;
  stroke-dasharray: 90 400;
  animation: flow 5s linear infinite;
}
@keyframes flow {
  0% { stroke-dashoffset: 90; opacity: 0; }
  12% { opacity: .65; }
  70% { opacity: .65; }
  100% { stroke-dashoffset: -400; opacity: 0; }
}
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0 4px; font-size: .82rem; color: var(--ink-soft); font-weight: 600; }
.legend .lg { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 17px; height: 11px; border-radius: 5px; display: inline-block; border: 1.5px solid rgba(90,74,56,.2); }
.legend .hatch-red { background: repeating-linear-gradient(45deg, #e0685c 0 3px, #fbe3e0 3px 6px); }
.legend .hatch-org { background: repeating-linear-gradient(45deg, #eda13c 0 3px, #fdf0d8 3px 6px); }
.comp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-top: 8px; }
.ops-line { border-radius: 14px; padding: 9px 13px; margin: 6px 0; font-size: .88rem; background: var(--card2); border-left: 5px solid var(--ink-soft); }
.ops-line.closed { border-left-color: var(--bad); }
.ops-line.end { border-left-color: var(--warn); }
.ops-line.wip { border-left-color: var(--warn); }
.ops-line.lgt { border-left-color: var(--sky-deep); }
.ops-line code { font-size: .78rem; background: rgba(0,0,0,.05); border-radius: 6px; padding: 1px 5px; }

/* ---------- nav log & SHP ---------- */
.nl-wrap { overflow-x: auto; border-radius: 14px; }
table.navlog { font-size: .82rem; white-space: nowrap; }
table.navlog th { position: sticky; top: 0; background: var(--card); }
.shp-col { background: rgba(103, 171, 91, .13); }
.nl-total td { border-top: 3px solid var(--line); background: var(--card2); }
.ok-txt { color: var(--good); } .bad-txt { color: var(--bad); }
.hdg { color: var(--accent-dark); font-size: 1.06em; }
.shp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-top: 10px; }
.shp-card { background: var(--card2); border: 2.5px solid var(--line); border-radius: 18px; padding: 11px 15px; }
.shp-head { font-weight: 800; color: var(--leaf-dark); font-size: .85rem; margin-bottom: 6px; }
.shp-row { display: flex; justify-content: space-between; padding: 3.5px 0; border-bottom: 1.5px dashed var(--line); font-size: .88rem; }
.shp-row:last-child { border-bottom: none; }
.shp-row b { font-variant-numeric: tabular-nums; }
.dep-arr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }

/* route reasoning */
.reason-list { list-style: none; margin: 8px 0 0; padding: 0; }
.reason { background: var(--card2); border: 2px solid var(--line); border-radius: 16px; padding: 10px 14px; margin: 8px 0; font-size: .9rem; line-height: 1.5; position: relative; padding-left: 40px; }
.reason::before { content: "✈"; position: absolute; left: 14px; top: 9px; color: var(--sky-deep); }
.reason.policy::before, .reason.short::before { content: "★"; color: var(--leaf-dark); }
.reason.cp::before { content: "●"; color: #cfa50c; }
.reason.gap::before, .reason.nopois::before { content: "⌛"; color: var(--warn); }
.reason.drift::before { content: "≋"; color: var(--sky-deep); }

/* ---------- map ---------- */
#mapCanvas { height: 64vh; min-height: 420px; border-radius: 20px; border: 3px solid var(--line); }
.leg-label {
  background: rgba(255, 253, 244, .95); border: 2px solid #e0685c; border-radius: 12px;
  padding: 3px 8px; font-size: 11px; font-weight: 800; color: #8c3a30; white-space: nowrap;
  transform: translate(-50%, -125%); width: max-content !important; font-family: inherit;
}
.shp-label {
  background: #67ab5b; color: #fff; border-radius: 12px; padding: 3px 8px; border: 2px solid #4e8f44;
  font-size: 10.5px; font-weight: 800; white-space: nowrap; transform: translate(-50%, 30%);
  width: max-content !important; font-family: inherit;
}
.drift-label {
  background: rgba(78, 143, 209, .92); color: #fff; border-radius: 9px; padding: 1px 6px;
  font-size: 10px; font-weight: 800; transform: translate(-50%, -50%); width: max-content !important;
}
.wp-tt { background: #fffdf4; border: 2px solid var(--accent-dark); border-radius: 9px; font-weight: 800; font-size: 11px; padding: 1px 6px; font-family: inherit; color: var(--ink); }
.wp-tt.vfr { background: #ffd83d; border-color: #a8850a; }
.apt-tt { background: rgba(255,255,255,.92); border: 1.5px solid #5a76b8; color: #5a76b8; font-size: 10px; font-weight: 800; border-radius: 7px; padding: 0 5px; font-family: inherit; }

/* ---------- clouds ---------- */
.cloud-type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 8px; }
.cloud-type { display: flex; align-items: center; gap: 10px; background: var(--card2); border: 2px solid var(--line); border-radius: 16px; padding: 8px 12px; }
.cloud-ico { width: 74px; height: 50px; flex: 0 0 auto; }
.cloud-profile { width: 100%; display: block; border-radius: 16px; }
.cp-axis { font-size: 11px; fill: #5a6b80; font-family: inherit; font-weight: 600; }
.cp-lbl { font-size: 12px; fill: #3b4a5c; font-weight: 700; font-family: inherit; }
.cp-lbl.ceil { fill: #b3341f; font-weight: 800; }
.cp-lbl.cruise { fill: #c2311e; font-weight: 800; }

/* ---------- settings, misc ---------- */
.settings-row { margin: 14px 0; }
.settings-row label { display: block; font-weight: 700; margin-bottom: 6px; }
.settings-row input, .settings-row select { max-width: 460px; }
footer { color: var(--ink-soft); font-size: .78rem; margin-top: 22px; line-height: 1.6; }
.spinner { text-align: center; padding: 28px; color: var(--ink-soft); font-size: 1rem; font-weight: 600; }
.spinner::before { content: ""; display: inline-block; width: 14px; height: 14px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent); margin-right: 10px; vertical-align: -2px;
  animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.lightbox {
  position: fixed; inset: 0; background: rgba(74, 60, 40, .78); z-index: 100;
  display: flex; align-items: center; justify-content: center; cursor: zoom-out; padding: 20px;
}
.lightbox img { max-width: 96%; max-height: 92%; border-radius: 16px; background: #fff; }
.hidden { display: none !important; }
@media (max-width: 680px) {
  .dock-btn { min-width: 56px; font-size: .6rem; }
  .title-block h1 { font-size: 1.5rem; }
  .mascot { width: 72px; height: 72px; }
}

/* per-leg wind, sources, TOC/TOD, night lights */
.legwind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 8px; }
.legwind { background: var(--card2); border: 2px solid var(--line); border-radius: 16px; padding: 10px 14px; }
.legwind.manual { border-color: var(--warn); }
.legwind .lw-head { font-weight: 800; font-size: .84rem; color: var(--sky-deep); margin-bottom: 4px; }
.legwind .lw-fb { font-size: .82rem; color: var(--ink-soft); margin-bottom: 6px; }
.legwind input { padding: 7px 10px; border: 2px solid var(--line); border-radius: 10px; width: 100%; font-family: inherit; }
.src { font-size: .68rem; font-weight: 700; border-radius: 6px; padding: 1px 5px; background: #e4f0e0; color: var(--leaf-dark); }
.src.manual { background: #fdeeda; color: #a8700f; }
.src.none { background: #eee; color: #888; }
.toc-tag { background: var(--leaf); color: #fff; border-radius: 8px; font-size: .68rem; padding: 2px 7px; margin-left: 4px; }
.tocd-label { background: #fffdf4; border: 2px solid var(--leaf-dark); color: var(--leaf-dark); border-radius: 10px; padding: 2px 7px; font-size: 10.5px; font-weight: 800; transform: translate(-50%, -50%); width: max-content !important; font-family: inherit; }
.tocd-label.tod { border-color: #a8700f; color: #a8700f; }
.rwy-lgt { animation: twinkle 2.2s ease-in-out infinite; }
@keyframes twinkle { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* openAIP badge, vias, community & profile */
.oap-badge { background: #2e7d5b; color: #fff; font-size: .62rem; font-weight: 800; border-radius: 999px; padding: 3px 10px; vertical-align: 3px; letter-spacing: .04em; }
.ft-field.via { position: relative; }
.ft-field.via .wp-x { position: absolute; top: 0; right: 0; }
#addViaBtn { padding: 11px 16px; font-size: 1.1rem; }
.post-card { background: var(--card2); border: 2.5px solid var(--line); border-radius: 18px; padding: 14px 16px; margin: 10px 0; }
.post-card.small { padding: 10px 14px; }
.post-card h3 { margin: 6px 0; }
.post-head { display: flex; gap: 10px; align-items: center; }
.post-head small { color: var(--ink-soft); display: block; }
.post-stats { display: flex; gap: 14px; align-items: center; font-weight: 700; color: var(--ink-soft); margin-top: 8px; flex-wrap: wrap; }
.like-btn { cursor: pointer; color: var(--bad); }
.like-btn:hover { transform: scale(1.1); }
.avatar-img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2.5px solid var(--line); }
.avatar-img.big { width: 76px; height: 76px; }
.avatar-fallback { width: 40px; height: 40px; border-radius: 50%; background: var(--leaf); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.avatar-fallback.big { width: 76px; height: 76px; font-size: 1.6rem; }
.profile-head { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.profile-head input { padding: 9px 13px; border: 2.5px solid var(--line); border-radius: 12px; font-family: inherit; }
.auth-box { max-width: 380px; }
.auth-box input { display: block; width: 100%; margin: 8px 0; padding: 11px 15px; border: 2.5px solid var(--line); border-radius: 14px; font-family: inherit; }
.btn.oauth { background: #fff; color: var(--ink); border: 2.5px solid var(--line); box-shadow: 0 3px 0 var(--line); }
.btn.oauth.apple { background: #1d1d1f; color: #fff; border: none; box-shadow: 0 3px 0 #000; }
.comment { background: #fff; border-radius: 12px; padding: 7px 12px; margin: 6px 0; font-size: .9rem; }
.cp-flag { background: #ffd83d; border: 2px solid #a8850a; border-radius: 9px; font-weight: 800; font-size: 10.5px; padding: 1px 6px; color: #5a4a10; transform: translate(-50%, -120%); width: max-content !important; font-family: inherit; }
.cp-flag.comm { background: #d9c8f5; border-color: #7a5fb8; color: #443064; }
.poi-add { display: flex; flex-direction: column; gap: 5px; min-width: 185px; }
.poi-add input { padding: 7px 10px; border: 2px solid var(--line); border-radius: 10px; font-family: inherit; font-weight: 700; }
.poi-add .chip { text-align: left; cursor: pointer; }

.post-card { margin: 18px 0; padding: 18px 20px; }
.post-detail { margin-top: 12px; }
.comment-btn { background: var(--leaf); box-shadow: 0 3.5px 0 var(--leaf-dark); border-radius: 999px; transform: rotate(-1.5deg); }
.comment-btn:hover { transform: rotate(1.5deg) translateY(-2px); }

/* ============================================================
   POLISH LAYER — cozy Animal-Crossing flow, motion & softness
   ============================================================ */
html { scroll-behavior: smooth; }

/* soft dappled background pattern (like AC grass/paper) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.5) 1.5px, transparent 1.6px);
  background-size: 26px 26px; opacity: .35; mix-blend-mode: soft-light;
}

/* cards breathe: rounder, softer, and they ease in one after another */
.card { transition: transform .2s cubic-bezier(.24,1.2,.4,1), box-shadow .2s; }
.page.pop-in > .card, .page.pop-in > .beta-banner {
  animation: cardRise .5s cubic-bezier(.22,1.15,.36,1) both;
}
.page.pop-in > *:nth-child(1) { animation-delay: .02s; }
.page.pop-in > *:nth-child(2) { animation-delay: .09s; }
.page.pop-in > *:nth-child(3) { animation-delay: .16s; }
.page.pop-in > *:nth-child(4) { animation-delay: .23s; }
.page.pop-in > *:nth-child(n+5) { animation-delay: .3s; }
@keyframes cardRise { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }

/* little tiles feel alive — a gentle lift + tilt on hover */
.wx-tile, .shp-card, .legwind, .post-card, .cloud-type, .reason, .comp-grid > .wx-tile {
  transition: transform .16s cubic-bezier(.24,1.2,.4,1), box-shadow .16s;
}
.wx-tile:hover, .shp-card:hover, .cloud-type:hover {
  transform: translateY(-3px) rotate(-.5deg);
  box-shadow: 0 8px 16px rgba(90,74,56,.12);
}
.post-card:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(90,74,56,.14); }

/* chips pop */
.chip { transition: transform .14s cubic-bezier(.24,1.4,.4,1), background .15s, border-color .15s; }
.chip:hover { transform: translateY(-2px) scale(1.05) rotate(-1deg); }
.chip:active { transform: translateY(0) scale(.97); }

/* buttons: soft sheen + squishier press */
.btn { position: relative; overflow: hidden; transition: transform .12s cubic-bezier(.24,1.4,.4,1), box-shadow .12s, filter .15s; }
.btn::after {
  content: ""; position: absolute; top: 0; left: -40%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.4), transparent);
  transform: skewX(-18deg); transition: left .5s ease;
}
.btn:hover::after { left: 130%; }
.btn:hover { transform: translateY(-2.5px) scale(1.02); filter: saturate(1.06); }
.btn.big:hover { transform: translateY(-3px) scale(1.03); }

/* inputs: friendly focus glow */
.search-row input, .plan-grid input, .plan-grid select, .ft-field input, .duo input,
.settings-row input, .settings-row select, .legwind input, .auth-box input, .poi-add input {
  transition: border-color .18s, box-shadow .18s, transform .12s;
}
.search-row input:focus, .plan-grid input:focus, .plan-grid select:focus, .ft-field input:focus,
.duo input:focus, .settings-row input:focus, .legwind input:focus, .auth-box input:focus, .poi-add input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 4px rgba(232,134,63,.16);
}

/* dock: springy active pill + icon bounce */
.dock-btn { transition: color .18s, transform .18s cubic-bezier(.24,1.4,.4,1), background .2s; }
.dock-btn.active { transform: translateY(-3px); }
.dock-btn.active svg { animation: iconPop .4s cubic-bezier(.24,1.5,.4,1); }
.dock-btn svg { transition: transform .18s; }
.dock-btn:hover svg { transform: translateY(-1px) scale(1.12); }
@keyframes iconPop { 0% { transform: scale(.6) rotate(-12deg); } 60% { transform: scale(1.18) rotate(5deg); } 100% { transform: none; } }

/* mascot gives a happy wiggle when tapped */
.mascot { cursor: pointer; }
.mascot:hover { animation: wiggle .6s ease-in-out; }
@keyframes wiggle { 0%,100% { transform: rotate(-2deg); } 25% { transform: rotate(7deg) scale(1.05); } 75% { transform: rotate(-8deg) scale(1.05); } }

/* ---------- redesigned BETA banner (prominent + info button) ---------- */
.beta-banner {
  background: linear-gradient(135deg, #fff0c9, #ffe1a6);
  border: 3px solid #eec25a; box-shadow: 0 5px 0 #e3ad3e, 0 12px 22px rgba(200,150,40,.18);
  border-radius: 22px; padding: 14px 18px; position: relative; overflow: hidden;
}
.beta-banner::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
  transform: translateX(-100%); animation: betaShine 5.5s ease-in-out infinite;
}
@keyframes betaShine { 0%,60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.beta-head { display: flex; align-items: center; gap: 10px; }
.beta-banner .beta-tag {
  display: inline-flex; align-items: center; gap: 7px; background: #e0842a; color: #fff;
  font-weight: 900; font-size: .82rem; letter-spacing: .4px; padding: 5px 13px 5px 11px;
  border-radius: 999px; text-transform: uppercase; box-shadow: 0 2.5px 0 #b9691a;
}
.beta-banner .beta-tag::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 0 rgba(255,255,255,.9); animation: betaPulse 1.6s ease-out infinite;
}
@keyframes betaPulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.8); } 100% { box-shadow: 0 0 0 8px rgba(255,255,255,0); } }
.beta-info {
  margin-left: auto; flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  border: 2.5px solid #d79a2f; background: #fff; color: #c37f1e; font-weight: 900;
  font-family: Georgia, "Times New Roman", serif; font-size: 1.05rem; font-style: italic;
  cursor: pointer; line-height: 1; transition: transform .15s cubic-bezier(.24,1.5,.4,1), background .15s;
}
.beta-info:hover { transform: scale(1.15) rotate(6deg); background: #fff6e2; }
.beta-banner p { margin: 9px 0 0; color: #6b5327; font-weight: 700; line-height: 1.45; position: relative; }

/* ---------- modal (info + prompts) ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center;
  padding: 22px; background: rgba(74,60,40,.5); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .2s ease;
}
.modal-back.show { opacity: 1; }
.modal-card {
  background: var(--card); border: 3px solid var(--line); border-radius: 26px;
  box-shadow: 0 18px 46px rgba(90,74,56,.3); padding: 24px 24px 20px; max-width: 460px; width: 100%;
  position: relative; transform: translateY(20px) scale(.94); transition: transform .28s cubic-bezier(.22,1.3,.36,1);
}
.modal-back.show .modal-card { transform: none; }
.modal-card h2 { margin: 0 6px 10px 0; color: var(--accent-dark); font-size: 1.3rem; }
.modal-body { color: var(--ink); line-height: 1.55; font-size: .96rem; font-weight: 500; }
.modal-body b { color: var(--accent-dark); }
.modal-body ul { margin: 8px 0 0; padding-left: 18px; }
.modal-body li { margin: 5px 0; }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.modal-x {
  position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%;
  border: none; background: var(--card2); color: var(--ink-soft); font-size: 1rem; font-weight: 800;
  cursor: pointer; transition: transform .15s, background .15s;
}
.modal-x:hover { background: #fbe3e0; color: var(--bad); transform: rotate(90deg); }

/* ============================================================
   FLIGHT PLAN — one flowing "sheet" instead of scattered boxes
   ============================================================ */
.plan-sheet { padding: 0; overflow: hidden; }

/* summary hero */
.plan-hero {
  background: linear-gradient(135deg, #eaf6ff 0%, #e4f3df 100%);
  border-bottom: 3px dashed var(--line); padding: 18px 22px;
}
.ph-route { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 4px; margin-bottom: 12px; }
.ph-wp {
  font-weight: 800; font-size: .9rem; padding: 4px 12px; border-radius: 999px;
  background: #fff; border: 2px solid var(--accent-dark); color: var(--accent-dark);
}
.ph-wp.vfr { border-color: #a8850a; color: #8a6a08; background: #fffceb; }
.ph-arr { color: var(--leaf-dark); font-weight: 800; }
.ph-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.ph-stat {
  display: flex; align-items: center; gap: 8px; background: #fff; border: 2.5px solid var(--line);
  border-radius: 16px; padding: 8px 14px; box-shadow: 0 3px 0 rgba(90,74,56,.06);
  font-size: 1.05rem; font-variant-numeric: tabular-nums;
}
.ph-stat .ph-ico { font-size: 1.15rem; line-height: 1; }
.ph-stat b { color: var(--ink); }

/* sections flow one after another, split by a soft dashed rule */
.plan-sec { padding: 18px 22px; border-top: 2px dashed var(--line); }
.plan-sec:first-of-type { border-top: none; }
.plan-sec > h2 { display: flex; align-items: center; gap: 8px; }
.plan-sec > h2::before {
  content: ""; width: 9px; height: 20px; border-radius: 5px; background: var(--leaf); flex: 0 0 auto;
}

/* foldable detail sections (per-leg wind, SHP, freqs, reasoning) */
.plan-fold { border-top: 2px dashed var(--line); }
.plan-fold > summary {
  list-style: none; cursor: pointer; padding: 15px 22px; font-weight: 800; font-size: 1.05rem;
  color: var(--accent-dark); display: flex; align-items: center; gap: 10px; transition: background .15s;
}
.plan-fold > summary::-webkit-details-marker { display: none; }
.plan-fold > summary::before {
  content: "▸"; color: var(--leaf-dark); font-size: .95rem; transition: transform .22s cubic-bezier(.3,1.3,.5,1);
}
.plan-fold[open] > summary::before { transform: rotate(90deg); }
.plan-fold > summary:hover { background: var(--card2); }
.plan-fold .fold-body { padding: 0 22px 18px; animation: foldIn .28s ease; }
@keyframes foldIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* floating save / publish — rides along top-right of the plan, hole-punch style */
.plan-fab {
  position: sticky; top: 10px; z-index: 55; margin: 0 0 10px;
  display: flex; justify-content: flex-end; align-items: center; gap: 8px;
  pointer-events: none; /* clicks pass through the empty left area */
}
.plan-fab > * { pointer-events: auto; }
.fab-btn {
  display: inline-flex; align-items: center; gap: 6px; border: none; cursor: pointer;
  font-family: inherit; font-weight: 800; font-size: .84rem; color: #fff;
  padding: 8px 15px; border-radius: 999px; transition: transform .14s cubic-bezier(.24,1.4,.4,1), box-shadow .14s;
}
.fab-btn .fab-ico { font-size: 1rem; }
.fab-btn.save { background: var(--leaf); box-shadow: 0 3px 0 var(--leaf-dark); }
.fab-btn.publish { background: var(--sky-deep); box-shadow: 0 3px 0 #40708f; }
.fab-btn:hover { transform: translateY(-2px) scale(1.04); }
.fab-btn:active { transform: translateY(1px); }
.fab-msg { font-size: .8rem; font-weight: 800; color: var(--leaf-dark); opacity: 0; max-width: 0; overflow: hidden; white-space: nowrap; transition: opacity .2s, max-width .3s; border-radius: 999px; }
.fab-msg.show { opacity: 1; max-width: 180px; padding: 6px 12px; background: rgba(255,253,244,.95); border: 2px solid var(--line); box-shadow: 0 4px 10px rgba(90,74,56,.14); }
@media (max-width: 680px) {
  .plan-fab { position: static; float: none; display: flex; justify-content: center; margin: 0 0 12px; }
}

/* ============================================================
   FLOW REDESIGN — dissolve the boxes, living time-of-day sky
   ============================================================ */

/* --- living sky: dawn / day / dusk / night (set by applyDaylight) --- */
body { background-attachment: fixed; }
:root[data-tod="day"]  body { background-image: linear-gradient(180deg, #b8e0f0 0%, #d7ecdf 45%, #f3ead2 100%); }
:root[data-tod="dawn"] body { background-image: linear-gradient(180deg, #ffc39e 0%, #ffdac6 42%, #f4e7d8 100%); }
:root[data-tod="dusk"] body { background-image: linear-gradient(180deg, #f2a069 0%, #e69aac 45%, #b89ec9 80%, #d9c9d6 100%); }
:root[data-tod="night"] body { background-image: linear-gradient(180deg, #253356 0%, #34426b 45%, #4a4c74 100%); }
/* dim the drifting clouds after dark, glow them at dusk */
:root[data-tod="night"] .cloud { opacity: .28; filter: brightness(.8); }
:root[data-tod="dusk"] .cloud { opacity: .55; }
/* tagline stays legible on darker skies */
:root[data-tod="night"] .title-block p, :root[data-tod="dusk"] .title-block p { color: #f3e7d8; }

/* --- de-box: ONE frosted sheet per view; sections flow inside it --- */
.wrap { padding: 18px 16px 116px; }
.page {
  background: rgba(255,252,243,.7);
  -webkit-backdrop-filter: blur(16px) saturate(1.08);
  backdrop-filter: blur(16px) saturate(1.08);
  border: 1px solid rgba(255,255,255,.5);
  box-shadow: 0 16px 46px rgba(60,48,36,.13);
  border-radius: 34px; padding: 8px 12px; margin-bottom: 20px;
}
:root[data-tod="night"] .page { background: rgba(250,247,240,.9); border-color: rgba(255,255,255,.42); }
/* cards dissolve into transparent, flowing sections split by soft dashes */
.card {
  background: none; border: none; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
  border-radius: 22px; padding: 20px 22px; margin: 0;
}
.card + .card { border-top: 2px dashed rgba(120,100,70,.15); }
/* results that stream into a container also flow as sections */
#wxResults > .card + .card, #communityBody > .card + .card { border-top: 2px dashed rgba(120,100,70,.15); }
/* plan sheet: no nested box — hero is an inset banner aligned with sections */
.card.plan-sheet { padding: 0; background: none; overflow: visible; border-radius: 0; }
.plan-hero { margin: 0 0 6px; border-radius: 20px; border-bottom: none; padding: 16px 20px; box-shadow: 0 4px 14px rgba(60,48,36,.07); }
.plan-sec { padding: 14px 20px; border-top: 2px dashed rgba(120,100,70,.15); }
.plan-sec:first-of-type { border-top: none; }

/* small tiles stop being little boxes — soft fills, no borders */
.wx-tile, .shp-card, .legwind, .reason, .notam-item, .cloud-type, .post-card, .taf-period {
  border: none; box-shadow: none; background: rgba(255,255,255,.5);
}
.wx-tile:hover, .shp-card:hover, .cloud-type:hover { box-shadow: 0 8px 16px rgba(90,74,56,.10); }
.post-card { background: rgba(255,255,255,.55); }
.taf-period { border-radius: 14px; background: rgba(91,147,184,.1); border-left: 4px solid var(--sky-deep); }
/* manual leg-wind: soft inset accent instead of a hard border */
.legwind.manual { box-shadow: inset 4px 0 0 var(--warn); }
/* dropdown detail rows sit flush in the flow */
.plan-fold { border-top: 2px dashed rgba(120,100,70,.18); }
.plan-sec { border-top: 2px dashed rgba(120,100,70,.18); }
.plan-hero { background: linear-gradient(135deg, rgba(234,246,255,.85), rgba(228,243,223,.85)); }

/* suggestions dropdown: softer, frosted */
.suggestions { background: rgba(255,253,246,.97); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-color: rgba(255,255,255,.6); }

/* --- Save/Publish: two normal buttons at the top (do NOT follow scroll) --- */
.plan-fab { position: static; display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin: 4px 6px 10px; }
.fab-pill { display: inline-flex; align-items: center; gap: 10px; background: none; border: none; box-shadow: none; border-radius: 0; overflow: visible; }
.fab-btn {
  border: none; cursor: pointer; font-family: inherit; font-weight: 800; font-size: .88rem; color: #fff;
  padding: 10px 18px; display: inline-flex; align-items: center; gap: 7px; border-radius: 999px;
  transition: transform .13s cubic-bezier(.24,1.4,.4,1), box-shadow .13s, filter .15s;
}
.fab-btn.save { background: var(--leaf); box-shadow: 0 3.5px 0 var(--leaf-dark); }
.fab-btn.publish { background: var(--sky-deep); box-shadow: 0 3.5px 0 #40708f; }
.fab-btn .fab-ico { font-size: 1rem; }
.fab-btn::after { display: none; }
.fab-btn:hover { transform: translateY(-2px) scale(1.03); }
.fab-btn:active { transform: translateY(1.5px); box-shadow: 0 1px 0 var(--leaf-dark); }

/* --- tidy comment box (community post detail) --- */
.chat-input { display: flex; gap: 8px; margin-top: 12px; }
.chat-input input {
  flex: 1; padding: 11px 16px; border: 2px solid var(--line); border-radius: 999px;
  font-family: inherit; font-size: .92rem; background: #fff; color: var(--ink); outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.chat-input input:focus { border-color: var(--leaf); box-shadow: 0 0 0 4px rgba(103,171,91,.16); }
.comment-btn {
  flex: 0 0 auto; background: var(--leaf); color: #fff; border: none; font-family: inherit; font-weight: 800;
  padding: 11px 20px; border-radius: 999px; cursor: pointer; box-shadow: 0 3px 0 var(--leaf-dark);
  transform: none; transition: transform .13s cubic-bezier(.24,1.4,.4,1), box-shadow .13s;
}
.comment-btn:hover { transform: translateY(-2px); }
.comment-btn:active { transform: translateY(1.5px); box-shadow: 0 1px 0 var(--leaf-dark); }

/* --- city skyline on the horizon (behind everything, chosen by timezone) --- */
.skyline { position: fixed; left: 0; right: 0; bottom: 0; height: 210px; z-index: 0; pointer-events: none; overflow: hidden; }
.skyline svg { display: none; position: absolute; left: 0; bottom: 0; width: 100%; height: 100%; }
:root[data-city="london"]    .sky-london,
:root[data-city="vancouver"] .sky-vancouver,
:root[data-city="tokyo"]     .sky-tokyo,
:root[data-city="hongkong"]  .sky-hongkong,
:root[data-city="seoul"]     .sky-seoul { display: block; }
/* silhouette tint follows the time of day */
.skyline svg { color: rgba(74,96,128,.20); transition: color .8s ease; }
:root[data-tod="dawn"]  .skyline svg { color: rgba(150,108,120,.26); }
:root[data-tod="dusk"]  .skyline svg { color: rgba(66,48,78,.40); }
:root[data-tod="night"] .skyline svg { color: rgba(14,20,42,.55); }

/* be kind to motion-sensitive folks */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  html { scroll-behavior: auto; }
}
