/* App-style dashboard shell and compact household task rows. */
.page-shell {
  width: min(1840px, calc(100% - 48px));
  padding: 10px 0 40px;
}

.dashboard-toast {
  position: fixed;
  right: 24px;
  bottom: 20px;
  z-index: 80;
  display: flex;
  max-width: min(560px, calc(100vw - 32px));
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 8px 28px rgba(23, 63, 57, .2);
  font-size: 14px;
  font-weight: 700;
}

.dashboard-toast[hidden] {
  display: none !important;
}

.dashboard-toast[data-state="pending"] {
  border-color: rgba(82, 123, 99, .5);
  background: #eff4e9;
}

.dashboard-toast[data-state="success"] {
  border-color: rgba(82, 123, 99, .65);
  background: #e4eddd;
}

.dashboard-toast[data-state="error"] {
  border-color: #e5a18e;
  background: #fff3ef;
  color: #8b2d1b;
}

.dashboard-toast-action {
  flex: none;
  padding: 6px 10px;
  border: 1px solid currentColor;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(270px, auto) minmax(320px, 1fr) auto;
  gap: 18px;
  min-height: 78px;
  margin: 0 0 14px;
  padding: 8px 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--cream);
}

.brand {
  gap: 8px;
}

.brand-mark svg {
  width: 42px;
  height: 42px;
}

.dashboard-identity {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.dashboard-identity[hidden],
.voro-header[hidden],
#login-brand[hidden],
#dashboard[hidden],
.voro-chat-panel[hidden],
.task-activity-panel[hidden] {
  display: none !important;
}

.dashboard-identity h1 {
  overflow: hidden;
  margin: 0;
  color: var(--ink);
  font-size: clamp(22px, 2vw, 34px);
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-nav,
.task-toolbar-button,
.task-control-menu > summary {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.home-nav {
  min-height: 52px;
  border-color: rgba(82, 123, 99, .45);
  border-radius: 28px;
  padding: 0 17px;
  white-space: nowrap;
}

.home-nav span {
  font-size: 25px;
  line-height: 1;
}

.voro-header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.voro-header-form {
  display: flex;
  min-width: 0;
  min-height: 56px;
  flex: 1;
  align-items: flex-end;
  gap: 10px;
  padding: 5px 7px 5px 15px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: #fff;
  box-shadow: 0 3px 12px var(--shadow);
}

.voro-header-mark {
  flex: none;
  align-self: center;
  color: var(--coral);
  font-size: 21px;
}

.voro-compose {
  min-width: 0;
  flex: 1;
}

.voro-header-form textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  max-height: min(35vh, 320px);
  padding: 9px 4px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  line-height: 1.4;
  resize: none;
  overflow-y: auto;
}

.voro-header-form textarea::placeholder {
  color: var(--leaf);
  opacity: 1;
}

.voro-character-count {
  display: block;
  padding: 0 4px 3px;
  color: var(--deep-green);
  font-size: 11px;
  line-height: 1.3;
}

.voro-character-count[data-over-limit="true"] {
  color: #b54332;
  font-weight: 700;
}

.voro-header-form:focus-within {
  outline: 3px solid rgba(242, 138, 105, .3);
}

.voro-send,
.voro-thread-toggle {
  display: grid;
  width: 42px;
  height: 42px;
  flex: none;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--cream);
  color: var(--deep-green);
  font-size: 20px;
  cursor: pointer;
}

.voro-send:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.voro-header-form .voro-send {
  margin-bottom: 18px;
}

.voro-thread-toggle {
  width: 48px;
  height: 48px;
  font-size: 15px;
}

.dashboard-view > .section-heading {
  display: none;
}

.home-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 6px 0 20px;
}

.home-dashboard-card {
  display: flex;
  min-height: 124px;
  align-items: center;
  gap: 18px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 3px 12px var(--shadow);
  cursor: pointer;
}

.home-dashboard-card:hover,
.home-dashboard-card:focus-visible {
  border-color: var(--coral);
  box-shadow: 0 5px 16px var(--shadow);
}

.shopping-home-card { text-decoration: none; }
.shopping-icon { background: var(--leaf-soft); }

.home-card-icon {
  display: grid;
  width: 56px;
  height: 56px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  font-size: 26px;
}

.home-dashboard-card > span:nth-child(2) {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 6px;
}

.home-dashboard-card strong {
  font-size: 19px;
}

.home-dashboard-card small {
  color: var(--deep-green);
  font-size: 13px;
}

.home-dashboard-card > b {
  color: var(--deep-green);
  font-size: 26px;
  font-weight: 500;
}

.task-toolbar {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 142px 116px 54px 166px;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.task-toolbar > input[type="search"] {
  width: 100%;
  min-width: 0;
  min-height: 56px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
}

.task-toolbar-menus {
  display: contents;
}

.task-control-menu {
  position: relative;
  min-width: 0;
  padding: 0 !important;
  border: 0 !important;
  overflow: visible !important;
}

.task-control-menu > summary {
  width: 100%;
  list-style: none;
  white-space: nowrap;
}

.task-control-menu > summary::-webkit-details-marker {
  display: none;
}

.task-menu-chevron {
  font-size: 12px;
}

.task-control-menu[open] > summary {
  border-color: var(--deep-green);
  background: var(--deep-green);
  color: #fff;
}

.task-control-menu > .household-options-content {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: none;
  width: min(600px, calc(100vw - 32px));
  max-height: min(72vh, 760px);
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 12px;
  overflow: auto;
  padding: 16px !important;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 8px 24px rgba(23, 63, 57, .18);
}

.task-control-menu[open] > .household-options-content {
  display: flex;
}

.task-control-menu > .household-options-content > label {
  min-width: min(220px, 100%);
}

.task-toolbar-button {
  min-width: 0;
  white-space: nowrap;
}

.task-add-button {
  width: 54px;
  padding: 0;
  font-size: 28px;
  font-weight: 450;
}

.task-activity-button {
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-message {
  min-height: 0;
  margin: 0;
}

.task-list {
  gap: 9px;
}

.task-list.task-density-compact .task-group-items {
  gap: 4px;
}

.task-list.task-density-compact .task-group-heading {
  margin: 7px 0 2px;
  font-size: 18px;
}

.paper-card.task-card.compact-task-card {
  display: block;
  min-width: 0;
  min-height: 42px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
}

.task-compact-main {
  display: flex;
  min-width: 0;
  min-height: 36px;
  align-items: center;
  gap: 8px;
}

.task-completion-indicator {
  appearance: none;
  display: grid;
  width: 28px;
  height: 28px;
  flex: none;
  place-items: center;
  border: 2px solid var(--deep-green);
  border-radius: 5px;
  color: var(--deep-green);
  font-size: 18px;
  font-weight: 800;
  background: #fff;
  cursor: pointer;
}

.task-completion-indicator.completed {
  background: var(--leaf-soft);
}

.task-completion-indicator:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }
.task-completion-indicator:disabled { cursor: wait; opacity: .55; }

.task-card.compact-task-card h3 {
  min-width: 50px;
  flex: 1;
  overflow: hidden;
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-compact-attributes {
  display: flex;
  min-width: 0;
  max-width: 58%;
  flex: 0 1 auto;
  align-items: center;
  gap: 5px;
  overflow: hidden;
}

.task-compact-attributes > span {
  max-width: 150px;
  overflow: hidden;
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--cream);
  color: var(--deep-green);
  font-size: 11px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-compact-attributes .task-compact-note {
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}

.task-color-bar {
  width: 8px;
  height: 25px;
  flex: none;
  border-radius: 4px;
  background: var(--task-accent);
}

.task-activity-panel:not([hidden]) {
  display: block;
}

.task-activity-backdrop {
  position: fixed;
  z-index: 60;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(23, 63, 57, .22);
  cursor: default;
}

.task-activity-drawer {
  position: fixed;
  z-index: 61;
  top: 0;
  right: 0;
  display: flex;
  width: min(520px, 100vw);
  height: 100dvh;
  flex-direction: column;
  gap: 16px;
  overflow: auto;
  padding: 22px 20px;
  border-left: 1px solid var(--line);
  background: #fff;
  box-shadow: -8px 0 24px rgba(23, 63, 57, .16);
}

.task-activity-drawer > header,
.voro-chat-panel > header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.task-activity-drawer > header h2 {
  flex: 1;
  margin: 0;
  font-size: 23px;
}

.task-activity-list {
  display: grid;
  align-content: start;
}

.task-activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 3px;
  border-top: 1px solid var(--line);
}

.task-activity-item > span:last-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.task-activity-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-activity-item small,
.task-activity-help {
  color: var(--deep-green);
  font-size: 12px;
}

.task-activity-mark {
  display: grid;
  width: 34px;
  height: 34px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: var(--leaf-soft);
  color: var(--deep-green);
  font-weight: 800;
}

.task-activity-empty {
  margin: 30px 0 0;
  font-weight: 800;
}

.task-activity-help {
  margin: 0;
}

.voro-chat-panel:not([hidden]) {
  position: fixed;
  z-index: 60;
  top: 90px;
  right: max(16px, calc((100vw - 1840px) / 2));
  display: flex;
  width: min(520px, calc(100vw - 32px));
  max-height: min(70vh, 680px);
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 8px 28px rgba(23, 63, 57, .2);
}

.voro-chat-panel > header > div {
  display: grid;
  flex: 1;
  gap: 4px;
}

.voro-chat-panel > header > div > span {
  color: var(--deep-green);
  font-size: 11px;
}

.voro-chat-panel .voro-intro {
  margin: 0;
  font-size: 12px;
}

.voro-chat-panel .voro-thread {
  min-height: 150px;
  max-height: 48vh;
}

.voro-chat-panel .voro-message {
  width: 92%;
}

.household-message {
  min-height: 0;
  margin: 0;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 14px;
  }

  .voro-header {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .task-toolbar {
    grid-template-columns: minmax(140px, 1fr) 132px 105px 48px 145px;
    gap: 6px;
  }

  .task-toolbar-button,
  .task-control-menu > summary {
    min-height: 48px;
    padding-right: 10px;
    padding-left: 10px;
    font-size: 13px;
  }

  .task-add-button {
    width: 48px;
    padding: 0;
    font-size: 26px;
  }

  .task-compact-attributes {
    max-width: 48%;
  }
}

@media (max-width: 700px) {
  .page-shell {
    width: min(100% - 24px, 1840px);
    padding-top: 6px;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 0;
    margin-bottom: 10px;
    padding: 5px 0 9px;
  }

  .dashboard-identity {
    gap: 9px;
  }

  .home-nav {
    min-height: 42px;
    padding: 0 12px;
    font-size: 13px;
  }

  .home-nav span {
    font-size: 21px;
  }

  .dashboard-identity h1 {
    font-size: 20px;
  }

  .voro-header-form {
    min-height: 48px;
  }

  .voro-header-form textarea {
    min-height: 36px;
    font-size: 15px;
  }

  .voro-thread-toggle {
    width: 42px;
    height: 42px;
  }

  .home-dashboard-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .home-dashboard-card {
    min-height: 88px;
    gap: 12px;
    padding: 13px 14px;
  }

  .home-card-icon {
    width: 44px;
    height: 44px;
    font-size: 21px;
  }

  .home-dashboard-card strong {
    font-size: 16px;
  }

  .home-dashboard-card small {
    font-size: 11px;
  }

  .task-toolbar {
    grid-template-columns: minmax(0, 1fr) auto auto 44px;
    gap: 6px;
  }

  .task-toolbar > input[type="search"] {
    grid-column: 1 / -1;
    min-height: 48px;
    font-size: 16px;
  }

  .task-control-menu > summary,
  .task-toolbar-button {
    min-height: 44px;
    padding: 0 9px;
    font-size: 12px;
  }

  .task-add-button {
    width: 44px;
    padding: 0;
    font-size: 24px;
  }

  .task-activity-button {
    grid-column: 1 / -1;
    justify-self: end;
    min-height: 38px;
  }

  .paper-card.task-card.compact-task-card {
    min-height: 44px;
    padding: 3px 6px;
  }

  .task-compact-main {
    min-height: 36px;
    gap: 6px;
  }

  .task-card.compact-task-card h3 {
    font-size: 13px;
  }

  .task-compact-attributes {
    max-width: 42%;
    gap: 3px;
  }

  .task-compact-attributes > span {
    max-width: 100px;
    padding: 4px 5px;
    font-size: 10px;
  }
}

@media (max-width: 380px) {
  .dashboard-identity h1 {
    font-size: 17px;
  }

  .home-nav {
    padding: 0 8px;
  }

  .task-compact-attributes > span:nth-child(n + 2) {
    display: none;
  }
}

.paper-card.task-card[role="button"] {
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.paper-card.task-card[role="button"]:hover {
  border-color: var(--deep-green);
  box-shadow: 0 4px 14px var(--shadow);
}

.paper-card.task-card[role="button"]:focus-visible {
  outline: 3px solid rgba(242, 138, 105, .5);
  outline-offset: 2px;
}

#detail-dialog.task-detail-open {
  width: min(1400px, calc(100vw - 40px));
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 32px);
  overflow: hidden;
}

#detail-dialog.task-detail-open .dialog-shell {
  display: flex;
  width: 100%;
  max-height: calc(100vh - 32px);
  flex-direction: column;
  overflow: hidden;
}

#detail-dialog.task-detail-open .dialog-header {
  flex: none;
}

#detail-dialog.task-detail-open .dialog-header > div,
#detail-dialog.task-detail-open .dialog-header h2 {
  min-width: 0;
  flex: 1;
}

#detail-dialog.task-detail-open .dialog-subtitle:empty {
  display: none;
}

#detail-dialog.task-detail-open .task-detail-title-input {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 2px 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: 500 27px/1.2 Inter, "Segoe UI", system-ui, sans-serif;
}

#detail-dialog.task-detail-open .task-detail-title-input:focus {
  box-shadow: 0 2px 0 rgba(82, 123, 99, .45);
}

#detail-dialog.task-detail-open #dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.task-detail-content .dialog-metrics {
  margin-top: 14px;
}

@media (max-width: 580px) {
  .task-control-menu > .household-options-content {
    position: fixed;
    top: var(--task-menu-top, 150px);
    right: 12px;
    left: 12px;
    box-sizing: border-box;
    width: auto;
    max-height: calc(100dvh - var(--task-menu-top, 150px) - 12px);
    overscroll-behavior: contain;
  }
  #detail-dialog.task-detail-open {
    box-sizing: border-box;
    width: calc(100dvw - 12px);
    max-width: calc(100dvw - 12px);
    max-height: calc(100dvh - 12px);
  }

  #detail-dialog.task-detail-open .dialog-shell {
    box-sizing: border-box;
    min-width: 0;
    max-height: calc(100dvh - 12px);
  }
  #detail-dialog.task-detail-open #dialog-body { min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .task-control-menu .household-options-content input:not([type=checkbox]),
  .task-control-menu .household-options-content select,
  .task-edit-form input,
  .task-edit-form select,
  .task-edit-form textarea { font-size: 16px; }
}

.medications-icon {
  background: var(--pale-green, #e4ece3);
  color: var(--deep-green);
}
