/* Households page — ledger style, matching zones/pantry */

@keyframes hhPageEnter {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hh-page {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    padding-bottom: var(--space-md);
}

.hh-page.view-enter {
    animation: hhPageEnter var(--duration-cascade) var(--ease-master) both;
}

.hh-shimmer {
    display: block;
}

.hh-shimmer-eyebrow {
    width: 8rem;
    height: 0.9rem;
}

.hh-shimmer-title {
    width: 55%;
    max-width: 20rem;
    height: 2.4rem;
}

.hh-shimmer-label {
    width: 6.5rem;
    height: 0.8rem;
    margin-top: var(--space-2xl);
    margin-bottom: var(--space-xs);
}

.hh-shimmer-row {
    height: 3.6rem;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-xs);
}

.hh-shimmer-row--settings {
    height: 3rem;
    margin-top: var(--space-sm);
}

/* Masthead */
.hh-masthead {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.hh-sub-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--color-ink);
}

.hh-eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.hh-title {
    font-size: 2.4rem;
    line-height: 1.1;
    color: var(--color-text);
}

/* Household switcher — tappable title opens the sheet */
.hh-switcher {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
    text-align: left;
    padding: 0;
}

.hh-switcher-arrow {
    font-size: 1.6rem;
    color: var(--color-text-muted);
    transform: translateY(3px);
    transition: transform 0.2s var(--ease-master);
}

.hh-switcher:active .hh-switcher-arrow {
    transform: translateY(5px);
    color: var(--color-text);
}

/* Switcher sheet */
.hh-sheet {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.hh-sheet-list {
    display: flex;
    flex-direction: column;
}

.hh-sheet-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    width: 100%;
    padding: var(--space-md) 0;
    border-bottom: 1px solid rgba(44, 42, 41, 0.1);
    text-align: left;
}

.hh-sheet-check {
    color: var(--color-primary-dark);
    font-size: 1.2rem;
}

.hh-sheet-check--off {
    visibility: hidden;
}

.hh-sheet-actions {
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* Sections */
.hh-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.hh-section-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--space-sm);
}

.hh-empty {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.hh-row-name {
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.3;
}

.hh-row-meta {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.hh-member--pending .hh-member-name {
    color: var(--color-text-muted);
}

.hh-badge--muted {
    color: var(--color-text-muted);
}

.hh-badge {
    flex-shrink: 0;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-primary-dark);
    border: 1px solid currentColor;
    border-radius: 999px;
    padding: 2px 8px;
}

/* Forms */
.hh-inline-form {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    border-bottom: 1px solid rgba(44, 42, 41, 0.1);
    padding: var(--space-xs) 0;
}

.hh-form-icon {
    color: var(--color-text-muted);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.hh-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font-size: 1rem;
    padding: var(--space-sm) 0;
    outline: none;
}

.hh-input::placeholder {
    color: var(--color-text-muted);
    opacity: 0.6;
}

.hh-input--name {
    font-size: 1.6rem;
    font-weight: 700;
    padding: var(--space-xs) 0;
}

.hh-inline-form:focus-within {
    border-bottom-color: var(--color-ink);
}

.hh-inline-form--name {
    border-bottom: none;
}

/* Buttons */
.hh-icon-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--color-text-muted);
    transition:
        transform var(--duration-press) var(--ease-master),
        color 0.2s var(--ease-master),
        background 0.2s var(--ease-master);
}

.hh-icon-btn:active {
    transform: scale(0.9);
    color: var(--color-text);
    background: var(--color-surface-2);
}

.hh-icon-btn .material-symbols-outlined {
    font-size: 1.15rem;
}

.hh-text-btn {
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-primary-dark);
    padding: var(--space-xs) var(--space-sm);
    transition: opacity 0.2s var(--ease-master);
}

.hh-text-btn:active {
    opacity: 0.6;
}

.hh-text-btn--muted {
    color: var(--color-text-muted);
}

.hh-text-btn--danger {
    color: var(--color-danger);
}

.hh-text-btn:disabled {
    color: var(--color-text-muted);
    opacity: 0.45;
    cursor: default;
}

/* Title row + inline rename */
.hh-title-row {
    display: flex;
    align-items: baseline;
    gap: var(--space-xs);
    margin-top: var(--space-lg);
}

.hh-title-row > .hh-icon-btn {
    opacity: 0.4;
    align-self: center;
}

.hh-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.hh-field-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.hh-field-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.hh-code {
    font-family: monospace;
    font-size: 1.15rem;
    letter-spacing: 0.14em;
    color: var(--color-text);
}

.hh-code--sm {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.hh-sheet-opt {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hh-members {
    list-style: none;
    display: flex;
    flex-direction: column;
}

.hh-member {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid rgba(44, 42, 41, 0.1);
}

.hh-member:last-child {
    border-bottom: none;
}

.hh-member-name {
    font-weight: 500;
}

.hh-you {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-left: var(--space-xs);
}

.hh-member-actions {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.hh-hint {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* Discreet settings row opening the AI sheet */
.hh-settings-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-md) 0;
    border-top: 1px solid var(--color-border);
    text-align: left;
    color: var(--color-text-muted);
    transition: color 0.2s var(--ease-master);
}

.hh-settings-row:active {
    color: var(--color-text);
}

.hh-settings-label {
    font-weight: 600;
}

.hh-settings-hint {
    margin-left: auto;
    font-size: 0.8rem;
    font-style: italic;
}

.hh-sheet-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.hh-sheet-form .hh-input {
    border-bottom: 1px solid rgba(44, 42, 41, 0.1);
}

.hh-sheet-form .hh-input:focus {
    border-bottom-color: var(--color-ink);
}

.hh-ai-actions {
    display: flex;
    gap: var(--space-sm);
}

.hh-danger {
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    align-items: flex-start;
}
