/* Final layout: quiet surfaces, tactile controls, and room for every screen size. */
:root { color-scheme: light; }
.app-startup { position: fixed; z-index: 3000; top: 18px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); display: flex; align-items: center; gap: 14px; padding: 14px 20px; border: 1px solid var(--border-light); border-radius: 20px; background: var(--bg-card); color: var(--text-main); font-size: .85rem; box-shadow: var(--shadow-md); }
.app-startup[hidden] { display: none; }
#app-startup-retry[hidden] { display: none; }
#app-ui { display: contents; }
#app-ui[inert] { pointer-events: none; user-select: none; }
body.ui-dialog-open { overflow: hidden; }
.ui-dialog { margin: auto; width: min(480px, calc(100% - 32px)); max-height: 85vh; max-height: 85dvh; overflow-y: auto; padding: clamp(22px, 5vw, 32px); color: var(--text-main); background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 28px; box-shadow: 0 28px 90px rgba(49, 31, 39, .2); }
.ui-dialog::backdrop { background: rgba(37, 26, 34, .38); backdrop-filter: blur(5px); }
.ui-dialog:not([open]), .ui-dialog [hidden], .ui-dialog-backdrop[hidden] { display: none !important; }
.ui-dialog-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.ui-dialog-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 20px; background: var(--color-primary-light); color: var(--color-primary); font-size: 1.6rem; }
.ui-dialog-close { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--text-muted); background: var(--bg-page); font-size: .9rem; }
.ui-dialog-eyebrow { display: block; color: var(--text-muted); font-size: .64rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 9px; }
.ui-dialog h2 { font: 500 clamp(1.5rem, 5vw, 1.85rem)/1.2 var(--font-serif); letter-spacing: -.025em; margin-bottom: 16px; }
.ui-dialog-message { font-size: .9rem; line-height: 1.8; overflow-wrap: anywhere; white-space: pre-line; }
.ui-dialog-hint { font-size: .76rem; line-height: 1.6; color: var(--text-muted); margin-top: 14px; }
.ui-dialog-field { display: grid; gap: 9px; margin-top: 22px; }
.ui-dialog-field label { font-size: .8rem; font-weight: 600; }
.ui-dialog-field input { width: 100%; min-height: 48px; font-size: 16px; }
.ui-dialog-error { color: #a3324b; font-size: .76rem; line-height: 1.6; }
.ui-dialog input[aria-invalid="true"] { border-color: #a3324b; }
.ui-dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 27px; }
.ui-dialog-actions button { min-height: 44px; min-width: 105px; }
.ui-dialog[data-tone="success"] .ui-dialog-icon { background: var(--color-sage-light); color: #38583c; }
.ui-dialog[data-tone="error"] .ui-dialog-icon, .ui-dialog[data-tone="danger"] .ui-dialog-icon { background: #fff0f1; color: #9c2439; }
.ui-dialog[data-tone="danger"] #ui-dialog-accept { background: #ad3f54; color: white; }
.ui-dialog.is-fallback[open] { display: block; position: fixed; inset: 50% auto auto 50%; transform: translate(-50%, -50%); z-index: 4001; margin: 0; }
.ui-dialog-backdrop { position: fixed; inset: 0; z-index: 4000; background: rgba(37, 26, 34, .38); backdrop-filter: blur(5px); }
@media (prefers-reduced-motion: no-preference) { body:not(.reduce-motion) .ui-dialog[open]:not(.is-fallback) { animation: dialog-appear 180ms ease-out both; } }
@media (max-width: 420px) { .ui-dialog-actions button { flex: 1; } }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 110px; }
html, body { height: auto; min-height: 100%; }
body { min-width: 280px; min-height: 100vh; }
body.modal-open { overflow: hidden; }
.settings-toggle { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; font-size: .85rem; }
.settings-toggle input { width: 20px; height: 20px; }
.modal-content > p { margin-block: 14px; line-height: 1.75; font-size: .9rem; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 4px; }
.nav-item { width: 100%; text-align: left; }
.main-wrapper, .page-container, .header-top-row > *, .planning-panel, .planning-heading > * { min-width: 0; }
.main-wrapper[data-page="budget"] .header-title-row, .main-wrapper[data-page="tasks"] .header-title-row, .main-wrapper[data-page="parametres"] .header-title-row, .main-wrapper[data-page="members"] .header-title-row { display: none; }
.main-wrapper[data-page="budget"] #btn-open-tour, .main-wrapper[data-page="budget"] #btn-open-compare, .main-wrapper[data-page="tasks"] #btn-open-tour, .main-wrapper[data-page="tasks"] #btn-open-compare { display: none; }
.sidebar { top: var(--navbar-height, 60px); height: calc(100vh - var(--navbar-height, 60px)); height: calc(100dvh - var(--navbar-height, 60px)); }
.page-container { padding-bottom: 40px; }
.sync-status { margin: 10px 40px 0; font-size: .72rem; color: var(--text-muted); text-align: right; overflow-wrap: anywhere; }
.sync-status[data-error="true"] { color: #9c2439; background: #fff0f1; padding: 10px 14px; border-radius: 10px; }
.planning-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin: 16px 0 28px; }
.planning-eyebrow { display: block; margin-bottom: 8px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .16em; color: var(--color-primary); }
.planning-heading h2 { font: 500 clamp(1.7rem, 3.2vw, 2.45rem)/1.2 var(--font-serif); letter-spacing: -.035em; margin-bottom: 10px; }
.planning-heading p { color: var(--text-muted); font-size: .86rem; max-width: 480px; }
.planning-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.planning-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.planning-stat { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 22px; padding: 24px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 10px; }
.planning-stat > span { color: var(--text-muted); font-size: .76rem; }
.planning-stat strong { font: 500 clamp(1.4rem, 2.6vw, 2rem)/1.2 var(--font-serif); overflow-wrap: anywhere; }
.planning-stat small { color: var(--text-muted); font-size: .7rem; line-height: 1.6; }
.planning-stat:nth-child(3) { background: var(--color-sage-light); }
.planning-stat.is-over-budget { background: #fff0f1; color: #92233a; }
.planning-progress { height: 8px; background: var(--border-light); border-radius: 999px; margin: 22px 0 30px; overflow: hidden; }
.planning-progress span { display: block; height: 100%; background: var(--color-primary); border-radius: inherit; }
.planning-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.planning-panel { padding: 24px; }
.planning-panel h3 { font: 500 1.3rem/1.3 var(--font-serif); margin-bottom: 14px; }
.planning-hint { color: var(--text-muted); font-size: .78rem; line-height: 1.7; margin-bottom: 14px; }
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.planning-table { width: 100%; border-collapse: collapse; font-size: .8rem; text-align: left; }
.planning-table th { padding: 12px 10px; font-size: .65rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); border-bottom: 1px solid var(--border-light); }
.planning-table td { padding: 14px 10px; border-bottom: 1px solid var(--border-light); }
.planning-expense { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border-light); }
.planning-expense > div:first-child { min-width: 0; }
.planning-expense strong { display: block; font-size: .85rem; overflow-wrap: anywhere; }
.planning-expense small { display: block; font-size: .7rem; color: var(--text-muted); margin-top: 6px; }
.tasks-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.task-column { min-width: 0; background: var(--bg-card-muted); border: 1px solid var(--border-light); border-radius: 22px; padding: 16px; }
.task-column > h3 { font-size: .78rem; font-weight: 600; display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 18px; }
.task-column > h3 > span { display: grid; place-items: center; width: 24px; height: 24px; background: var(--bg-card); border-radius: 50%; color: var(--text-muted); font-size: .68rem; }
.task-card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 16px; padding: 17px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.task-card h4 { font-size: .88rem; line-height: 1.55; margin: 13px 0 10px; overflow-wrap: anywhere; }
.task-card > p { font-size: .76rem; line-height: 1.65; color: var(--text-muted); white-space: pre-line; overflow-wrap: anywhere; margin-bottom: 16px; }
.task-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 7px; font-size: .62rem; color: var(--text-muted); }
.task-meta > span { overflow-wrap: anywhere; }
.task-meta [class^="priority-"] { padding: 4px 7px; background: var(--color-primary-light); border-radius: 6px; }
.task-meta .priority-haute, .task-meta .is-late { color: #982338; background: #fff0f1; }
.task-meta .priority-basse { background: var(--color-sage-light); color: #37553a; }
.task-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border-light); }
.task-footer select { min-width: 0; width: auto; flex: 1; font-size: .7rem; padding: 7px; }
.task-footer .planning-actions { gap: 4px; }
.task-empty { padding: 35px 12px; text-align: center; color: var(--text-muted); font: 400 1.2rem var(--font-handwriting); }
.task-card.is-complete { background: var(--color-sage-light); }
.task-card.is-complete h4 { text-decoration: line-through; text-decoration-thickness: 1px; }
.text-button { padding: 8px 0; color: var(--color-primary); font-size: .82rem; text-decoration: underline; text-underline-offset: 3px; }
.modal-overlay { display: none; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; z-index: 1300; }
.modal-overlay.open { display: flex; }
.modal-content { max-width: min(100%, 600px); max-height: calc(100dvh - 40px); max-height: calc(100svh - 40px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; flex-shrink: 0; }
.house-list-dialog { max-height: 85vh; max-height: 85dvh; }
.form-group { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin-bottom: 16px; }
.form-input, .form-select, .form-textarea { max-width: 100%; min-width: 0; }
img { height: auto; }
.member-row, .inbox-item-card { gap: 12px; }
.breadcrumbs { row-gap: 0; }
.theme-card img { aspect-ratio: 2 / 1; }
.gallery-card img { transition: filter .25s ease; }
@keyframes finish-reveal { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes finish-flower { 0%,100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
@keyframes finish-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: no-preference) {
  body:not(.reduce-motion) .planning-stat, body:not(.reduce-motion) .task-column, body:not(.reduce-motion) .task-card { animation: finish-reveal .32s cubic-bezier(.2,.7,.2,1) backwards; }
  .planning-stat:nth-child(2), .task-column:nth-child(2) { animation-delay: 40ms; }
  .planning-stat:nth-child(3), .task-column:nth-child(3) { animation-delay: 80ms; }
  .planning-progress span { transform-origin: left; animation: finish-progress .6s cubic-bezier(.2,.7,.2,1); }
  .task-card, .planning-stat { transition: box-shadow .2s ease, border-color .2s ease; }
  .nav-item-icon { display: inline-block; transition: transform .2s ease; }
  .nav-item:hover .nav-item-icon { transform: translateY(-2px) rotate(-5deg); }
  .sidebar-logo-img { animation: finish-flower 8s ease-in-out 2; }
  .btn-primary, .btn-secondary { transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease; }
  .btn-primary:active, .btn-secondary:active { transform: scale(.96); }
  .modal-close-btn:hover { transform: rotate(8deg); }
  .task-card:hover { box-shadow: var(--shadow-md); border-color: var(--color-primary); }
}
@media (hover: none) { .gallery-card:hover, .btn-primary:hover, .btn-secondary:hover { transform: none; } }
@media (max-width: 1200px) { .tasks-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } .task-column:last-child { grid-column: 1 / -1; } }
@media (max-width: 992px) {
  .planning-summary { gap: 12px; }
  .planning-stat { padding: 20px; }
  .sync-status { margin-inline: 20px; }
  .sidebar { top: 60px; height: calc(100vh - 60px); height: calc(100dvh - 60px); padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .sidebar-backdrop { top: 60px; z-index: 140; }
}
@media (max-width: 767px) {
  input, textarea, select, .form-input, .form-select, .form-textarea { font-size: 16px !important; }
  .planning-summary { grid-template-columns: 1fr; }
  .planning-stat { padding: 20px; }
  .planning-stat strong { font-size: 1.8rem; }
  .planning-columns, .tasks-board { grid-template-columns: 1fr; }
  .task-column:last-child { grid-column: auto; }
  .planning-heading { gap: 16px; margin-top: 12px; }
  .planning-heading > .planning-actions { width: 100%; max-width: 100%; flex-shrink: 1; }
  .planning-heading > .planning-actions > button { flex: 1; min-width: 0; }
  .planning-panel { padding: 20px; }
  .sync-status { margin-inline: 14px; text-align: left; }
  .page-container { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  .mobile-bottom-nav { height: calc(60px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); }
  .header-actions-right { gap: 6px; flex-wrap: wrap; }
  .form-row { flex-direction: column; gap: 0; }
  [style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }
  .inbox-item-card { flex-wrap: wrap; }
  .inbox-item-card > div { flex-basis: 100% !important; }
  .member-row { flex-wrap: wrap; }
  .task-footer .project-edit-btn, .task-footer .project-delete-btn { width: 44px; }
  .modal-content { padding: 22px; border-radius: 20px; }
  .claramour-global-navbar { padding-inline: 10px; gap: 8px; }
  .nav-right-actions { gap: 5px; }
  .nav-brand-text { font-size: 1.1rem; }
  .theme-pill-btn { padding-inline: 10px; }
  #nav-guest-actions button { padding: 6px 9px !important; font-size: .72rem !important; }
  .user-pill-btn { padding: 4px 7px; }
  #top-user-name { max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
  .nav-main-links { display: flex; position: static; gap: 3px; }
  .claramour-global-navbar { height: auto; min-height: 60px; flex-wrap: wrap; padding-block: 8px; }
  .nav-main-links { order: 3; flex-basis: 100%; justify-content: center; border-top: 1px solid var(--border-light); padding-top: 5px; }
  .nav-link-btn { flex: 1; font-size: .75rem; padding: 7px 8px; }
  .sidebar { top: 104px; height: calc(100dvh - 104px); }
  .sidebar-backdrop { top: 104px; }
  .guest-mode-banner { position: static; flex-wrap: wrap; padding: 10px 14px; }
  .nav-right-actions { margin-left: auto; }
}
@media (max-width: 420px) { .nav-brand-text { display: none; } .theme-pill-btn { font-size: .72rem; } .nav-brand-logo { width: 28px; height: 28px; } }
@media (max-width: 360px) {
  .nav-brand-group { display: none; }
  #top-theme-label { display: none; }
  .nav-right-actions { width: 100%; justify-content: center; margin: 0; }
  .theme-pill-btn { gap: 4px; }
}
@media (max-width: 992px) {
  .sidebar { top: var(--navbar-height, 60px); height: calc(100vh - var(--navbar-height, 60px)); height: calc(100dvh - var(--navbar-height, 60px)); }
  .sidebar-backdrop { top: var(--navbar-height, 60px); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }

/* Claramour palette collection and permanent navigation. */
.claramour-global-navbar { position: fixed; inset: 0 0 auto; }
#app-ui { padding-top: var(--navbar-height, 60px); }
.nav-brand-logo { width: 174px; height: 44px; object-fit: contain; border-radius: 0; }
.nav-brand-group:hover .nav-brand-logo { transform: translateY(-1px); }
.theme-dropdown-menu { max-height: min(70dvh, 520px); overflow-y: auto; }
.theme-dropdown-item { gap: 12px; min-height: 44px; }
.palette-dot { display: inline-block; width: 15px; height: 15px; border-radius: 50%; flex-shrink: 0; box-shadow: inset 0 0 0 1px #0001; }
.palette-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.theme-card { padding: 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.theme-card h3 { font: 600 1.05rem var(--font-serif); }
.theme-card p { font-size: .73rem; line-height: 1.5; color: var(--text-muted); flex: 1; }
.theme-card button { justify-content: center; min-height: 44px; padding: 7px 10px; font-size: .75rem; }
.palette-swatches { display:flex; height: 40px; flex-shrink: 0; border-radius: 8px; overflow: hidden; }
.palette-swatches span { flex: 1; transition: flex .25s ease; }
.palette-swatches:hover span:hover { flex: 1.6; }
.theme-card.is-selected { border-color:var(--color-primary); box-shadow:0 0 0 2px var(--color-primary-light); }
.sidebar { padding: 22px 14px 100px; background: linear-gradient(165deg,var(--bg-card),var(--bg-sidebar)); scrollbar-width:thin; scrollbar-color:var(--border-subtle) transparent; }
.sidebar-brand { align-items:flex-start; margin-bottom:18px; padding-inline:12px; gap:10px; }
.sidebar-logo-container { width:100%; height:auto; }
.sidebar-logo-img { width:170px; height:42px; object-fit:contain; border-radius:0; animation:none !important; }
.sidebar-brand-title { font:500 1.15rem var(--font-serif); color:var(--text-main); }
.sidebar-nav { gap:4px; }
.sidebar-section-label { margin:19px 12px 8px; font-size:.62rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--text-muted); }
.sidebar .nav-item { position:relative; min-height:44px; border-radius:12px; border:1px solid transparent; padding:10px 12px; gap:12px; font-size:.82rem; transition:background .2s, border-color .2s, transform .2s; }
.sidebar .nav-item.active { background:var(--bg-card); border-color:var(--border-light); color:var(--text-main); box-shadow:var(--shadow-sm); }
.sidebar .nav-item.active::before { content:''; position:absolute; left:0; width:3px; height:18px; background:var(--color-primary); border-radius:3px; }
.sidebar .nav-item-icon { font-size:1.05rem; width:24px; height:26px; display:grid; place-items:center; background:var(--color-primary-light); border-radius:8px; }
.sidebar .nav-item .nav-badge { background:var(--bg-card-muted); color:var(--text-muted); font-size:.65rem; }
.sidebar .house-selector-btn { background:var(--bg-card); border:1px solid var(--border-light); box-shadow:var(--shadow-sm); border-radius:14px; min-height:60px; }
.sidebar-signature { margin:28px 12px 0; border-top:1px solid var(--border-light); padding-top:16px; font-size:.7rem; color:var(--text-muted); }
.sidebar-signature span { color:var(--color-primary); }
.floating-companion { z-index:1090; background:var(--bg-card); padding:14px 28px 14px 14px; border:1px solid var(--border-light); border-radius:18px; align-items:center; box-shadow:var(--shadow-md); max-width:310px; }
.floating-companion[hidden] { display:none !important; }
.companion-bubble { background:transparent; padding:0; box-shadow:none; border:0; animation:none; font-size:.72rem; max-width:175px; }
.companion-char { width:78px; height:32px; object-fit:contain; filter:none; }
.companion-dismiss { position:absolute; top:2px; right:2px; width:28px; height:28px; border:0; border-radius:50%; background:transparent; color:var(--text-muted); pointer-events:auto; cursor:pointer; font-size:1.1rem; }
.companion-dismiss:hover { background:var(--color-primary-light); }
.btn-primary { color:var(--text-inverse); }
body:is([data-theme="minuit"], [data-theme="graphite"], [data-theme="crepuscule"]) .companion-bubble, body:is([data-theme="minuit"], [data-theme="graphite"], [data-theme="crepuscule"]) .modal-content, body:is([data-theme="minuit"], [data-theme="graphite"], [data-theme="crepuscule"]) .form-input, body:is([data-theme="minuit"], [data-theme="graphite"], [data-theme="crepuscule"]) .form-select, body:is([data-theme="minuit"], [data-theme="graphite"], [data-theme="crepuscule"]) .form-textarea, body:is([data-theme="minuit"], [data-theme="graphite"], [data-theme="crepuscule"]) .home-feature-card, body:is([data-theme="minuit"], [data-theme="graphite"], [data-theme="crepuscule"]) .member-row { background:var(--bg-card); color:var(--text-main); }
body:is([data-theme="minuit"], [data-theme="graphite"], [data-theme="crepuscule"]) .note-card { color:#352732; }

@media (prefers-reduced-motion:no-preference) {
 body:not(.reduce-motion) .sidebar .nav-item:hover { transform:translateX(3px); }
 body:not(.reduce-motion) .sidebar .nav-item:hover .nav-item-icon { animation:nav-icon-wave .35s ease; }
 @keyframes nav-icon-wave { 50% { transform:translateY(-2px) rotate(-7deg); } }
}
@media (max-width:768px) {
 .nav-brand-logo { width:130px; height:36px; }
 .floating-companion { display:flex; left:12px; bottom:max(12px,env(safe-area-inset-bottom)); max-width:280px; }
 .companion-dismiss { width:36px; height:36px; top:-8px; right:-8px; background:var(--bg-card); border:1px solid var(--border-light); }
 .member-row { flex-wrap:wrap; gap:12px; }
}
@media (max-width:480px) { .palette-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .nav-brand-logo { width:108px; height:32px; } }
/* Use palette surfaces for translucent controls as well. */
.btn-secondary, .btn-secondary:hover { background:var(--bg-card); }
body:is([data-theme="minuit"], [data-theme="graphite"], [data-theme="crepuscule"]) .guest-mode-banner { background:var(--bg-card); color:var(--text-main); border-color:var(--border-light); }
body:is([data-theme="minuit"], [data-theme="graphite"], [data-theme="crepuscule"]) .modal-close { color:var(--text-main); }
body:is([data-theme="minuit"], [data-theme="graphite"], [data-theme="crepuscule"]) .ui-dialog-hint { color:var(--text-muted); }

.guest-mode-banner { position:relative; top:auto; z-index:40; }
body:is([data-theme="minuit"], [data-theme="graphite"], [data-theme="crepuscule"]) .guest-banner-text { color:var(--text-muted); }
@media (max-width:768px) {
 .nav-brand-group { display:flex; flex-shrink:0; }
 .nav-right-actions { width:auto; margin-left:auto; gap:4px; }
 .nav-right-actions .icon-btn { width:32px; min-width:32px; height:36px; padding:4px; }
 .theme-pill-btn { gap:5px; padding:7px 8px; white-space:nowrap; max-width:126px; }
 #top-theme-label { overflow:hidden; text-overflow:ellipsis; max-width:88px; }
 #nav-guest-actions { gap:0 !important; }
 #nav-guest-actions button:first-child { font-size:0 !important; width:36px; height:36px; padding:0 !important; justify-content:center; }
 #nav-guest-actions button:first-child::before { content:'👤'; font-size:17px; }
 #nav-guest-actions button + button { display:none; }
 #top-user-name { display:none; }
 .user-pill-avatar { width:26px; height:26px; }
}
@media (max-width:360px) { .nav-brand-logo { width:80px; } .theme-pill-btn { max-width:104px; } #top-theme-label { max-width:65px; } }
.sidebar-close { display:none; }
@media (max-width:992px) {
 .sidebar { visibility:hidden; transition:transform var(--transition-smooth), visibility var(--transition-smooth); }
 .sidebar.open { visibility:visible; }
 .sidebar-close { display:grid; place-items:center; position:absolute; right:8px; top:8px; width:36px; height:36px; border:1px solid var(--border-light); background:var(--bg-card); color:var(--text-main); border-radius:50%; font-size:1.3rem; }
 .sidebar-brand { padding-top:15px; }
}
@media (max-width:768px) { .floating-companion { bottom:max(84px,env(safe-area-inset-bottom)); } }
body:has(.sidebar.open) .floating-companion { visibility:hidden; }
/* Keep the page in normal flow below its fixed header, and let sticky navigation follow the document scroll. */
#app-ui { display:block; }
html, body { overflow-x:clip; }
.sidebar { align-self:flex-start; }
html:has(body:is([data-theme="minuit"], [data-theme="graphite"], [data-theme="crepuscule"])) { color-scheme:dark; }

@media (min-width:481px) and (max-width:1199px) { .palette-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:359px) { .palette-grid { grid-template-columns:1fr; } }

/* A common heading and action rhythm across every house category. */
.main-wrapper:not([data-page="vue-ensemble"]) .header-title-row { display:none; }
.main-wrapper:not([data-page="vue-ensemble"]):not([data-page="favoris"]) #btn-open-tour,
.main-wrapper:not([data-page="vue-ensemble"]):not([data-page="favoris"]) #btn-open-compare { display:none; }
.header-top-row { gap:16px; flex-wrap:wrap; align-items:center; }
.header-actions-right { margin-left:auto; display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.page-container { width:100%; max-width:1280px; margin-inline:auto; }
.section-stack { display:flex; flex-direction:column; gap:24px; }
.section-heading { display:flex; align-items:flex-end; justify-content:space-between; flex-wrap:wrap; gap:18px 24px; margin:16px 0 26px; }
.section-heading-copy { flex:1 1 300px; min-width:0; }
.section-title, .header-title-group h1 { font:500 clamp(1.65rem,3vw,2.4rem)/1.2 var(--font-serif); letter-spacing:-.025em; color:var(--header-title-color); margin:0 0 10px; }
.section-heading p, .header-title-group .header-subtitle { color:var(--text-muted); font-size:.86rem !important; line-height:1.7; max-width:640px; text-transform:none; letter-spacing:0; }
.section-heading:has(> .section-title) { display:block; }
.section-actions, .house-primary-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:10px; }
.section-heading > button, .section-actions > button, .house-primary-actions > button { min-height:44px; border-radius:12px; white-space:normal; text-align:center; justify-content:center; }
.section-stack > .section-heading { margin-bottom:0; }
.header-title-row { align-items:flex-end; gap:24px; padding-top:12px; }
.header-title-group { flex:1 1 320px; }
.section-heading .planning-eyebrow { margin-bottom:10px; }
@media(max-width:768px) {
 .top-header { padding:18px 18px 8px; }
 .page-container { padding-inline:18px; }
 .section-heading { align-items:stretch; gap:16px; margin-top:12px; }
 .section-heading-copy { flex-basis:100%; }
 .section-actions, .house-primary-actions { width:100%; justify-content:flex-start; }
 .section-heading > button { align-self:flex-start; }
 .header-title-group { flex-basis:auto; }
 .house-primary-actions > button { flex:1 1 140px; }
 .section-actions > button { flex:1 1 150px; }
}

/* The same photo import control for creation and every edit form. */
.photo-picker { display:flex; flex-direction:column; gap:12px; padding:18px; border:1px dashed var(--color-primary); border-radius:16px; background:var(--bg-card-muted); }
.photo-picker > strong { font-size:.9rem; }
.photo-picker-preview { width:100%; height:180px; object-fit:contain; border-radius:10px; background:var(--bg-card); }
.photo-picker-preview[hidden] { display:none; }
.photo-picker-actions { display:flex; gap:8px; flex-wrap:wrap; }
.photo-picker-actions button { min-height:44px; justify-content:center; flex:1 1 150px; font-size:.8rem; }
.photo-picker-hint { font-size:.73rem; color:var(--text-muted); line-height:1.65; }
.photo-picker-status { font-size:.78rem; line-height:1.6; color:var(--text-main); }
.photo-picker-status:empty { display:none; }
.photo-picker[aria-busy="true"] { opacity:.8; }
@media(max-width:480px) { .photo-picker { padding:14px; } .photo-picker-preview { height:140px; } }
