:root {
  --ink: #241f1f;
  --muted: #746f6a;
  --line: #ded4c8;
  --paper: #fbf7f2;
  --panel: #ffffff;
  --italy-green: #008c45;
  --italy-red: #cd212a;
  --italy-cream: #fffaf2;
  --accent: #ca1515;
  --accent-dark: #8f1010;
  --accent-soft: #f9e4e1;
  --accent-2: #8b5e3c;
  --tan: #eadfce;
  --tan-light: #f6efe5;
  --grey: #ede9e3;
  --warn: #9b611b;
  --danger: #ca1515;
  --ok: #5d625c;
  --time: #ffd400;
  --shadow: 0 18px 45px rgba(91, 43, 33, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(0, 140, 69, 0.08), rgba(255, 255, 255, 0) 18%, rgba(255, 255, 255, 0) 82%, rgba(205, 33, 42, 0.08)),
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: white;
  min-height: 42px;
  padding: 0 14px;
  cursor: pointer;
}

button.ghost {
  background: var(--grey);
  color: var(--ink);
  border: 1px solid #d8d0c5;
}

button.danger-button {
  background: #fff0f0;
  color: var(--danger);
  border: 1px solid rgba(202, 21, 21, 0.45);
}

button.danger-button:hover {
  background: var(--danger);
  color: white;
}

form[data-dirty="false"] button[type="submit"] {
  background: #aaa39a;
}

form[data-dirty="true"] button[type="submit"] {
  background: var(--accent);
}

button.link-button {
  min-height: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  text-align: left;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(202, 21, 21, 0.35);
  outline-offset: 2px;
}

.helper-text,
.support-note {
  margin: 10px 0;
  color: var(--accent-2);
  font-weight: 700;
}

.auth-secondary-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.auth-secondary-actions .link-button {
  justify-self: start;
}

.password-rules-box {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--italy-green);
  border-radius: 8px;
  background: #fffdf9;
  color: var(--ink);
}

.password-rules-box strong {
  display: block;
  margin-bottom: 6px;
}

.password-rules-box ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

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

.hidden {
  display: none !important;
}

.lock-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(rgba(251, 247, 242, 0.82), rgba(251, 247, 242, 0.94)),
    url("https://images.unsplash.com/photo-1529154036614-a60975f5c760?auto=format&fit=crop&w=1800&q=80") center/cover;
}

.lock-card {
  width: min(430px, 100%);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(221, 216, 207, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.lock-card h1 {
  margin: 2px 0 8px;
  font-size: 38px;
}

.lock-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lock-card input {
  width: 100%;
  height: 46px;
  margin: 16px 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
}

.lock-card button {
  width: 100%;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.announcement-bar {
  width: 100%;
  padding: 10px 18px;
  background: var(--danger);
  border-bottom: 1px solid var(--accent-dark);
  color: white;
  font-weight: 800;
  text-align: center;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(0, 140, 69, 0.08), rgba(255, 255, 255, 0) 38%),
    var(--tan-light);
  overflow-y: auto;
}

.sidebar h1 {
  margin: 0 0 22px;
  font-size: 28px;
}

nav {
  display: grid;
  gap: 6px;
}

.nav-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  background: transparent;
  color: var(--ink);
  border: 1px solid transparent;
  text-align: left;
}

.nav-button.active {
  background: white;
  border-color: var(--line);
  box-shadow: inset 4px 0 0 var(--italy-green);
}

.nav-button.active::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-radius: 999px;
  background: var(--italy-red);
}

.mobile-more-toggle {
  display: none;
}

.mobile-menu-greeting {
  display: none;
}

main {
  min-width: 0;
}

.topbar-heading {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 88px;
  padding: 18px 28px;
  background: rgba(251, 250, 247, 0.94);
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 -3px 0 var(--italy-green), inset 0 -6px 0 #ffffff, inset 0 -9px 0 var(--italy-red);
  backdrop-filter: blur(12px);
}

.topbar-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar h2 {
  margin: 2px 0 0;
  font-size: 25px;
}

.italian-flag {
  display: inline-block;
  position: relative;
  width: 34px;
  height: 22px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(36, 31, 31, 0.18);
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 5px 14px rgba(36, 31, 31, 0.14);
}

.italian-flag::before,
.italian-flag::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 33.333%;
}

.italian-flag::before {
  left: 0;
  background: var(--italy-green);
}

.italian-flag::after {
  right: 0;
  background: var(--italy-red);
}

.page-flag {
  margin-top: 2px;
}

.top-actions {
  display: flex;
  gap: 8px;
}

#content {
  padding: 24px 28px 42px;
  scroll-margin-top: 152px;
}

.page-photo-hero {
  position: relative;
  min-height: 210px;
  display: flex;
  align-items: end;
  margin-bottom: 18px;
  padding: 24px;
  border-radius: 8px;
  overflow: hidden;
  color: white;
  background-image:
    linear-gradient(180deg, rgba(18, 13, 10, 0.08), rgba(18, 13, 10, 0.66)),
    var(--page-hero-image);
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow);
}

.page-photo-hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: linear-gradient(180deg, var(--italy-green), #ffffff 50%, var(--italy-red));
}

.page-photo-hero > div:not(.hero-italy-badge) {
  position: relative;
  z-index: 1;
}

.hero-italy-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: rgba(36, 31, 31, 0.38);
  color: white;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  backdrop-filter: blur(10px);
}

.page-photo-hero h3 {
  max-width: 760px;
  margin: 0;
  font-size: 30px;
  line-height: 1.08;
  color: white;
}

.page-photo-hero .eyebrow {
  color: #ffe4dd;
}

.eyebrow {
  margin: 0;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.error-text {
  min-height: 20px;
  color: var(--danger);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.grid.nested {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card {
  grid-column: span 4;
  background:
    linear-gradient(90deg, var(--italy-green), #ffffff 48%, var(--italy-red)) top / 100% 3px no-repeat,
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.card.wide {
  grid-column: span 8;
}

.card.full {
  grid-column: 1 / -1;
}

.card h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.metric {
  font-size: 34px;
  font-weight: 760;
  margin: 2px 0;
}

.badge-row,
.inline-actions,
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #f4eee5;
  color: var(--ink);
  font-size: 12px;
  font-weight: 720;
}

.badge.confirmed,
.badge.ok {
  background: rgba(0, 140, 69, 0.12);
  color: #276747;
  border: 1px solid rgba(0, 140, 69, 0.18);
}

.badge.pending,
.badge.warn {
  background: #fff0d8;
  color: var(--warn);
}

.badge.decision {
  background: var(--accent-soft);
  color: var(--danger);
  border: 1px solid rgba(205, 33, 42, 0.18);
}

.badge.time-badge {
  background: var(--time);
  color: #2b2118;
  border: 1px solid #d7ab00;
  box-shadow: 0 0 0 2px rgba(255, 212, 0, 0.22);
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.date-block {
  border-right: 1px solid var(--line);
  padding-right: 12px;
}

.date-block strong {
  display: block;
  font-size: 18px;
}

.detail-list {
  display: grid;
  gap: 9px;
  margin: 0;
}

.detail-list div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 8px;
}

.detail-list dt {
  color: var(--muted);
  font-weight: 700;
}

.detail-list dd {
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 800px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.full-span {
  grid-column: 1 / -1;
}

.form-grid > label,
.form-grid > fieldset {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
}

.form-grid > label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.form-grid > label:focus-within,
.form-grid > fieldset:focus-within {
  border-color: rgba(202, 21, 21, 0.35);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(202, 21, 21, 0.08);
}

.form-grid > label > .muted,
.form-grid > label .muted {
  color: #78675d;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  text-transform: none;
  letter-spacing: 0;
}

.form-grid > label:has(input[type="hidden"]) {
  display: none;
}

.form-grid > label.check-option {
  flex-direction: row;
  align-items: flex-start;
  color: var(--ink);
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
}

.form-grid > label.check-option input {
  margin-top: 2px;
}

.traveler-flight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.transport-route-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.traveler-flight-column,
.transport-route-column {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
}

.traveler-flight-column legend,
.transport-route-column legend {
  padding: 0 6px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.traveler-flight-column label,
.transport-route-column label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.traveler-flight-column label:focus-within,
.transport-route-column label:focus-within {
  border-color: rgba(202, 21, 21, 0.35);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(202, 21, 21, 0.08);
}

label {
  display: grid;
  gap: 6px;
  align-content: start;
  align-self: start;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink);
  padding: 10px;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.check-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  align-items: start;
}

.check-grid.compact {
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.detail-choice-grid,
.split-option-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: stretch;
}

.check-option {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  min-width: 0;
}

.check-option span {
  min-width: 0;
}

.check-option input {
  width: auto;
}

.upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #d8d0c5;
  border-radius: 7px;
  background: var(--grey);
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.upload-button input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.pending-document-list {
  display: grid;
  gap: 8px;
}

.pending-document-list .document-row {
  background: #fff9f6;
}

.expense-status-stack {
  display: grid;
  gap: 7px;
}

.expense-status-line {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: start;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
}

.expense-status-line span:first-child {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.expense-status-line .badge {
  justify-self: start;
  max-width: 100%;
  white-space: normal;
  text-align: left;
  overflow-wrap: anywhere;
}

.expense-status-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.share-card-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}

.payment-status-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.expense-actions-stack {
  display: grid;
  gap: 10px;
  align-items: start;
}

.expense-actions-stack > .ghost,
.expense-actions-stack .inline-actions {
  justify-self: start;
}

.expense-record-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.expense-record-card {
  display: grid;
  grid-template-rows: auto auto minmax(42px, 1fr) auto auto;
  gap: 12px;
  align-content: stretch;
}

.expense-record-card.selected {
  border-color: rgba(0, 140, 69, 0.42);
  box-shadow: inset 4px 0 0 var(--italy-green);
}

.expense-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.expense-card-header h4 {
  margin: 8px 0 2px;
}

.expense-card-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  align-items: stretch;
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.expense-card-actions .payment-workflow-actions {
  display: contents;
}

.expense-card-actions button,
.expense-card-actions .upload-button {
  width: 100%;
  min-width: 0;
}

.expense-card-actions .upload-button {
  position: relative;
}

.expense-card-notes {
  margin: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.expense-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
  margin: 0;
}

.expense-summary-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
  padding: 10px;
}

.expense-summary-grid dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.expense-summary-grid dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.expense-detail-panel.empty {
  border-style: dashed;
  background: #fffdf9;
}

.expense-detail-panel {
  border-color: rgba(0, 140, 69, 0.26);
}

.expense-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.3fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}

.expense-detail-hero h3 {
  margin: 8px 0 4px;
}

.expense-amount-callout {
  display: grid;
  align-content: center;
  gap: 6px;
  border: 1px solid rgba(0, 140, 69, 0.32);
  border-radius: 8px;
  background: #f7fff9;
  padding: 16px;
}

.expense-amount-callout span,
.expense-amount-callout small {
  color: var(--muted);
  font-weight: 850;
  text-transform: uppercase;
}

.expense-amount-callout strong {
  color: var(--italy-green);
  font-size: 26px;
  line-height: 1.05;
}

.expense-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  gap: 18px;
  align-items: start;
}

.expense-detail-main,
.expense-payment-guide {
  display: grid;
  gap: 12px;
}

.expense-payment-guide {
  border: 1px solid rgba(202, 21, 21, 0.2);
  border-radius: 8px;
  background: #fff9f6;
  padding: 14px;
}

.expense-payment-guide .payment-workflow-actions button {
  width: 100%;
}

.payment-workflow-actions .payment-sent-action {
  border-color: rgba(41, 112, 255, 0.55);
  background: #2f6fed;
  color: white;
}

.payment-workflow-actions .payment-sent-action:hover {
  background: #174a9f;
}

.payment-status-due {
  border: 1px solid rgba(202, 21, 21, 0.55);
  background: var(--danger);
  color: white;
}

.payment-status-submitted {
  border: 1px solid rgba(41, 112, 255, 0.45);
  background: #e6f0ff;
  color: #174a9f;
}

.payment-status-received {
  border: 1px solid rgba(0, 140, 69, 0.28);
  background: rgba(0, 140, 69, 0.12);
  color: #276747;
}

.payment-status-not-due {
  border: 1px solid var(--line);
  background: #f4eee5;
  color: var(--muted);
}

.inbound-payment-panel {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
}

.inbound-payment-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr);
  gap: 8px;
  align-items: start;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.inbound-payment-name {
  min-width: 0;
  color: var(--ink);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.inbound-payment-amount {
  color: var(--accent-2);
  font-weight: 850;
}

.inbound-payment-action {
  display: flex;
  justify-content: flex-start;
}

.inbound-payment-row button {
  min-height: 34px;
  padding: 0 10px;
}

.inbound-payment-row .payment-status-flag {
  justify-self: start;
  white-space: normal;
  text-align: center;
}

textarea {
  min-height: 120px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
}

.traveler-social-field textarea {
  min-height: 74px;
  overflow: hidden;
  resize: none;
  font-family: inherit;
  font-size: 14px;
}

.location-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.accordion-list {
  display: grid;
  gap: 10px;
}

summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.calendar-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.calendar-grid {
  display: grid;
  gap: 8px;
}

.calendar-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}

.calendar-filter-bar legend {
  flex: 0 0 100%;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.calendar-filter-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.calendar-filter-option.active {
  border-color: rgba(202, 21, 21, 0.45);
  background: #fff7f2;
}

.calendar-filter-option input {
  width: auto;
  accent-color: var(--accent);
}

.calendar-filter-option small {
  color: var(--muted);
  font-weight: 800;
}

.calendar-grid.month {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-grid.week {
  grid-template-columns: repeat(7, minmax(180px, 1fr));
  overflow-x: auto;
}

button.ghost.calendar-return-month {
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 0 0 14px;
  border-color: #1f5fbf;
  background: #2f6fed;
  color: white;
  font-size: 15px;
  font-weight: 850;
}

.calendar-day button.ghost.calendar-return-month:last-child {
  margin: 16px 0 0;
}

.calendar-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.calendar-cell {
  min-height: 126px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 9px;
}

.calendar-cell.muted-cell {
  background: var(--tan-light);
  color: var(--muted);
}

.calendar-item {
  display: block;
  width: 100%;
  min-height: 0;
  margin-top: 6px;
  padding: 5px 7px;
  border-radius: 6px;
  background: #f5e6e4;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.25;
  text-align: left;
}

.calendar-static {
  cursor: default;
}

.source-highlight {
  outline: 3px solid rgba(202, 21, 21, 0.35);
  outline-offset: 4px;
}

button.calendar-item {
  border: 1px solid #efc8c3;
}

.calendar-type-flight {
  background: #e6f0ff;
  border-color: #9fc1f5 !important;
}

.calendar-type-lodging {
  background: #e9f7ed;
  border-color: #9bd2aa !important;
}

.calendar-type-event {
  background: #ffe9e9;
  border-color: #f0a3a3 !important;
}

.calendar-type-car,
.calendar-type-train,
.calendar-type-transportation {
  background: #fff3d6;
  border-color: #eac35e !important;
}

.calendar-type-meal {
  background: #fff0e4;
  border-color: #f0aa6d !important;
}

.calendar-type-reminder {
  background: #e9f7f7;
  border-color: #81c7c8 !important;
}

.calendar-type-other {
  background: #f4eafd;
  border-color: #c5a0e8 !important;
}

.calendar-type-arrival,
.calendar-type-departure {
  background: #ede9ff;
  border-color: #b9abef !important;
}

.calendar-type-group-plan,
.calendar-type-overview,
.calendar-type-calendar {
  background: #f1eee8;
  border-color: #d5c9b8 !important;
}

.calendar-entry {
  border-left-width: 6px;
}

.calm-hero-card,
.support-card {
  background: linear-gradient(135deg, #fff, #fff7f2);
}

.dashboard-home-card,
.daily-lesson-card,
.ask-via-card {
  border-color: #d8c0a5;
  background: linear-gradient(135deg, #fffaf4, #fff7f2);
}

.dashboard-command-center .card {
  align-self: start;
}

.dashboard-section {
  display: grid;
  gap: 14px;
}

.dashboard-section.full {
  grid-column: 1 / -1;
}

.dashboard-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.dashboard-learning-crew-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.82fr);
  gap: 18px;
  align-items: start;
}

.dashboard-learning-stack {
  display: grid;
  gap: 18px;
}

.dashboard-learning-stack .card,
.dashboard-learning-stack .card.wide,
.dashboard-crew-card {
  grid-column: auto;
}

.dashboard-crew-card {
  border-color: #9bd2aa;
  background: linear-gradient(135deg, #f7fff9, #fffdf9);
}

.dashboard-crew-preview {
  display: grid;
  gap: 12px;
  margin: 14px 0;
}

.dashboard-crew-person {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 12px;
}

.dashboard-crew-person h4 {
  margin: 0 0 3px;
}

.dashboard-crew-person p {
  margin: 4px 0 0;
}

.dashboard-crew-person .crew-photo {
  width: 56px;
  height: 56px;
}

.dashboard-today-panel {
  border-color: #d8c0a5;
  background: linear-gradient(135deg, #fffaf4, #ffffff);
}

.dashboard-today-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.dashboard-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.dashboard-today-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.75fr) minmax(0, 1.25fr);
  gap: 18px;
  align-items: stretch;
}

.weather-summary,
.today-items-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 16px;
}

.weather-summary {
  border-left: 6px solid #9bd2aa;
  background: #f7fff9;
}

.weather-summary h4,
.today-items-card h4 {
  margin: 6px 0;
}

.weather-reading {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
  margin: 8px 0 12px;
}

.weather-reading strong {
  color: var(--accent-2);
  font-size: 34px;
  line-height: 1;
}

.weather-reading span {
  color: var(--ink);
  font-weight: 850;
}

.weather-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.weather-facts div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 9px;
}

.weather-facts dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.weather-facts dd {
  margin: 3px 0 0;
  color: var(--ink);
  font-weight: 850;
}

.dashboard-day-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.ask-via-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.ask-via-form textarea {
  min-height: 92px;
}

.ask-via-response {
  margin-top: 12px;
  border: 1px solid #ead6cd;
  border-radius: 8px;
  background: white;
  padding: 12px;
  color: var(--accent-2);
  font-weight: 750;
}

.ask-via-response:empty {
  display: none;
}

.ask-via-guardrails {
  margin-top: 12px;
}

.ask-via-guardrails summary {
  cursor: pointer;
  font-weight: 850;
  color: var(--accent);
}

.offline-pdf-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border-color: rgba(0, 140, 69, 0.35);
  background: #f7fff9;
  box-shadow: inset 4px 0 0 var(--italy-green);
}

.pdf-action {
  border-color: var(--italy-green);
  background: var(--italy-green);
  color: white;
  font-weight: 850;
  min-height: 48px;
  padding-inline: 18px;
}

.pdf-action:hover {
  background: #006d37;
}

.checklist-list {
  display: grid;
  gap: 12px;
}

.checklist-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 14px;
}

.checklist-item.needs {
  border-color: var(--accent);
  background: #fff4f2;
  box-shadow: inset 4px 0 0 var(--accent);
}

.checklist-item h4 {
  margin: 8px 0 4px;
}

.action-needed,
button.ghost.action-needed {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.urgent-task {
  border-width: 2px;
}

.time-zone-note {
  border-left: 4px solid #9fc1f5;
  background: #f4f8ff;
  padding: 10px 12px;
  border-radius: 6px;
}

.document-guidance {
  margin-bottom: 14px;
}

.document-list {
  display: grid;
  gap: 8px;
}

.document-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(120px, auto) auto auto;
  gap: 8px;
  align-items: center;
}

.rsvp-box {
  margin-top: 12px;
  border: 1px solid #ead6cd;
  border-radius: 8px;
  background: #fff9f6;
  padding: 12px;
}

.payment-card {
  border-color: #e5d4c7;
}

.guest-focused .table-wrap {
  overflow-x: visible;
}

.guest-focused table {
  min-width: 0;
}

.split-detail-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 12px;
  align-items: center;
  box-sizing: border-box;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.split-option-grid .split-detail-option {
  width: 100%;
}

.split-detail-option > label:first-child {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  min-width: 0;
}

.inline-field {
  display: grid;
  gap: 4px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  min-width: 0;
}

.inline-field input {
  width: 100%;
}

.calendar-more {
  width: 100%;
  min-height: 30px;
  margin-top: 6px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: #fffdfb;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
  padding: 5px 8px;
  text-align: left;
}

.calendar-more:hover {
  background: #fff5ee;
  border-color: rgba(202, 21, 21, 0.28);
}

.calendar-day,
.calendar-all-day {
  display: grid;
  gap: 10px;
}

.calendar-detail-panel {
  margin-top: 14px;
  background: #fff9f6;
}

.calendar-entry h4 {
  margin: 6px 0;
}

.timeline.compact {
  gap: 8px;
}

.mini-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 14px;
}

.mini-card h4 {
  margin: 0 0 8px;
}

.crash-course .card {
  align-self: start;
}

.crash-intro-card,
.crash-note-card {
  border-color: #d8c0a5;
  background: linear-gradient(135deg, #fffaf4, #f7eadc);
}

.phrase-grid,
.culture-grid,
.logistics-grid,
.american-misreads,
.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.phrase-card,
.american-misreads section,
.logistics-tip,
.course-row,
.coffee-grid section,
.crash-note,
.lesson-card,
.lesson-email-note,
.lesson-challenge {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 14px;
}

.phrase-card {
  display: grid;
  gap: 8px;
  border-left: 5px solid var(--accent);
}

.phrase-card h4 {
  margin: 0;
  font-size: 18px;
}

.phrase-card p {
  margin: 0;
}

.phrase-pronunciation {
  color: var(--accent-2);
  font-weight: 850;
}

.course-list,
.coffee-grid,
.clean-list {
  display: grid;
  gap: 10px;
}

.course-row,
.coffee-grid section,
.american-misreads section {
  display: grid;
  gap: 5px;
}

.course-row {
  grid-template-columns: 120px minmax(0, 1fr);
}

.clean-list {
  margin: 0;
  padding-left: 18px;
}

.clean-list li {
  padding-left: 3px;
}

.culture-tip {
  background: #fffdf9;
}

.daily-lessons-section {
  border-color: #d8c0a5;
}

.today-lesson-highlight {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.6fr);
  gap: 14px;
  align-items: stretch;
  margin: 14px 0;
  border: 1px solid #ead6cd;
  border-radius: 8px;
  background: #fff9f6;
  padding: 16px;
}

.today-lesson-highlight h4 {
  margin: 8px 0 4px;
  font-size: 22px;
}

.lesson-challenge {
  display: grid;
  align-content: center;
  gap: 8px;
  border-color: #d8c0a5;
  background: #fffdf9;
}

.lesson-email-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 14px;
  background: #f7fff9;
  border-color: #bad7c0;
}

.lesson-phase-list {
  display: grid;
  gap: 12px;
}

.lesson-phase {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
  padding: 10px;
}

.lesson-phase summary {
  cursor: pointer;
  color: var(--accent-2);
  font-weight: 900;
}

.lesson-grid {
  margin-top: 12px;
}

.lesson-card.current {
  border-color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent);
}

.lesson-card h4 {
  margin: 8px 0 4px;
}

.lesson-try {
  color: var(--accent-2);
}

.culture-tip p {
  margin-bottom: 0;
}

.coffee-card {
  background: #fffaf4;
}

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

.crash-note {
  margin-top: 12px;
  border-color: #d7c3a6;
  background: #fbf1e3;
}

.logistics-tip {
  background: #f8f4ed;
}

.american-misreads section {
  border-left: 5px solid var(--accent-2);
}

.foundation-guide .card {
  align-self: start;
}

.foundation-intro-card,
.foundation-voices-card,
.foundation-gathering-card,
.foundation-theatre-card,
.foundation-source-card {
  border-color: rgba(0, 146, 70, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(250, 244, 234, 0.9)),
    linear-gradient(90deg, rgba(0, 146, 70, 0.12), rgba(255, 255, 255, 0), rgba(206, 43, 55, 0.1));
}

.foundation-intro-card {
  position: relative;
  overflow: hidden;
}

.foundation-intro-card::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 120px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--italy-green) 0 33%, white 33% 66%, var(--italy-red) 66% 100%);
  border: 1px solid rgba(0, 0, 0, 0.08);
  opacity: 0.86;
}

.foundation-pullout,
.foundation-quote {
  margin: 16px 0;
  border-left: 5px solid var(--italy-green);
  background: rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
  padding: 16px;
}

.foundation-quote {
  border-left-color: var(--italy-red);
  font-size: 19px;
}

.foundation-mini-list,
.foundation-timeline,
.foundation-location-grid,
.foundation-project-grid {
  display: grid;
  gap: 12px;
}

.foundation-mini-list section,
.foundation-timeline section,
.foundation-location-grid section,
.foundation-project {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  padding: 14px;
}

.foundation-mini-list section,
.foundation-timeline section {
  display: grid;
  gap: 5px;
}

.foundation-location-grid,
.foundation-project-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 14px;
}

.foundation-location-grid section {
  border-top: 4px solid var(--italy-green);
}

.foundation-location-grid h4,
.foundation-project h4 {
  margin: 0 0 8px;
}

.foundation-location-grid p,
.foundation-project p {
  margin-bottom: 0;
}

.foundation-stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.foundation-stat-strip div {
  border: 1px solid rgba(0, 146, 70, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  padding: 14px;
}

.foundation-stat-strip strong {
  display: block;
  color: var(--accent);
  font-size: 24px;
}

.foundation-stat-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.foundation-timeline section {
  border-left: 5px solid var(--italy-red);
}

.foundation-list li {
  padding-bottom: 6px;
}

.foundation-links {
  align-items: stretch;
}

.foundation-links .source-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 10px 12px;
}

.travel-agent-guide .card {
  align-self: start;
}

.travel-agent-intro-card,
.travel-agent-access-card {
  border-color: rgba(0, 146, 70, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(250, 244, 234, 0.9)),
    linear-gradient(90deg, rgba(0, 146, 70, 0.12), rgba(255, 255, 255, 0), rgba(206, 43, 55, 0.08));
}

.travel-agent-hero-layout {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.travel-agent-photo {
  width: 160px;
  height: 160px;
  border: 4px solid white;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(30, 30, 30, 0.16);
  object-fit: cover;
}

.travel-agent-pullout {
  margin: 16px 0;
  border-left: 5px solid var(--italy-green);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.28;
  padding: 16px;
}

.travel-agent-service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.travel-agent-service-grid .mini-card {
  border-top: 4px solid var(--italy-green);
}

.travel-agent-contact-card .detail-list div {
  grid-template-columns: minmax(82px, 118px) minmax(0, 1fr);
}

.travel-agent-contact-card .detail-list dd,
.travel-agent-contact-card .detail-list a {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.traveler-photo {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f0eee8;
  margin-bottom: 14px;
}

.traveler-photo.placeholder {
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 42px;
  font-weight: 800;
}

.crew-grid {
  align-items: stretch;
}

.crew-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px 14px;
  align-items: start;
  grid-template-rows: 1fr auto;
}

.crew-photo {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f0eee8;
}

.crew-photo.no-photo {
  display: none;
}

.crew-card-body {
  min-width: 0;
}

.crew-card h4 {
  margin-top: 0;
}

.crew-card > button {
  grid-column: 2;
  justify-self: start;
  align-self: end;
  margin-top: 2px;
}

.bio-preview {
  margin-bottom: 0;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.social-profile-card {
  border-color: #d8c0a5;
  background: #fffdf9;
}

.form-section-note {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.form-section-note h4 {
  margin: 0 0 4px;
}

.crew-card .traveler-link {
  grid-column: 1 / -1;
  justify-self: start;
}

.result-box {
  margin-top: 14px;
  border: 1px solid #e6c8bf;
  background: #fff7f2;
  border-radius: 8px;
  padding: 14px;
}

.status-box {
  border-color: #9bd2aa;
  background: #f2fbf4;
}

.active-choice,
button.ghost.active-choice {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

.bug-alert {
  border-color: #e4bbb6;
  background: #fff8f7;
}

.preserve-lines {
  white-space: pre-line;
}

.guest-shell {
  display: grid;
  gap: 14px;
}

.guest-hero {
  min-height: 220px;
  display: flex;
  align-items: end;
  padding: 24px;
  border-radius: 8px;
  color: white;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0.62)),
    url("https://images.unsplash.com/photo-1516483638261-f4dbaf036963?auto=format&fit=crop&w=1800&q=80") center/cover;
}

.guest-hero h2 {
  margin: 0;
  font-size: 34px;
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
  }

  main {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 62px);
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    padding: 8px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 22px rgba(78, 56, 43, 0.08);
  }

  .sidebar > div {
    display: none;
  }

  nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .nav-button {
    justify-content: center;
    min-height: 44px;
    padding: 7px 4px;
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.72);
    font-size: 11px;
    line-height: 1.1;
    text-align: center;
    order: var(--mobile-order, 100);
  }

  .mobile-more-toggle {
    display: flex;
    background: var(--accent);
    color: white;
    border-color: var(--accent);
  }

  .mobile-menu-greeting {
    display: none;
  }

  .mobile-secondary {
    display: none;
  }

  nav.mobile-expanded {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  nav.mobile-expanded .mobile-more-toggle {
    display: none;
  }

  nav.mobile-expanded .mobile-menu-greeting {
    display: block;
    grid-column: 1 / -1;
    padding: 13px 14px;
    border-radius: 8px;
    background: var(--accent-2);
    color: white;
    font-size: 18px;
    font-weight: 850;
    text-align: center;
    order: 0;
  }

  nav.mobile-expanded .mobile-secondary,
  .mobile-active-secondary {
    display: flex;
  }

  .mobile-active-secondary:not(.mobile-priority) {
    grid-column: 1 / -1;
    min-height: 38px;
    background: white;
    font-size: 13px;
  }

  nav.mobile-expanded .mobile-active-secondary:not(.mobile-priority) {
    grid-column: auto;
  }

  .topbar {
    display: contents;
  }

  .topbar-heading {
    position: sticky;
    top: 62px;
    z-index: 5;
    order: 0;
    min-height: auto;
    padding: 10px 12px;
    background: rgba(251, 250, 247, 0.94);
    border-bottom: 1px solid var(--line);
    box-shadow: inset 0 -3px 0 var(--italy-green), inset 0 -6px 0 #ffffff, inset 0 -9px 0 var(--italy-red);
    backdrop-filter: blur(12px);
  }

  .topbar .eyebrow {
    display: none;
  }

  .topbar h2 {
    font-size: 18px;
  }

  .top-actions {
    order: 99;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 8px 16px 24px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 8px 22px rgba(78, 56, 43, 0.08);
  }

  .top-actions button {
    min-height: 40px;
    padding: 0 10px;
    white-space: nowrap;
  }

  .page-photo-hero,
  .guest-hero {
    display: none;
  }

  .calendar-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-grid.month {
    grid-template-columns: 1fr;
  }

  .calendar-grid.month .calendar-head,
  .calendar-grid.month .muted-cell {
    display: none;
  }

  .calendar-grid.month .calendar-cell {
    min-height: 0;
    border-radius: 8px;
    background: white;
  }

  .calendar-grid.month .calendar-cell:not(:has(.calendar-item)):not(:has(.calendar-static)):not(:has(.calendar-more)) {
    display: none;
  }

  .calendar-grid.month .calendar-cell > strong {
    display: block;
    margin-bottom: 8px;
    color: var(--accent-2);
    font-size: 14px;
  }

  .calendar-grid.month .calendar-item,
  .calendar-grid.month .calendar-static {
    width: 100%;
    margin-top: 6px;
    white-space: normal;
  }

  .task-dashboard-card {
    border-color: var(--accent);
    box-shadow: 0 10px 26px rgba(202, 21, 21, 0.1);
  }

  .action-needed,
  button.ghost.action-needed {
    min-height: 46px;
    font-weight: 850;
  }

  .offline-pdf-card {
    grid-template-columns: 1fr;
  }

  .offline-pdf-card .pdf-action {
    width: 100%;
  }

  .expense-card-header,
  .expense-detail-hero,
  .expense-detail-layout {
    grid-template-columns: 1fr;
  }

  .expense-card-header > button,
  .expense-card-actions button,
  .expense-card-actions .upload-button {
    width: 100%;
  }

  .today-lesson-highlight,
  .lesson-email-note,
  .dashboard-today-header,
  .dashboard-today-grid,
  .dashboard-two-column,
  .dashboard-learning-crew-grid,
  .dashboard-day-item {
    grid-template-columns: 1fr;
  }

  .dashboard-metrics {
    justify-content: flex-start;
  }

  .dashboard-day-item button {
    width: 100%;
  }

  #content {
    order: 1;
    flex: 1 0 auto;
    padding: 16px;
  }

  .card,
  .card.wide {
    grid-column: 1 / -1;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .date-block {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 10px;
  }

  .detail-list div,
  .form-grid,
  .traveler-flight-grid,
  .transport-route-grid,
  .course-row,
  .coffee-grid,
  .travel-agent-hero-layout,
  .travel-agent-contact-card .detail-list div,
  .foundation-stat-strip {
    grid-template-columns: 1fr;
  }

  .travel-agent-photo {
    width: 132px;
    height: 132px;
  }

  .foundation-pullout,
  .foundation-quote {
    font-size: 18px;
  }

  .form-grid {
    gap: 10px;
  }

  .form-grid > label,
  .form-grid > fieldset {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
  }

  .form-grid > label:has(input[type="hidden"]) {
    padding: 0;
    border: 0;
    background: transparent;
  }

  input,
  select,
  textarea {
    min-height: 44px;
    font-size: 16px;
  }

  textarea {
    min-height: 96px;
  }
}

@media (max-width: 520px) {
  nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .top-actions {
    grid-template-columns: 1fr;
  }

  .top-actions button {
    width: 100%;
  }

  .checklist-item {
    grid-template-columns: 1fr;
  }

  .split-detail-option {
    grid-template-columns: 1fr;
  }

  .document-row {
    grid-template-columns: 1fr;
  }

  .inbound-payment-row {
    grid-template-columns: 1fr;
  }

  .inbound-payment-row button {
    width: 100%;
  }

  .checklist-item button,
  .rsvp-box button {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .table-wrap:has(.mobile-card-table) {
    overflow-x: visible;
  }

  .mobile-card-table,
  .mobile-card-table tbody,
  .mobile-card-table tr,
  .mobile-card-table td {
    display: block;
    width: 100%;
  }

  .mobile-card-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 12px;
  }

  .mobile-card-table thead {
    display: none;
  }

  .mobile-card-table tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    padding: 10px;
  }

  .mobile-card-table td {
    border-bottom: 1px solid #f0e5dc;
    padding: 10px 0;
  }

  .mobile-card-table td:last-child {
    border-bottom: 0;
  }

  .mobile-card-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
  }
}
