/* Copyright (c) 2026 Wingit. All rights reserved.
   SPDX-License-Identifier: LicenseRef-Wingit-Proprietary */

/* The tools home (pages/home, decisions 0144 and 0167's "a bit bigger"; the welcome page, 0173:
   v1-your-overview's two panels, v2-first-trip's doors, v3-ask-first's Ask box), on top of
   edge.css, whose other pages it doesn't change. Base text 17 px, controls
   at least 44 px, no uppercase labels, no pills that don't help a decision, one surface level. Each
   tool's icon wears its accent (accent = provenance, design language v3.4; values from
   @wingit/tokens look-v34: tool-*, or the darker tool-*-text by day); the PTO optimizer and Round-up
   have none and use the brand's. */

:root {
  --tool-planner: #6949ba;
  --tool-planner-subtle: #f0eeff;
  --tool-finance: #007b5f;
  --tool-finance-subtle: #daf8ec;
  --tool-calendar: #8a5600;
  --tool-calendar-subtle: #ffedd9;
  --tool-wishlist: #90145f;
  --tool-wishlist-subtle: #ffe9f3;
  --tool-desk: #1d5d9b;
  --tool-desk-subtle: #e4f0fb;
  --tool-transit: #0870b0;
  --tool-transit-subtle: #e4f2ff;
  --color-brand: #d82a7d;
  --color-brand-hover: #ca1571;
  --color-on-brand: #fff;
  --color-border-strong: #a3866d;
  --color-surface-hover: #feede0;
  --color-warning-text: #985f00;
  /* The header's divider and aurora line, as the tools' web header (look-v34). */
  --color-divider: #f6e8db;
  --color-aurora-1: #7cd7cc;
  --color-aurora-3: #fc96bd;
  --color-aurora-5: #f2dd9d;
}

@media (prefers-color-scheme: dark) {
  :root {
    --tool-planner: #ad98ff;
    --tool-planner-subtle: #373152;
    --tool-finance: #47c3a2;
    --tool-finance-subtle: #0c4033;
    --tool-calendar: #d9912b;
    --tool-calendar-subtle: #4a3111;
    --tool-wishlist: #e97bb2;
    --tool-wishlist-subtle: #4d2a3b;
    --tool-desk: #7db4ea;
    --tool-desk-subtle: #1c3550;
    --tool-transit: #45a9e8;
    --tool-transit-subtle: #163a51;
    --color-brand: #ac8efa;
    --color-brand-hover: #b69bff;
    --color-on-brand: #171322;
    --color-border-strong: #7a788b;
    --color-surface-hover: #302e43;
    --color-warning-text: #d79227;
    --color-divider: #323042;
    --color-aurora-1: #19806b;
    --color-aurora-3: #4a2e7e;
    --color-aurora-5: #b66028;
  }
}

[hidden] {
  display: none !important;
}

body {
  font-size: 1.0625rem;
  line-height: 1.5;
}

/* --- the bar: the same words as today, no pills; the tools' web header's frame (0185: one navbar
   style): 64 px, full width, sticky, the divider and the aurora line under it --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom-color: var(--color-divider);
  background: color-mix(in srgb, var(--color-bg) 90%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.site-header::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  height: 2px;
  pointer-events: none;
  background: linear-gradient(90deg, var(--color-aurora-1), var(--color-aurora-3), var(--color-aurora-5));
  opacity: 0.45;
}

.site-header-inner {
  max-width: none;
  min-height: 64px;
  padding: 0 20px;
}

.brand img {
  width: 36px;
  height: 36px;
}

.badge {
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--color-text-secondary);
  font-size: 1rem;
  font-weight: 400;
}

.header-link {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--color-text);
  font-weight: 600;
  text-decoration: none;
}

.header-link:hover {
  background: var(--color-surface-hover);
}

/* --- the page: one column --- */
main.home {
  max-width: 880px;
  padding: 48px 32px 96px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 36px;
}

.home-head,
.welcome,
.home-tools,
.welcome-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

/* --- two panels (0173, v1-your-overview): the person on the left, the static tools on the right,
   from 1100 px and only once welcome.js knows who this is (.home-wide); without it, one column --- */
.home-grid,
.home-main,
.home-rail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 36px;
  min-width: 0;
}

.home-main {
  gap: 28px;
}

@media (min-width: 1100px) {
  main.home.home-wide {
    max-width: 1280px;
    padding-left: 48px;
    padding-right: 48px;
  }

  .home-wide .home-grid {
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 72px;
    align-items: start;
  }

  .home-wide .tools {
    grid-template-columns: minmax(0, 1fr);
  }
}

.home-head {
  gap: 14px;
}

.home h1 {
  font-size: 3.375rem;
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.lead {
  margin: 0;
  max-width: 62ch;
  font-size: 1.1875rem;
  line-height: 1.45;
}

.home h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5625rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.welcome {
  gap: 20px;
}

/* Holds the space above the tools while it asks (the one bit in welcome.js). */
.welcome-holding {
  min-height: 300px;
}

.home a:not(.button, .door, .tool, .header-link) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  text-underline-offset: 3px;
}

/* --- buttons: a flat brand fill for the one that matters --- */
.home .button {
  min-height: 48px;
  font-size: 1.0625rem;
}

.home .button-primary {
  background: var(--color-brand);
  color: var(--color-on-brand);
  box-shadow: none;
}

.home .button-primary:hover {
  background: var(--color-brand-hover);
}

.home .button-secondary {
  background: transparent;
  border: 1.5px solid var(--color-border-strong);
}

.home .button-secondary:hover {
  background: var(--color-surface-hover);
}

.welcome-actions {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.quiet-line,
.look-around,
.more-trips,
.down-line {
  margin: 0;
}

.quiet-line {
  color: var(--color-text-secondary);
}

.down-line {
  max-width: 62ch;
}

/* --- Ask Wingit at the top (0173, v3-ask-first): a box, not a chat; it opens the tool --- */
.ask {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.ask-box {
  display: grid;
  gap: 8px;
  margin: 0;
}

.ask-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.ask-label svg {
  color: var(--color-brand-text);
}

/* The AI mark the apps put on every Ask entry (0147, 0176 MW5). */
.ai-tag {
  padding: 0 6px;
  border: 1.5px solid currentcolor;
  border-radius: 6px;
  color: var(--color-brand-text);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.ask-field {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 6px 6px 6px 22px;
  border: 1.5px solid var(--color-border-strong);
  border-radius: 30px;
  background: var(--color-surface);
}

.ask-field:focus-within {
  border-color: var(--color-brand);
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.ask-text {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  max-height: 168px;
  margin: 0;
  padding: 11px 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--color-text);
  font: 500 1.125rem/1.4 var(--font-sans);
  resize: none;
  field-sizing: content;
}

.ask-text::placeholder {
  color: var(--color-text-secondary);
  font-weight: 400;
}

.home .ask-go {
  flex: none;
  min-width: 88px;
}

.ask-text:disabled,
.home .ask-go:disabled {
  cursor: not-allowed;
}

.home .ask-go:disabled {
  opacity: 0.55;
}

.ask-hint,
.ask-note {
  margin: 0;
  max-width: 72ch;
}

.ask-hint {
  color: var(--color-text-secondary);
}

.ask-note {
  display: grid;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--color-brand-subtle);
  color: var(--color-text);
}

.ask-note-title {
  font-weight: 600;
}

.ask-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* --- the trips area (0173): the next 12 months, a suggestion, the first trip up --- */
.year {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.year-head,
.year-trip {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  align-items: center;
  gap: 4px 20px;
}

.year-head {
  padding-bottom: 6px;
}

.year-months {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  color: var(--color-text-secondary);
}

.year-month-short {
  display: none;
}

.year-trips {
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--color-border);
}

.year-trip {
  min-height: 68px;
  padding: 8px 0;
  border-top: 1px solid var(--color-border);
}

.year-text {
  display: grid;
  min-width: 0;
}

.home .year-name {
  width: fit-content;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.year-when {
  color: var(--color-text-secondary);
  line-height: 1.35;
}

.year-track {
  position: relative;
  height: 28px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--color-border) 45%, transparent);
}

.year-bar {
  position: absolute;
  top: 6px;
  bottom: 6px;
  border-radius: 6px;
  background: var(--color-brand);
}

.year-bar-window {
  background: transparent;
  border: 2px dashed var(--color-brand);
}

.year-today {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--color-text-secondary);
  opacity: 0.5;
}

.first {
  display: grid;
  gap: 4px;
}

.first-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.first-when,
.first-where {
  margin: 0;
}

.first-when {
  font-size: 1.1875rem;
  font-weight: 600;
}

.first-where {
  color: var(--color-text-secondary);
}

.first .welcome-actions {
  margin-top: 10px;
}

/* --- the doors: plain links into each tool's own flow --- */
.doors {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.door {
  --accent: var(--color-brand-text);
  --accent-subtle: var(--color-brand-subtle);
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 128px;
  padding: 22px 24px;
  border: 1.5px solid var(--color-border-strong);
  border-radius: 20px;
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
}

a.door:hover {
  border-color: var(--accent);
  background: var(--color-surface-hover);
}

a.door:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.door .tool-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
}

.door .tool-icon svg {
  width: 34px;
  height: 34px;
}

.door .tool-arrow {
  width: 28px;
  height: 28px;
  flex: none;
  color: var(--accent);
}

.door-text {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 3px;
}

.door-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.door-line {
  font-size: 1.125rem;
  line-height: 1.4;
  color: var(--color-text-secondary);
}

.door-where {
  font-weight: 600;
  color: var(--accent);
}

.door-waiting {
  background: transparent;
  border-style: dashed;
}

.door-waiting .door-title {
  color: var(--color-text-secondary);
}

.door-wait {
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-warning-text);
}

.minis {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 28px;
}

.mini-waiting {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--color-text-secondary);
}

/* --- rows: hairlines on the page, no cards --- */
.rows {
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--color-border);
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  min-height: 76px;
  padding: 12px 0;
  border-top: 1px solid var(--color-border);
}

.row-text {
  flex: 1 1 220px;
  min-width: 0;
  display: grid;
  gap: 1px;
}

.row-title {
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.row-when {
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.row-actions {
  flex: none;
  display: flex;
  gap: 10px;
}

/* --- the tools, two across: always static, same links, same order --- */
.tools {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 40px;
}

.tools > li {
  min-width: 0;
  border-top: 1px solid var(--color-border);
}

.tool {
  --accent: var(--color-brand-text);
  --accent-subtle: var(--color-brand-subtle);
  min-height: 76px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  color: var(--color-text);
  text-decoration: none;
}

.tool:hover .tool-name {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tool:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.tool-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent-subtle);
  color: var(--accent);
  flex: none;
}

.tool-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tool-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.tool-line {
  color: var(--color-text-secondary);
  line-height: 1.35;
}

.tool-arrow {
  color: var(--color-text-secondary);
}

.tool:hover .tool-arrow {
  color: var(--accent);
}

.tool-planner {
  --accent: var(--tool-planner);
  --accent-subtle: var(--tool-planner-subtle);
}

.tool-finance {
  --accent: var(--tool-finance);
  --accent-subtle: var(--tool-finance-subtle);
}

.tool-calendar {
  --accent: var(--tool-calendar);
  --accent-subtle: var(--tool-calendar-subtle);
}

.tool-transit {
  --accent: var(--tool-transit);
  --accent-subtle: var(--tool-transit-subtle);
}

.tool-wishlist {
  --accent: var(--tool-wishlist);
  --accent-subtle: var(--tool-wishlist-subtle);
}

.tool-desk {
  --accent: var(--tool-desk);
  --accent-subtle: var(--tool-desk-subtle);
}

.tool-round-up {
  --accent: var(--color-brand-text);
  --accent-subtle: var(--color-brand-subtle);
}

/* --- coming soon: hairlines, an outlined icon, not clickable --- */
.soon {
  margin: 0;
  display: grid;
  gap: 12px;
}

.soon ul {
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--color-border);
}

.soon-item {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 8px 0;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}

.soon-item .tool-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: none;
  box-shadow: inset 0 0 0 1.5px var(--color-border-strong);
  color: var(--color-text-secondary);
}

.soon-item .tool-name {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0;
}

/* --- service notices and a tool's maintenance state (decision 0166): home.js fills them from the
   public GET /v1/notices, and they never appear with the API down. --- */
.notices {
  display: grid;
  gap: 10px;
}

.notices[hidden] {
  display: none;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--notice-border, var(--color-border));
  border-radius: 12px;
  background: var(--notice-bg, var(--color-surface));
  color: var(--color-text);
}

.notice-text {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}

.notice-text strong {
  font-weight: 600;
}

.notice-text a {
  color: inherit;
  font-weight: 600;
}

.notice-info {
  --notice-bg: var(--color-brand-subtle);
  --notice-border: var(--color-brand-text);
}

.notice-warning {
  --notice-bg: #fff3d6;
  --notice-border: #8a5600;
}

.notice-critical {
  --notice-bg: #ffe4e0;
  --notice-border: #b3261e;
}

.notice-dismiss {
  flex: none;
  min-width: 44px;
  min-height: 44px;
  margin: -8px -8px -8px 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.notice-dismiss:hover {
  background: rgb(127 127 127 / 18%);
}

.notice-dismiss:focus-visible {
  outline: 2px solid currentcolor;
  outline-offset: 2px;
}

.tool-tag {
  width: fit-content;
  font-weight: 600;
  line-height: 1.35;
}

.tool-tag-read_only {
  color: var(--color-warning-text);
}

.tool-tag-unavailable {
  color: var(--color-danger-text);
}

/* --- phones --- */
@media (max-width: 759px) {
  main.home {
    padding: 24px 16px 72px;
    gap: 28px;
  }

  .site-header-inner {
    padding: 0 16px;
  }

  .home h1 {
    font-size: 2.5rem;
  }

  .welcome-holding {
    min-height: 420px;
  }

  .door {
    gap: 14px;
    min-height: 0;
    padding: 18px 16px;
    align-items: flex-start;
  }

  .door .tool-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .door .tool-icon svg {
    width: 26px;
    height: 26px;
  }

  .door .tool-arrow {
    display: none;
  }

  .door-title {
    font-size: 1.5rem;
  }

  .door-line {
    font-size: 1.0625rem;
  }

  .tools {
    grid-template-columns: minmax(0, 1fr);
  }

  .year-head,
  .year-trip {
    grid-template-columns: minmax(0, 1fr);
  }

  .year-head > span:first-child {
    display: none;
  }

  .year-month-long {
    display: none;
  }

  .year-month-short {
    display: inline;
  }

  .ask-field {
    padding: 4px 4px 4px 16px;
  }
}

/* --- phones: the phone kit's scale and header (decision 0176, MW4: below 768 px only; the web
   doesn't change). The apps' wg-phone-scale in plain CSS: 15 px body and 13 px second lines on the
   tinted page, a 20 px title, one 52 px sticky header row, 16 px form fields and 44 px targets;
   the welcome page (0173) in one column, no floating buttons. --- */
@media (max-width: 767.98px) {
  :root {
    --color-bg-muted: #fef1e6;
    --color-divider: #f6e8db;
  }

  body {
    font-size: 0.9375rem;
    line-height: calc(22 / 15);
    background: var(--color-bg-muted);
  }

  .site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    padding-top: env(safe-area-inset-top);
    border-bottom-color: var(--color-divider);
    background: color-mix(in srgb, var(--color-bg-muted) 95%, transparent);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }

  .site-header-inner {
    min-height: 52px;
    padding: 4px 4px 4px 16px;
    gap: 8px;
  }

  /* The phone kit's header has no aurora line. */
  .site-header::after {
    display: none;
  }

  .brand img {
    width: 28px;
    height: 28px;
  }

  .brand-name {
    font-size: 1.25rem;
  }

  .badge {
    font-size: 0.8125rem;
  }

  .header-link {
    padding: 0 12px;
    font-size: 0.9375rem;
  }

  main.home {
    padding: 16px 16px 48px;
    gap: 24px;
  }

  .home h1 {
    font-size: 1.25rem;
    line-height: 1.3;
  }

  .lead {
    font-size: 0.9375rem;
  }

  .home h2 {
    font-size: 1.0625rem;
  }

  .home .button {
    min-height: 44px;
    font-size: 0.9375rem;
  }

  .tool {
    min-height: 60px;
    gap: 12px;
    padding: 8px 0;
  }

  .tool-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .tool-name {
    font-size: 0.9375rem;
  }

  .tool-line {
    font-size: 0.8125rem;
  }

  .door-title {
    font-size: 1.25rem;
  }

  .door-line {
    font-size: 0.9375rem;
  }

  .row {
    min-height: 60px;
  }

  .row-title {
    font-size: 1rem;
  }

  .row-when,
  .year-when,
  .first-where {
    font-size: 0.8125rem;
  }

  .ask-label {
    font-size: 1.0625rem;
  }

  .ai-tag {
    font-size: 0.8125rem;
  }

  /* Form fields stay at 16 px on phones: iOS zooms into anything smaller (0176). */
  .ask-text {
    min-height: 44px;
    padding: 10px 0;
    font-size: 1rem;
  }

  .home .ask-go {
    min-width: 72px;
  }

  .first-title {
    font-size: 1.25rem;
  }

  .first-when {
    font-size: 0.9375rem;
  }

  .year-trip {
    min-height: 60px;
  }

  .year-track {
    height: 22px;
  }

  .year-bar {
    top: 5px;
    bottom: 5px;
  }
}

@media (max-width: 767.98px) and (prefers-color-scheme: dark) {
  :root {
    --color-bg-muted: #201e2f;
    --color-divider: #323042;
  }
}

@media (forced-colors: active) {
  .door,
  .soon-item .tool-icon {
    border-color: CanvasText;
  }
}

@media (prefers-color-scheme: dark) {
  .notice-warning {
    --notice-bg: #3d2d0c;
    --notice-border: #d9912b;
  }

  .notice-critical {
    --notice-bg: #47201c;
    --notice-border: #f2857c;
  }
}
