/* Guild Hall interaction refinement: browse first, edit on demand. */
html { scroll-behavior: auto; }
.guild-theme {
  --flow-border: rgba(217, 174, 100, .3);
  --flow-muted: #d9c19a;
  --flow-surface: #2c1b12;
}
.guild-theme [hidden] { display: none !important; }
.guild-theme :is(button, summary, a, input, select, textarea):focus-visible {
  outline: 3px solid var(--guild-gold-light);
  outline-offset: 3px;
}
.guild-theme :is(input, select, textarea):focus-visible {
  outline-color: var(--guild-gold-deep);
}
.guild-theme .health-hero.compact-hero {
  display: block;
  padding: 1.5rem 2rem;
  margin-top: .5rem;
  border-radius: 12px;
  box-shadow: none;
}
.guild-theme .guild-hall-banner { display: none; }
.guild-theme .health-hero .health-label { margin-bottom: .5rem; letter-spacing: .04em; }
.guild-theme .health-hero h1 { font-size: 2rem; letter-spacing: -.02em; }
.guild-theme .health-lead { margin-top: .6rem; max-width: 65ch; }
.guild-theme .hero-targets { display: none; }
.guild-theme .hero-log-action { min-height: 44px; margin-top: .8rem; padding: .5rem 1rem; box-shadow: none; }
.guild-theme .privacy-note {
  display: block;
  padding: 0;
  margin-top: 1rem;
  border: 0;
  background: none;
  box-shadow: none;
}
.guild-theme .privacy-note summary { min-height: 44px; display: flex; align-items: center; }
.guild-theme .privacy-note > span { display: block; padding-top: .5rem; }
.guild-theme #haumea-sync-summary {
  display: block;
  padding: 0 1.25rem;
  border-radius: 10px;
  box-shadow: none;
  background: var(--flow-surface);
}
.guild-theme #haumea-sync-summary::before { display: none; }
.guild-theme .connection-summary {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  list-style: none;
  color: var(--flow-muted);
  font-size: .9rem;
}
.connection-summary::-webkit-details-marker { display: none; }
.guild-theme .connection-summary::after { content: "+"; color: var(--guild-gold-light); font-size: 1.2rem; }
.guild-theme #haumea-sync-summary[open] .connection-summary::after { content: "−"; }
.guild-theme #health-connection-status { margin-left: auto; font-size: .8rem; }
.guild-theme #haumea-sync-summary .sync-hero { padding-block: 1rem; border-top: 1px solid var(--flow-border); }
.guild-theme #haumea-sync-summary .sync-details { margin-bottom: 1rem; }
.guild-theme .notion-sync-actions button { min-height: 44px; }
.health-navigation { position: sticky; top: 64px; z-index: 30; margin-bottom: 1rem; }
.guild-theme .health-navigation .health-tabs { position: static; margin: 0; box-shadow: none; }
.guild-theme .health-navigation .health-tab { font-size: .9rem; }
.guild-theme .health-navigation :is(.health-tab, .health-more > summary, .health-more-menu button) {
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
@media (hover: hover) {
  .guild-theme .health-navigation .health-tab:hover:not(.active):not(.add-tab),
  .guild-theme .health-more > summary:hover,
  .guild-theme .health-more-menu button:hover {
    color: var(--guild-gold-light);
    background: rgba(239, 185, 68, .16);
    border-color: var(--guild-gold);
  }
  .guild-theme .health-navigation .add-tab:hover {
    color: var(--guild-ink);
    background: var(--guild-gold-light);
    border-color: var(--guild-gold-light);
  }
}
.health-more { display: none; }
.guild-theme .health-navigation .health-tab.active:not(.add-tab) {
  color: var(--guild-gold-light);
  border-color: var(--guild-gold);
  background: #543a25;
  box-shadow: none;
}
.guild-theme .health-navigation .add-tab { box-shadow: none; }
@media (prefers-reduced-motion: reduce) {
  .guild-theme .health-navigation :is(.health-tab, .health-more > summary, .health-more-menu button) { transition: none; }
}
.guild-theme .today-cockpit > .quick-action-zone {
  margin: 0 0 1.25rem;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
.guild-theme .today-cockpit > .quick-action-zone > .section-heading { display: none; }
.guild-theme #quick-actions { gap: .65rem; margin: 0; }
.guild-theme #quick-actions button {
  min-height: 72px;
  padding: .8rem 1rem;
  border-radius: 8px;
  box-shadow: none;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .25rem .65rem;
  text-align: left;
}
.guild-theme #quick-actions button > span { grid-row: 1 / 3; align-self: center; }
.guild-theme #quick-actions button > i { display: none; }
.guild-theme #quick-actions button > small { grid-column: 2; font-size: .85rem; }
.guild-theme #quick-actions button > strong { font-size: 1rem; }
.guild-theme .macro-grid { gap: .65rem; }
.guild-theme .macro-card { padding: 1rem; min-height: 0; box-shadow: none; border-radius: 8px; }
.guild-theme .macro-card strong { font-size: 1.7rem; line-height: 1.25; margin-block: .25rem; }
.guild-theme .macro-card :is(span, small) { font-size: .9rem; }
.guild-theme .decision-card { box-shadow: none; border-radius: 8px; }
.guild-theme .care-hero { padding: 1.25rem 0; background: none; border: 0; box-shadow: none; }
.guild-theme .care-layout { align-items: start; gap: 1.5rem; }
.guild-theme :is(.care-shelf, .grooming-playbook) { padding: 1.5rem; border-radius: 12px; box-shadow: none; }
.guild-theme :is(.care-shelf, .grooming-playbook) > .section-heading { margin-bottom: 1rem; }
.guild-theme .collection-editor { margin-block: .75rem 1rem; }
.guild-theme .collection-editor > summary {
  min-height: 48px;
  padding: .7rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  border: 1px solid var(--flow-border);
  border-radius: 8px;
  background: var(--flow-surface);
  color: var(--guild-parchment-light);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  list-style: none;
}
.collection-editor > summary::-webkit-details-marker { display: none; }
.guild-theme .collection-editor > summary::after { content: "⌄"; font-size: 1.2rem; }
.guild-theme .collection-editor[open] > summary::after { content: "−"; }
.guild-theme .collection-editor > summary:hover { background: #493021; }
.guild-theme .collection-editor > form { margin-top: .75rem; }
.guild-theme .collection-editor :is(.care-form, .habit-form, .program-form) {
  padding: 1.25rem;
  border-radius: 8px;
  border: 0;
  background: var(--guild-parchment);
  color: var(--guild-ink);
  box-shadow: none;
}
.guild-theme .collection-editor :is(label, .editor-optional > summary, .care-image-note) { color: var(--guild-ink); }
.guild-theme .collection-editor :is(input, select, textarea) { font-size: 1rem; }
.guild-theme .editor-optional { margin-top: .5rem; }
.guild-theme .editor-optional > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: .5rem;
  border-top: 1px solid rgba(67, 46, 30, .25);
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
}
.guild-theme .editor-optional > summary::before { content: "+"; }
.guild-theme .editor-optional[open] > summary::before { content: "−"; }
.guild-theme .editor-optional > label { display: grid; gap: .4rem; margin-block: .8rem; }
.guild-theme .care-image-picker { min-height: 72px; box-shadow: none; }
.guild-theme .care-image-field.has-image .care-image-picker { display: none; }
.guild-theme .care-image-preview { min-height: 0; margin: 0; padding: 0; border-radius: 8px; overflow: hidden; cursor: pointer; }
.guild-theme .care-image-preview img { width: 100%; height: auto; max-height: 240px; object-fit: contain; display: block; }
.guild-theme .care-image-preview small { display: block; padding: .5rem .75rem; background: var(--guild-parchment-light); color: var(--guild-ink); }
.guild-theme .care-card-list { margin-top: 1rem; }
.guild-theme .care-card-list .empty-state { padding: 1.75rem 1rem; background: none; border: 1px dashed var(--flow-border); color: var(--flow-muted); border-radius: 8px; }
.guild-theme .care-card { box-shadow: none; border-radius: 8px; }
.guild-theme .saved-setting-summary { color: var(--guild-ink); font-size: 1rem; margin-block: .8rem; line-height: 1.8; }
.guild-theme .program-layout { display: flex; flex-direction: column; gap: .75rem; }
.guild-theme .program-layout > * { width: 100%; min-width: 0; }
.guild-theme .profile-settings-card .collection-editor > summary,
.guild-theme .quest-settings-card .collection-editor > summary {
  background: transparent;
  border-color: rgba(67, 46, 30, .35);
  color: var(--guild-ink);
}
.guild-theme .collection-editor :is(.secondary-action, .text-action) { min-height: 44px; }
.guild-theme .collection-editor .form-actions { margin-top: 1rem; }
.guild-theme .profile-utility-grid { align-items: start; }
.guild-theme .insights-empty { padding: 1.5rem; color: var(--guild-ink); background: var(--guild-parchment); border-radius: 10px; margin-bottom: 1rem; }
.guild-theme .insights-empty h3 { margin: 0 0 .5rem; }
.guild-theme .insights-empty p { max-width: 65ch; }
.guild-theme .insights-empty button { margin-top: .75rem; min-height: 44px; }
.guild-theme .charts-grid.has-partial-data .metric-chart[data-has-trend="false"] .chart-empty { padding: .5rem 0; min-height: 0; }
.guild-theme #mental-filters .mood-btn { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.guild-theme #mental-filters input { position: absolute; opacity: 0; width: 1px; height: 1px; display: block; }
.guild-theme #mental-filters .mood-btn:focus-within { outline: 3px solid var(--guild-gold-light); outline-offset: 2px; }
.guild-theme .text-action { min-height: 44px; font-size: .9rem; }
@media (max-width: 1000px) {
  .guild-theme .health-shell { padding-top: .65rem; padding-bottom: 7rem; }
  .guild-theme .health-hero.compact-hero { padding: 1.1rem 1.25rem; }
  .guild-theme .health-hero h1 { font-size: 1.7rem; }
  .guild-theme .health-hero .health-label { display: none; }
  .guild-theme .health-lead { font-size: 1rem; }
  .guild-theme .privacy-note { margin-top: .4rem; }
  .guild-theme #haumea-sync-summary { padding-inline: 1rem; }
  .guild-theme .connection-summary { flex-wrap: wrap; gap: .25rem .5rem; padding-block: .65rem; }
  .guild-theme #health-connection-status { order: 3; width: 100%; font-size: .85rem; }
  .guild-theme .health-navigation {
    position: fixed;
    inset: auto .55rem max(.55rem, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 1fr);
    gap: .2rem;
    padding: .35rem;
    margin: 0;
    border: 1px solid var(--flow-border);
    border-radius: 12px;
    background: #29170e;
  }
  .guild-theme .health-navigation .health-tabs {
    position: static;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-flow: initial;
    gap: .15rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    overflow: visible;
    backdrop-filter: none;
  }
  .guild-theme .health-navigation .secondary-tab { display: none; }
  .guild-theme .health-navigation .health-tab {
    width: 100%;
    min-width: 0;
    min-height: 60px;
    padding: .4rem .1rem;
    gap: .3rem;
    transform: none;
    flex: initial;
    font-size: 14px;
    border-radius: 8px;
  }
  .guild-theme .health-navigation .tab-label { white-space: nowrap; letter-spacing: 0; }
  .guild-theme .health-more { display: block; min-width: 0; }
  .guild-theme .health-more > summary {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    min-height: 60px;
    gap: .3rem;
    padding: .4rem .1rem;
    color: var(--flow-muted);
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    list-style: none;
  }
  .health-more > summary::-webkit-details-marker { display: none; }
  .guild-theme .health-more.has-active-panel > summary, .guild-theme .health-more[open] > summary { color: var(--guild-parchment-light); background: #543a25; }
  .guild-theme .health-more-menu {
    position: absolute;
    bottom: calc(100% + .65rem);
    right: 0;
    left: 0;
    padding: 1rem;
    border: 1px solid var(--flow-border);
    border-radius: 12px;
    background: #29170e;
    color: var(--guild-parchment-light);
    max-height: calc(100dvh - 160px);
    overflow-y: auto;
  }
  .guild-theme .health-more-menu p { margin-bottom: .5rem; font-size: .9rem; color: var(--flow-muted); }
  .guild-theme .health-more-menu button {
    display: block;
    width: 100%;
    padding: .8rem;
    min-height: 56px;
    text-align: left;
    border: 0;
    background: none;
    border-radius: 8px;
    font-size: 1rem;
  }
  .guild-theme .health-more-menu button small { display: block; color: var(--flow-muted); font-size: .9rem; }
  .guild-theme .health-more-menu button[aria-current] { background: #543a25; color: var(--guild-gold-light); }
  .guild-theme .today-cockpit { padding: 1.25rem; }
  .guild-theme #quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guild-theme #quick-actions button { min-height: 56px; padding: .7rem .65rem; align-items: center; }
  .guild-theme #quick-actions button > span { grid-row: auto; font-size: 1rem; }
  .guild-theme #quick-actions button > strong { font-size: .9rem; }
  .guild-theme #quick-actions button > small { display: none; }
  .guild-theme .macro-card { padding: .75rem; }
  .guild-theme .macro-card strong { font-size: 1.5rem; }
  .guild-theme :is(.care-shelf, .grooming-playbook) { padding: 1.25rem; }
  .guild-theme .collection-editor :is(.care-form, .habit-form, .program-form) { padding: 1rem; }
  .guild-theme :is(.care-card-actions, .form-actions) { flex-wrap: wrap; }
  .guild-theme .care-card-actions button { min-height: 44px; }
  .guild-theme .history-day-strip { scrollbar-width: thin; }
  .guild-theme :is(.care-hero, .care-shelf, .grooming-playbook, .collection-editor) small { font-size: .9rem; }
}
@media (prefers-reduced-motion: reduce) {
  .guild-theme .health-navigation *, .guild-theme .collection-editor * { transition: none; animation: none; }
}

/* The site-wide nav (.aknav, fixed, 64px; 60px on phones) replaces the old Health top bar. */
.guild-theme .health-shell { padding-top: calc(64px + 1rem); }
.guild-theme .health-quicklinks { display: flex; flex-wrap: wrap; gap: .4rem; margin: .35rem 0 .6rem; }
.guild-theme .health-quicklinks a { display: inline-flex; align-items: center; min-height: 32px; padding: .2rem .7rem; border: 1px solid #a27a42; border-radius: 999px; background: rgba(107,69,33,.07); color: #5a3a1c; font-size: .8rem; font-weight: 600; text-decoration: none; }
.guild-theme .health-quicklinks a:hover, .guild-theme .health-quicklinks a:focus-visible { background: #ffda7c; color: #37220f; border-color: #bc8125; }
@media (max-width: 760px) {
  .guild-theme .health-shell { padding-top: calc(60px + .75rem); }
}

/* Food joins the phone bottom bar: 5 primary tabs + More. */
@media (max-width: 1000px) {
  .guild-theme .health-navigation { grid-template-columns: minmax(0, 5fr) minmax(0, 1fr); }
  .guild-theme .health-navigation .health-tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .guild-theme .health-navigation .health-tab { font-size: 12.5px; }
}

/* Today (Web DoD): clickable summary cards with status colours. */
.guild-theme :is(.macro-card, .decision-card)[role="button"] { cursor: pointer; transition: transform 160ms ease-out, box-shadow 160ms ease-out; }
.guild-theme :is(.macro-card, .decision-card)[role="button"]:hover { transform: translateY(-2px); box-shadow: 0 10px 22px #0005; }
.guild-theme :is(.macro-card, .decision-card)[role="button"]:focus-visible { outline: 3px solid #ffda7c; outline-offset: 2px; }
.guild-theme :is(.macro-card, .decision-card)[data-state] { border-left: 5px solid #b9a08a; }
.guild-theme :is(.macro-card, .decision-card)[data-state="done"] { border-left-color: #2f9a6b; }
.guild-theme :is(.macro-card, .decision-card)[data-state="on-track"] { border-left-color: #d6a23a; }
.guild-theme :is(.macro-card, .decision-card)[data-state="low"] { border-left-color: #e08a2e; }
.guild-theme :is(.macro-card, .decision-card)[data-state="over"] { border-left-color: #c8483a; }
.guild-theme :is(.macro-card, .decision-card)::after { content: '→'; position: absolute; right: .8rem; bottom: .6rem; color: #8b5a2b; font-weight: 800; opacity: .55; }
.guild-theme :is(.macro-card, .decision-card) { position: relative; }
@media (prefers-reduced-motion: reduce) { .guild-theme :is(.macro-card, .decision-card)[role="button"] { transition: none; } }
.guild-theme .today-status-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; margin: .2rem 0 .8rem; color: #e6cab1; font-size: .78rem; }
.guild-theme .today-status-legend .dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; margin-right: .1rem; }
.guild-theme .dot--done { background: #2f9a6b; } .guild-theme .dot--on-track { background: #d6a23a; } .guild-theme .dot--low { background: #e08a2e; } .guild-theme .dot--over { background: #c8483a; }
