/* Shared UI contract. Loaded after bundle.css; no data or business behavior. */
body:has(.thread){--thread-on-primary:#fff;--thread-danger:#a52235;--thread-success:#217348;font-family:'Segoe UI',sans-serif;height:auto;min-height:100dvh}
html[data-theme=dark] body:has(.thread){--thread-on-primary:#291c43;--thread-danger:#ffb4be;--thread-success:#98d6af;color-scheme:dark}
body:has(.thread) .thread{flex-shrink:0;min-width:0;padding-top:86px}
.thread-standard{width:auto;max-width:none;margin:0;padding-top:86px;line-height:1.6}
.thread-standard>form,.thread-form>div,.thread-detail>div,.thread-detail>form,.thread-detail>section{max-width:780px}
.thread-standard h1{line-height:1.2;overflow-wrap:anywhere}
.thread-standard>header:first-child{padding-right:100px;margin-bottom:24px}
.thread-standard :is(.bg-base-100,.bg-base-200,.card),.thread-builder .card{background:var(--thread-surface);color:var(--thread-ink);border-radius:20px}
.thread-standard .bg-base-300{background:var(--thread-stage);color:var(--thread-ink)}
.thread :is(.btn,.thread-action),.thread-sheet .thread-action{min-height:44px;height:auto;padding:10px 16px;border-radius:14px;font-size:13px;line-height:1.4;font-weight:600;box-shadow:none;text-decoration:none;white-space:normal}
.thread .btn{background:var(--thread-stage);color:var(--thread-ink);border:1px solid var(--thread-outline)}
.thread :is(.btn-primary,.thread-action),.thread-sheet .thread-action,.outfit-schedule button,.trip-visual .trip-selection-save button{background:var(--thread-primary);color:var(--thread-on-primary);border-color:transparent}
.thread .btn-error{background:transparent;border-color:var(--thread-danger);color:var(--thread-danger)}
.thread .btn-ghost{background:transparent}
.thread .btn-circle{width:44px;min-width:44px;padding:10px;border-radius:50%}
.thread :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea){background:var(--thread-surface);color:var(--thread-ink);border:1px solid var(--thread-outline);border-radius:12px;min-height:44px;max-width:100%;font:inherit;font-size:14px;box-sizing:border-box}
.thread :is(input,textarea)::placeholder{color:var(--thread-muted);opacity:1}
.thread input[type=date]{color-scheme:light}
html[data-theme=dark] .thread input[type=date]{color-scheme:dark}
.thread .filter-row input[type=search]{background:var(--thread-surface);color:var(--thread-ink)}
.thread .browse-chip[aria-pressed=true]{color:var(--thread-ink)}
body:has(.thread) .dock{background:var(--thread-surface);color:var(--thread-muted);border-color:var(--thread-outline);padding-bottom:env(safe-area-inset-bottom);height:auto;min-height:72px;display:grid;grid-template-columns:repeat(5,minmax(0,1fr))}
body:has(.thread) .dock>a{color:var(--thread-muted);min-height:56px}
body:has(.thread) .dock>a:is(.dock-active,[aria-current=page]){color:var(--thread-ink);background:var(--thread-lilac)}
.dock-more{position:relative;min-width:0;color:inherit}
.dock-more summary{list-style:none;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:56px;gap:4px;cursor:pointer;border-radius:14px;font-size:12px}
.dock-more summary::-webkit-details-marker{display:none}
.dock-more summary>span:first-child{font-size:23px;line-height:24px}
.dock-more[open] summary,.dock-more:has([aria-current=page]) summary{background:var(--thread-lilac,#e9e2f6);color:var(--thread-ink,#2d263b)}
.dock-more nav{position:absolute;right:4px;bottom:72px;width:210px;max-width:85vw;background:var(--thread-surface,#fff);color:var(--thread-ink,#2d263b);border:1px solid var(--thread-outline,#d7cde6);border-radius:18px;padding:8px;box-shadow:0 12px 40px #0003}
.dock-more nav a{display:block;min-height:44px;padding:10px 14px;border-radius:12px}
.dock-more nav a:hover{background:var(--thread-stage,#f0ebf7)}
body:has(.thread) :is(a,button,input,select,textarea,summary):focus-visible{outline:3px solid var(--thread-primary);outline-offset:3px}
.thread .calendar-week-nav{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-bottom:18px}
.calendar-week-nav span{font-weight:600}
.thread.calendar-page #week-grid>div{border:1px solid var(--thread-outline);border-radius:20px;background:var(--thread-surface)}
.calendar-page [data-calendar-plan] summary{justify-content:flex-start;color:var(--thread-primary)}
.calendar-page [data-calendar-plan]>a{font-weight:400;color:var(--thread-muted)}
.thread.suggestion-page{padding:86px clamp(16px,3vw,40px) 112px;max-width:none;margin:0}
.thread.suggestion-page :is(.suggestion-card,.suggestion-context,.suggestion-help){background:var(--thread-surface);border:1px solid var(--thread-outline);border-radius:20px;padding:20px}
.thread.suggestion-page .suggestion-card[data-rank='1']{border:2px solid var(--thread-primary)}
.thread.suggestion-page .suggestion-preview{background:var(--thread-stage);border-radius:16px}
.thread.suggestion-page .suggestion-controls{flex-wrap:wrap}
.thread.suggestion-page .suggestion-card .btn{min-height:44px}
.thread.suggestion-page #suggestion-date-form{display:flex;flex-wrap:wrap;align-items:end;gap:12px}
.thread.suggestion-page #suggestion-date-form label{display:grid;gap:6px}
.thread-standard .text-base-content\/40,.thread-standard .text-base-content\/50,.thread-standard .text-base-content\/60{color:var(--thread-muted)}
@media(min-width:901px){body:has(.thread) .dock{display:none}.thread-standard,.thread.suggestion-page{margin-left:88px}.thread-form,.thread-detail{padding-right:max(40px,calc((100vw - 900px)/2))}}
@media(max-width:900px){.thread-standard,.thread.suggestion-page{padding-top:82px;padding-bottom:120px}.thread-standard .thread-head:first-child .thread-action{position:static}.thread-standard .thread-head{flex-wrap:wrap}.thread-standard>header:first-child{padding-right:0}}
@media(prefers-reduced-motion:reduce){.thread *,.thread-sheet *{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
@media print{.thread-rail,.thread-tools,.dock{display:none!important}.thread{margin:0!important}}
