/* v1 shell: header, profile chip, tabs. Colours and type match the snapshot. */
.app-shell {
  margin: 0 auto;
  padding: 12px 16px 40px;
}
.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 16px 40px;
}
.app-shell .page-shell {
  max-width: none;
  margin: 0;
  padding: 0;
}
.page-title {
  margin: 0 0 10px;
  padding: 0 2px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.section-title {
  margin: 12px 0 8px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.sub-title {
  margin: 16px 0 8px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}
.app-shell.is-guest {
  max-width: 440px;
  padding: 10px 0 48px;
}
.app-shell.is-guest .topbar {
  margin-bottom: 12px;
  padding: 0 16px;
}
.tier-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 4px;
}
.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 40px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding: 8px 0 4px;
}
.brand-lockup {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 10px;
}
.brand-word {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
}
.brand-plan {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  line-height: 1;
  color: var(--muted);
}
.topbar:has(.brand-lockup) .brand.greet {
  font-size: 14px;
  font-weight: 500;
}
.brand {
  font-size: 28px;
  margin: 0;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.brand.greet {
  font-size: 26px;
  font-weight: 500;
}
.sub {
  color: var(--muted);
  margin: 4px 0 0;
}
.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
}
.profile-slot {
  position: relative;
  justify-content: flex-end;
}
.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.chip-name {
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.profile-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--pine);
  display: grid;
  place-items: center;
  color: inherit;
  text-decoration: none;
  flex: 0 0 auto;
}
a.profile-mark {
  cursor: pointer;
}
[data-profile-switch] {
  flex: 0 0 auto;
}
.profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: min(260px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  box-shadow: var(--shadow);
}
.profile-group {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.profile-kicker {
  margin: 0 0 4px;
  font-weight: 700;
}
.mark-row {
  display: flex;
  gap: 8px;
  margin: 8px 0 10px;
}
.mark-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--paper);
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.mark-btn.is-on {
  border-color: var(--clay);
  background: var(--chip-on);
}
.profile-choice {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
  font: inherit;
}
.profile-choice.is-on,
.profile-choice:hover {
  background: var(--chip-on);
}
.search-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  margin: 0 0 14px;
}
.search-panel input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}
.search-results {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 0;
}
.search-hit {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 0;
  background: var(--cal-head);
  color: inherit;
  font: inherit;
  padding: 10px 12px;
  margin-top: 8px;
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
}
.search-hit:hover {
  background: var(--lilac);
}
.search-hit span {
  color: var(--muted);
  font-size: 13px;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--card);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  max-width: 100%;
}
.nav button,
.nav a,
.app-shell .btn {
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
}
.nav button,
.nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav button.active,
.nav a.active,
.tier-bar .nav button.is-on {
  background: var(--mark-blue);
  color: #000;
}
.app-shell .btn.primary {
  background: var(--mark-blue);
  color: #000;
}
.app-shell .btn.danger {
  background: var(--clay);
  color: #000;
}
.app-shell .btn.ghost {
  border: 1px solid var(--line);
  background: var(--card);
}
.subnav {
  margin: 0 0 18px;
}
.staff-page .topbar {
  margin-bottom: 8px;
}

.staff-page .brand {
  color: var(--pine);
}

.staff-page .subnav {
  margin: 8px 0 18px;
}
.host-sticky {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--paper);
  padding: 0;
}
.host-toolbar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}
.host-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.host-pages {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 22px;
  width: 100%;
}
.host-pages > a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}
.nav-house {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.nav-sub {
  background: #fff;
}
.house-tabs-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  margin: 0 0 8px;
}
.house-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}
.house-tab {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 14px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  max-width: 100%;
  height: auto;
  word-break: break-word;
}
.house-tab.active {
  background: var(--mark-blue);
  color: #000;
  border-color: transparent;
}
.name-edit {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.name-edit input {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  background: #fff;
}
.reason {
  color: var(--muted);
  margin: 4px 0 0;
}
.shell-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.shell-body > :first-child :is(h1, h2):first-child {
  margin-top: 0;
}

.view-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.view-switch button {
  border: 1px solid var(--line);
  background: var(--card, #fff);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  min-height: 36px;
  font: inherit;
  cursor: pointer;
}
.view-switch button.is-on {
  background: var(--ink);
  color: var(--card, #fff);
}
.view-frame {
  display: block;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card, #fff);
}
.view-frame.is-portrait {
  width: 390px;
  height: 844px;
  max-width: 100%;
}
.view-frame.is-landscape {
  width: 844px;
  height: 390px;
  max-width: 100%;
}

@media (max-height: 500px) {
  .host-toolbar {
    gap: 4px;
    margin-bottom: 0;
  }
}

@media (max-width: 640px) {
  .app-shell,
  .page-shell {
    padding: 12px 12px 32px;
  }
  .house-tabs {
    flex-wrap: wrap;
    overflow: visible;
  }
  .house-tab {
    white-space: normal;
    max-width: 100%;
  }
  .topbar,
  .tier-bar,
  .top-actions {
    align-items: flex-start;
  }
  .profile-menu {
    right: auto;
    left: 0;
  }
}

.phone-band,
.phone-band-row {
  display: contents;
}

.cal-shift {
  display: none;
}

.phone-band-name {
  display: none;
}

@media (max-width: 640px) and (orientation: portrait) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }
  .top-actions {
    align-items: stretch;
    justify-content: stretch;
    width: 100%;
  }
  .top-actions > .profile-chip,
  .top-actions > .view-switch,
  .top-actions > .account-slot {
    flex: 1 1 100%;
    min-width: 0;
  }
  .top-actions > .btn {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
  }
  .view-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    width: auto;
    justify-content: flex-start;
  }
  .view-switch button {
    width: auto;
    min-height: 0;
    padding: 1px 7px;
    font-size: 11px;
    line-height: 1.3;
    text-align: center;
    white-space: nowrap;
  }
  .account-slot > .btn {
    width: 100%;
    text-align: center;
  }
  .host-sticky .nav {
    box-sizing: border-box;
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }
  .host-sticky .nav a,
  .host-pages > a.active {
    flex: none;
    height: auto;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.25;
    padding: 2px 6px;
  }

  .topbar {
    gap: 6px;
    margin-bottom: 8px;
    padding: 0;
  }

  .site-hero h2 {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
  }

  .site-kicker,
  .site-hero .site-line {
    font-size: 8px;
    font-weight: 400;
    line-height: 1.25;
  }

  .brand-word {
    font-size: 22px;
  }

  .brand.greet {
    font-size: 12px;
  }

  .topbar:has(.brand-lockup) .brand.greet {
    font-size: 12px;
  }

  .sub {
    margin: 0;
    font-size: 12px;
  }

  .todo-jump {
    margin-top: 4px;
    padding: 1px 8px;
    font-size: 12px;
  }

  .profile-mark {
    width: 26px;
    height: 26px;
  }

  .chip-name {
    font-size: 14px;
  }

  .top-actions {
    gap: 4px;
  }

  .top-actions > .btn,
  .account-slot > .btn,
  .date-nav .btn,
  .house-tabs-bar > .btn {
    font-size: 12px;
    line-height: 1.2;
    min-height: 0;
    padding: 3px 8px;
    white-space: nowrap;
  }

  .date-nav .btn,
  .house-tabs-bar > .btn {
    padding: 5px 10px;
  }

  .host-toolbar,
  .host-nav {
    width: 100%;
    align-items: stretch;
  }

  .host-sticky .nav {
    gap: 4px;
    padding: 8px 9px;
    border-radius: 12px;
  }

  .host-nav:has(.nav-sub) {
    gap: 0;
    align-items: stretch;
  }

  .host-nav:has(.nav-sub) > .nav:not(.nav-sub) {
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
  }

  .host-sticky .nav-sub {
    margin: 0;
    padding: 6px 8px;
    gap: 4px;
    background: var(--cal-head);
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 16px 16px;
    box-shadow: inset 0 1px 0 var(--line);
  }

  .host-sticky .nav-sub a,
  .host-sticky .nav-sub .btn {
    min-height: 0;
    padding: 3px 8px;
    border: 0;
    background: transparent;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
  }

  .host-sticky .nav-sub a.active {
    background: var(--mark-blue);
  }

  .host-toolbar:has(.date-nav) {
    gap: 0;
    align-items: stretch;
    width: 100%;
  }

  .host-toolbar:has(.date-nav) > .host-nav,
  .host-toolbar:has(.date-nav) > .host-nav > .nav {
    width: 100%;
  }

  .host-toolbar:has(.date-nav) > .host-nav > .nav {
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
  }

  .host-sticky:has(.date-nav) {
    padding-bottom: 8px;
  }

  .date-nav {
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    width: 100%;
    margin: 0;
    padding: 6px 8px;
    background: var(--cal-head);
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 16px 16px;
    box-shadow: inset 0 1px 0 var(--line);
    box-sizing: border-box;
  }

  .date-nav strong {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
  }

  .date-nav .btn {
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
  }

  .house-tabs-bar {
    gap: 8px;
    margin: 6px 0 0;
  }

  .house-tabs-bar .house-tabs {
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
    gap: 6px;
  }

  .house-tabs-bar .house-tab {
    flex: 0 0 auto;
    max-width: none;
    width: auto;
    height: auto;
    font-size: 12px;
    line-height: 1.2;
    padding: 5px 10px;
    white-space: nowrap;
    word-break: normal;
    overflow: visible;
  }

  .shell-body {
    gap: 8px;
  }

  .phone-band {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px;
    padding: 2px 4px;
    border-radius: 4px;
    background: var(--card);
    border-left: 3px solid var(--line);
  }

  .phone-band.is-clean {
    border-left-color: var(--lilac);
  }
  .phone-band.is-check {
    border-left-color: var(--pine);
  }
  .phone-band.is-done {
    border-left-color: var(--olive);
  }
  .phone-band.is-people {
    border-left-color: var(--stayover);
  }
  .phone-band.is-notice {
    border-left-color: var(--pink);
  }

  .phone-band-row {
    display: flex;
    gap: 3px;
    align-items: stretch;
  }

  .phone-band-row > .phone-band {
    flex: 1;
    min-width: 0;
  }

  .phone-band-name {
    display: inline;
    color: var(--ink);
    font-size: 8px;
    font-weight: 700;
    line-height: 1.2;
  }

  .phone-band.is-people .phone-band-name {
    font-weight: 400;
  }

  .phone-band .house-tab,
  .phone-band .cln-book-sort > summary,
  .phone-band .cal-filters button,
  .phone-band .cal-person {
    padding: 0 3px;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: var(--card);
    color: var(--ink);
    font-size: 8px;
    font-weight: 400;
    line-height: 1.25;
  }

  .phone-band .house-tab.active,
  .phone-band .cal-filters button.is-on {
    background: var(--paper);
    border-color: var(--ink);
    color: var(--ink);
  }

  body:has(.app-shell[data-shell="host"]) {
    background: var(--card);
  }

  .app-shell[data-shell="host"] .host-sticky {
    box-sizing: border-box;
    width: calc(100% + 24px);
    margin-left: -12px;
    margin-right: -12px;
    padding-left: 12px;
    padding-right: 12px;
    background: var(--card);
  }

  .app-shell[data-shell="host"] .host-sticky .nav {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .app-shell[data-shell="host"] .host-sticky .nav a,
  .app-shell[data-shell="host"] .host-sticky .nav a.active,
  .app-shell[data-shell="host"] .host-sticky .nav-sub a.active {
    background: transparent;
    color: var(--ink);
    border-radius: 0;
  }

  .app-shell[data-shell="host"] .host-sticky .nav a.active,
  .app-shell[data-shell="host"] .host-sticky .nav-sub a.active {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
  }

  .app-shell[data-shell="host"] .phone-band.is-clean,
  .app-shell[data-shell="host"] .phone-band.is-check,
  .app-shell[data-shell="host"] .phone-band.is-done,
  .app-shell[data-shell="host"] .phone-band.is-people,
  .app-shell[data-shell="host"] .phone-band.is-notice {
    border-left-color: transparent;
  }
}

.site-hero {
  margin: 0 0 16px;
}

.site-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-hero h2 {
  margin: 8px 0 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  max-width: 16em;
}

.site-hero .site-line {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 36em;
}

@media (min-width: 721px) {
  .app-shell[data-shell="host"] .topbar {
    padding-left: 36px;
    padding-right: 36px;
  }

  .app-shell[data-shell="host"] .host-sticky {
    margin-left: -16px;
    margin-right: -16px;
    padding: 20px 34px 8px;
  }

  .app-shell[data-shell="host"] .host-toolbar {
    margin-bottom: 16px;
  }

  .host-nav > .nav,
  .host-pages > .nav {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    gap: 18px;
  }

  .host-nav > .nav a,
  .host-pages > .nav a {
    border-radius: 0;
    padding: 6px 2px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: transparent;
    color: var(--ink);
  }

  .app-shell[data-shell="host"] {
    accent-color: var(--ink);
  }

  .host-nav > .nav a.active {
    background: transparent;
    color: var(--ink);
    padding: 6px 2px;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 6px;
  }

  .host-toolbar,
  .host-nav,
  .host-pages {
    width: 100%;
    align-items: stretch;
  }

  .host-pages {
    justify-content: flex-start;
    align-items: baseline;
    gap: 22px;
  }

  .host-pages > a.active {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.15;
    padding: 0;
    text-decoration: none;
  }

  .host-pages > .nav {
    width: auto;
  }

  .host-pages > .nav a {
    color: var(--muted);
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    font-size: 13px;
  }

  .host-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 24px;
    row-gap: 14px;
    align-items: center;
  }

  .host-nav {
    grid-column: 1;
    grid-row: 1;
  }

  .host-place {
    display: contents;
  }

  .host-place .date-nav {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .host-place .date-nav [data-date-today] {
    display: none;
  }

  .host-place .house-tabs-bar {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    flex-flow: row wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    width: auto;
    max-width: none;
    margin: 0;
  }

  .host-place .house-tabs {
    display: contents;
  }

  .host-toolbar > .plan-contents {
    grid-column: 1 / -1;
    width: 100%;
    margin: 0;
    padding-top: 12px;
    border-top: 1px solid var(--line);
  }

  .host-toolbar > .plan-contents a {
    border: 0;
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-size: 13px;
    font-weight: 600;
  }

  .host-toolbar > .plan-contents.is-house-home {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .plan-contents-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .plan-contents-label {
    font-size: 13px;
    font-weight: 600;
  }

  .plan-contents-sub {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    padding-left: 16px;
  }

  .host-toolbar > .plan-contents.is-house-home a.house-tab,
  .host-toolbar > .plan-contents.is-house-home a.house-tab.active {
    border: 0;
    background: transparent;
    border-radius: 0;
    padding: 0;
    height: auto;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
  }

  .host-toolbar > .plan-contents.is-house-home a.house-tab.active {
    box-shadow: inset 0 -2px 0 var(--mark-blue);
  }

  .site-hero {
    margin-top: 40px;
    padding-left: 36px;
    padding-right: 36px;
  }

  .site-hero h2 {
    font-size: 18px;
    letter-spacing: -0.03em;
  }

  .site-hero .site-line {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.25;
  }

  body:has(.app-shell[data-shell="host"]) {
    background: var(--card);
  }

  .app-shell[data-shell="host"] .host-sticky {
    background: var(--card);
  }

  .app-shell[data-shell="host"] .todo-jump,
  .app-shell[data-shell="host"] .todo-jump.has-open {
    border-radius: 0;
    background: transparent;
    border-color: var(--line);
    color: var(--ink);
  }

  .app-shell[data-shell="host"] .todo-jump.has-open {
    border-color: #96adec;
  }
}
