/* Desktop has one scrolling app surface; on mobile the document is the only scroller. */
.demo-back-icon,
.demo-header-feedback {
  display: none;
}
body[data-view="demo"] .site-footer,
body[data-view="demo"] .mobile-feedback {
  display: none;
}
body[data-view="demo"] .demo-section {
  max-width: 1060px;
  padding: 16px 32px 24px;
}
body[data-view="demo"] .demo-topbar {
  margin-bottom: 12px;
  min-height: 48px;
}
body[data-view="demo"] .demo-topbar > .demo-badge {
  display: none;
}
body[data-view="demo"] .demo-layout {
  grid-template-columns: minmax(0, 300px) 414px;
  justify-content: center;
  align-items: center;
  gap: clamp(40px, 7vw, 100px);
}
body[data-view="demo"] .demo-aside {
  padding-top: 0;
}
body[data-view="demo"] .demo-aside h2 {
  font-size: 31px;
  line-height: 1.2;
  letter-spacing: -1px;
  margin-bottom: 16px;
}
body[data-view="demo"] .demo-aside > .micro {
  font-size: 12px;
  line-height: 1.65;
  margin: 16px 0;
}
body[data-view="demo"] .demo-phone {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 414px;
  max-width: 100%;
  height: clamp(300px, calc(100dvh - 190px), 780px);
  border: 1px solid #c7d1c8;
  border-radius: 28px;
  box-shadow: 0 12px 40px #173d310b;
  overflow: hidden;
}
.demo-app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 12px;
  padding: 14px 21px 9px;
  background: var(--white);
}
.phone-brand {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.6px;
}
.demo-app-bar .demo-badge {
  padding: 3px 6px;
  background: #f1f3ec;
  color: #52685b;
  font-size: 8px;
}
body[data-view="demo"] .demo-screen {
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px 20px 24px;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-padding: 16px 0;
  scrollbar-width: thin;
  scrollbar-color: #b2c2b4 transparent;
}
body[data-view="demo"] .demo-nav {
  position: relative;
  bottom: auto;
  z-index: 10;
  flex: 0 0 auto;
  padding: 6px 10px 9px;
  background: var(--white);
}
body[data-view="demo"] .demo-nav a {
  min-height: 57px;
  border-radius: 10px;
}
body[data-view="demo"] .week-dates {
  font-size: 12px;
  margin: 9px 0 15px;
}
body[data-view="demo"] .week-filters {
  margin: 0 0 6px;
}
body[data-view="demo"] .filter-description {
  margin: 7px 0 16px;
  font-size: 12px;
}
body[data-view="demo"] .week-group > h2 {
  font-size: 19px;
  margin: 19px 0 11px;
}
body[data-view="demo"] .week-list-tools {
  margin-top: 18px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}
.week-context {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
body[data-view="demo"] .week-context .week-weather {
  margin-top: 0;
}
body[data-view="demo"] .week-weather .weather-heading {
  min-height: 56px;
  padding: 10px 12px;
}
body[data-view="demo"] .demo-screen .button:active,
body[data-view="demo"] .demo-nav a:active {
  filter: brightness(0.92);
}
body[data-view="demo"] .toast {
  position: absolute;
  bottom: 91px;
  max-width: calc(100% - 32px);
  padding: 11px 16px;
  font-size: 13px;
  pointer-events: none;
}
@media (min-width: 761px) and (max-width: 1023px) {
  body[data-view="demo"] .demo-layout {
    display: flex;
    justify-content: center;
  }
  body[data-view="demo"] .demo-aside {
    display: none;
  }
}
@media (max-width: 760px) {
  body[data-view="demo"] {
    background: var(--white);
  }
  body[data-view="demo"] .site-header {
    border-bottom: 1px solid var(--line);
    background: var(--white);
    backdrop-filter: none;
  }
  body[data-view="demo"] .header-inner {
    padding: 6px max(16px, env(safe-area-inset-right)) 6px
      max(16px, env(safe-area-inset-left));
    gap: 6px;
    min-height: 58px;
  }
  body[data-view="demo"] .brand {
    font-size: 21px;
    letter-spacing: -0.8px;
    gap: 6px;
    min-height: 44px;
  }
  body[data-view="demo"] .brand img {
    display: none;
  }
  body[data-view="demo"] .demo-back-icon {
    display: inline-flex;
    align-items: center;
  }
  .demo-back-icon .icon {
    width: 17px;
    height: 20px;
  }
  body[data-view="demo"] .header-right {
    gap: 1px;
  }
  body[data-view="demo"] .demo-header-feedback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
  }
  body[data-view="demo"] .demo-header-feedback .icon {
    width: 20px;
    height: 20px;
  }
  body[data-view="demo"] .language-picker button {
    min-width: 44px;
    min-height: 44px;
    padding: 4px;
  }
  body[data-view="demo"] .demo-section {
    padding: 0;
    max-width: none;
  }
  body[data-view="demo"] .demo-topbar {
    display: none;
  }
  body[data-view="demo"] .demo-layout {
    display: block;
  }
  body[data-view="demo"] .demo-phone {
    width: 100%;
    max-width: none;
    height: auto;
    min-height: calc(100svh - 58px);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }
  body[data-view="demo"] .demo-app-bar {
    justify-content: center;
    padding: 8px 20px 0;
    min-height: 25px;
  }
  body[data-view="demo"] .phone-brand {
    display: none;
  }
  body[data-view="demo"] .demo-app-bar .demo-badge {
    font-size: 8px;
    background: transparent;
    padding: 0;
    letter-spacing: 0.7px;
  }
  body[data-view="demo"] .demo-screen {
    overflow: visible;
    min-height: 0;
    flex: 1;
    padding: 16px max(20px, env(safe-area-inset-right))
      calc(109px + env(safe-area-inset-bottom))
      max(20px, env(safe-area-inset-left));
    overscroll-behavior-y: auto;
    scroll-padding: 0;
  }
  body[data-view="demo"] .demo-screen h1 {
    margin-top: 5px;
  }
  body[data-view="demo"] .demo-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px max(10px, env(safe-area-inset-right))
      calc(8px + env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
    background: var(--white);
  }
  body[data-view="demo"] .demo-nav a {
    min-height: 57px;
  }
  body[data-view="demo"] .toast {
    position: fixed;
    bottom: calc(90px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 32px);
  }
  body[data-view="demo"] dialog {
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
  }
}
@media (max-width: 360px) {
  body[data-view="demo"] .demo-screen {
    padding-left: 16px;
    padding-right: 16px;
  }
  body[data-view="demo"] .header-inner {
    padding-left: 10px;
    padding-right: 10px;
  }
  body[data-view="demo"] .brand {
    font-size: 20px;
  }
}

/* Content destinations stay in the tab bar; creation and editing get their own bar. */
body[data-view="demo"] .demo-nav {
  grid-template-columns: repeat(2, 1fr);
}
body[data-view="demo"][data-workflow="true"] .demo-nav {
  display: none;
}
.workflow-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 12px;
  min-height: 58px;
  flex-shrink: 0;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  z-index: 11;
}
.workflow-toolbar[hidden] { display: none; }
.workflow-toolbar .text-link, .workflow-toolbar .text-button {
  margin: 0;
  min-height: 48px;
  padding: 8px;
  flex-shrink: 0;
}
.workflow-title {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body[data-view="demo"] .task-card {
  padding: 12px 14px;
  margin: 10px 0;
}
.task-summary { display: flex; align-items: center; gap: 10px; }
.task-open { flex: 1; min-width: 0; min-height: 48px; color: inherit; text-decoration: none; }
body[data-view="demo"] .task-open h2 { font-size: 16px; line-height: 1.35; margin: 0 0 4px; overflow-wrap: anywhere; }
.task-open:hover h2 { text-decoration: underline; }
.task-date { color: #53654e; font-size: 12px; }
.task-complete {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border: 1px solid #7a9788;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
  background: var(--white);
  cursor: pointer;
}
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; }
body[data-view="demo"] .task-meta p { margin: 0; font-size: 12px; }
.child-context { display: inline-flex; width: fit-content; border-radius: 20px; padding: 4px 9px; background: var(--sage); }
.task-owner .avatar { width: 22px; height: 22px; }
.task-meta .status-pill { align-self: center; }
@media (max-width: 760px) {
  body[data-view="demo"][data-workflow="true"] .workflow-toolbar {
    position: sticky;
    top: 0;
    padding-top: max(4px, env(safe-area-inset-top));
  }
  body[data-view="demo"][data-workflow="true"] .demo-screen {
    padding-bottom: calc(32px + env(safe-area-inset-bottom));
  }
  body[data-view="demo"][data-workflow="true"] .toast { bottom: calc(20px + env(safe-area-inset-bottom)); }
}

.date-time-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: end;
  gap: 8px;
  margin: 18px 0;
}
.date-time-fields > .field { min-width: 0; margin: 0; }
.native-date-control {
  display: flex;
  align-items: center;
  min-width: 0;
  width: 100%;
  height: 50px;
  padding: 0 8px;
  border: 1px solid #b6c2b3;
  border-radius: 9px;
  background: #fffefa;
}
.native-date-control:focus-within {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
/* iOS miscalculates percentage widths on padded native date/time inputs.
   Keep padding and borders on the ordinary wrapper, not on the native control. */
.demo-screen .native-date-control input {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  box-sizing: border-box;
  flex: 1 1 0%;
  min-width: 0;
  min-inline-size: 0;
  max-width: 100%;
  width: 100%;
  min-height: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: clamp(16px, 4.6vw, 18px);
  line-height: 48px;
  text-align: center;
  outline: none;
}
.native-date-control input::-webkit-date-and-time-value {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  line-height: 48px;
  text-align: center;
}
.native-date-control input::-webkit-datetime-edit {
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0;
}
.review-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
.review-fields:disabled { opacity: 0.5; }
.review-selection { margin: 0 0 12px; }
.batch-actions { margin-top: 20px; }
.batch-actions > .text-button { display: flex; margin: 8px auto; }
#review-form .suggestion-card h2 { font-size: 17px; margin-bottom: 12px; }
#review-form .edit-fields { margin-bottom: 0; }
#review-form .batch-actions {
  padding: 12px 0 max(4px, env(safe-area-inset-bottom));
  background: var(--white);
  border-top: 1px solid var(--line);
  z-index: 2;
}

.workflow-toolbar .workflow-save {
  color: var(--white);
  background: var(--green);
  border-radius: 9px;
  min-width: 64px;
  padding: 8px 12px;
  text-decoration: none;
  font-weight: 600;
}
#dialog-extra:not(:empty) { margin: 20px 0; }
#dialog-extra .checkbox { align-items: flex-start; }
.family-change-notice { font-size: 13px; letter-spacing: 0; }

/* Keep demo guidance and the next step available at every breakpoint. */
body[data-view="demo"] .demo-header-feedback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 48px;
}
body[data-view="demo"] .demo-aside > [data-i18n="demoMemory"] { display: none; }
.demo-memory-note {
  flex: 0 0 auto;
  padding: 8px 20px;
  margin: 0;
  background: var(--sage);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
}
body[data-view="demo"] .demo-app-bar .demo-badge { font-size: 10px; }
body[data-view="demo"] .review-owner { margin: 20px 0; }
body[data-view="demo"] .review-owner .field-help { font-size: 14px; }
body[data-view="demo"] .task-new {
  border: 2px solid var(--green);
  scroll-margin-top: 18px;
}
.task-result { font-size: 14px; font-weight: 600; margin: 0 0 12px; }
.demo-feedback-card {
  position: relative;
  border-radius: 12px;
  padding: 20px;
  margin: 12px 0 20px;
  background: var(--sage);
}
body[data-view="demo"] .demo-feedback-card h2 { font-size: 20px; padding-right: 32px; margin: 0 0 8px; }
.demo-feedback-card p { font-size: 14px; margin: 0 0 16px; }
.feedback-dismiss { position: absolute; top: 4px; right: 4px; min-width: 48px; min-height: 48px; }
@media (max-width: 760px) {
  body[data-view="demo"] .demo-app-bar .demo-badge { font-size: 11px; }
  body[data-view="demo"] .task-new { scroll-margin-top: 74px; }
  .workflow-back { font-size: 14px; }
}

/* Import actions have their own space so they never obscure the example. */
.import-actions {
  flex: 0 0 auto;
  padding: 12px 20px max(12px, env(safe-area-inset-bottom));
  background: var(--white);
  border-top: 1px solid var(--line);
}
.import-actions[hidden] { display: none; }
@media (max-width: 760px) {
  .import-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 12;
  }
  body[data-view="demo"][data-workflow="true"]:has(.import-actions:not([hidden])) .demo-screen {
    padding-bottom: calc(104px + env(safe-area-inset-bottom));
  }
}
.demo-feedback-card .follow-up { margin: 16px 0 0; }
.follow-up a { text-decoration: underline; }
body[data-view="demo"] .follow-up a { display: inline-flex; align-items: center; min-height: 48px; }

#review-form .person-choices legend {
  position: static;
  width: auto;
  height: auto;
  clip: auto;
  white-space: normal;
  overflow: visible;
}
