:root {
    --ink: #17231e;
    --muted: #6b756f;
    --forest: #244c3d;
    --forest-2: #316653;
    --cream: #f4f1ea;
    --paper: #fffefb;
    --line: #e1e4de;
    --shadow: 0 12px 34px rgba(30, 48, 40, .08);
    --waiting: #9a7100;
    --waiting-bg: #fff4c7;
    --skipped: #68736d;
    --skipped-bg: #edf0ed;
    --doing: #1769b5;
    --doing-bg: #e7f2ff;
    --blocked: #8f3048;
    --blocked-bg: #f9e8ee;
    --fixing: #a6532d;
    --fixing-bg: #ffecdf;
    --done: #237a4b;
    --done-bg: #e4f5ea;
    --danger: #a82d38;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--cream); scroll-behavior: smooth; }
body { min-height: 100%; margin: 0; color: var(--ink); background: var(--cream); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Thai", Tahoma, sans-serif; font-size: 15px; line-height: 1.5; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(27px, 4vw, 40px); line-height: 1.08; letter-spacing: -.035em; }
h2 { margin-bottom: 4px; font-size: 20px; line-height: 1.25; }
h3 { margin-bottom: 3px; font-size: 16px; }
p { margin-bottom: 0; }
.subtle, .help { color: var(--muted); }
.eyebrow { margin: 0 0 7px; color: var(--forest-2); font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }

.topbar { position: sticky; z-index: 20; top: 0; border-bottom: 1px solid rgba(218, 221, 215, .9); background: rgba(255, 254, 251, .93); backdrop-filter: blur(14px); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; width: min(1200px, calc(100% - 32px)); min-height: 62px; margin: auto; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; color: white; background: var(--forest); font-size: 14px; font-weight: 900; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.top-link { padding: 8px 10px; border-radius: 9px; color: var(--forest); font-size: 13px; font-weight: 750; text-decoration: none; }
.top-link:hover { background: #edf3ef; }
.user-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; gap: 7px; color: var(--muted); font-size: 13px; text-decoration: none; }
.user-chip > span:last-child { display: grid; line-height: 1.15; }
.user-chip small { color: #98a19b; font-size: 8px; font-weight: 750; text-transform: uppercase; }
.user-avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 1px solid #d7dfd9; border-radius: 50%; color: var(--forest); background: white; font-size: 11px; font-weight: 800; }
.notification-link { position: relative; display: inline-grid; place-items: center; width: 40px; min-height: 40px; border: 1px solid var(--line); border-radius: 11px; color: var(--forest); background: white; font-size: 22px; text-decoration: none; }
.notification-link strong { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border: 2px solid white; border-radius: 99px; color: white; background: var(--blocked); font-size: 9px; line-height: 15px; text-align: center; }
.notification-link[aria-expanded="true"] { border-color: #91b3a0; background: #edf5f0; box-shadow: 0 0 0 3px rgba(49, 102, 83, .1); }
.notification-popover { position: fixed; z-index: 90; top: 70px; right: 18px; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: min(390px, calc(100% - 36px)); max-height: min(620px, calc(100vh - 88px)); overflow: hidden; border: 1px solid #d8e1db; border-radius: 17px; background: rgba(255, 254, 251, .98); box-shadow: 0 24px 70px rgba(21, 42, 33, .24); backdrop-filter: blur(16px); }
.notification-popover-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.notification-popover-head > div { display: grid; }
.notification-popover-head strong { font-size: 14px; }
.notification-popover-head small { color: var(--muted); font-size: 9px; }
.notification-popover-head .icon-btn { width: 36px; min-height: 36px; }
.notification-popover-list { overflow: auto; overscroll-behavior: contain; }
.notification-popover-form { margin: 0; }
.notification-popover-item { display: grid; grid-template-columns: 9px minmax(0, 1fr) 15px; align-items: center; gap: 10px; width: 100%; min-height: 64px; padding: 11px 13px; border: 0; border-top: 1px solid #edf0ed; color: var(--ink); background: transparent; cursor: pointer; font: inherit; text-align: left; text-decoration: none; }
.notification-popover-item:first-child, .notification-popover-form:first-child .notification-popover-item { border-top: 0; }
.notification-popover-item:hover, .notification-popover-item:focus-visible { background: #f3f7f4; outline: none; }
.notification-popover-item.is-unread { background: #eef7f1; }
.notification-popover-item.is-unread:hover, .notification-popover-item.is-unread:focus-visible { background: #e5f2e9; }
.notification-popover-item.is-unread .notification-dot { background: var(--doing); box-shadow: 0 0 0 4px var(--doing-bg); }
.notification-popover-copy { display: grid; min-width: 0; }
.notification-popover-copy strong { display: -webkit-box; overflow: hidden; font-size: 11px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.notification-popover-copy small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.notification-arrow { color: #8b968f; font-size: 20px; text-align: right; }
.notification-popover-empty { display: grid; justify-items: center; gap: 3px; padding: 34px 18px; color: var(--muted); text-align: center; }
.notification-popover-empty > span { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 5px; border-radius: 50%; color: var(--done); background: var(--done-bg); font-weight: 900; }
.notification-popover-empty strong { color: var(--ink); font-size: 12px; }
.notification-popover-empty small { font-size: 9px; }
.notification-popover-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.notification-popover-foot a { display: inline-flex; align-items: center; min-height: 34px; color: var(--forest); font-weight: 800; text-decoration: none; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; min-height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: white; cursor: pointer; font-size: 19px; }

.site-main { width: min(1200px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 60px; }
.panel { border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: 0 5px 20px rgba(31, 48, 40, .035); }
.page-heading, .dashboard-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.back-link { display: inline-block; margin-bottom: 15px; color: var(--forest); font-size: 13px; font-weight: 750; text-decoration: none; }
.count-badge { padding: 9px 13px; border: 1px solid #d6e0d9; border-radius: 999px; color: var(--forest); background: #edf5f0; font-weight: 800; white-space: nowrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 16px; border: 1px solid transparent; border-radius: 11px; cursor: pointer; font-size: 13px; font-weight: 780; line-height: 1.2; text-decoration: none; transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { cursor: not-allowed; opacity: .42; }
.btn-primary { color: white; background: var(--forest); }
.btn-primary:hover { background: #1a3e31; }
.btn-white { border-color: var(--line); color: var(--ink); background: white; }
.btn-white:hover { border-color: #bfc9c2; }
.btn-sm { min-height: 36px; padding: 7px 11px; border-radius: 9px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-danger { color: white; background: var(--danger); }
.btn-danger-ghost { border-color: #f1c8cc; color: var(--danger); background: #fff7f7; }

.input, .textarea { width: 100%; border: 1px solid #d5dad5; border-radius: 11px; color: var(--ink); background: white; outline: none; font-size: 16px; transition: border-color .15s, box-shadow .15s; }
.input { min-height: 46px; padding: 10px 12px; }
.textarea { min-height: 94px; padding: 11px 12px; resize: vertical; }
.input:focus, .textarea:focus { border-color: var(--forest-2); box-shadow: 0 0 0 3px rgba(49, 102, 83, .12); }
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field > label { font-size: 13px; font-weight: 760; }
.required { color: var(--danger); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.room-creation-choice { min-width: 0; margin: 2px 0 0; padding: 0; border: 0; }
.room-creation-choice > legend { margin-bottom: 8px; font-size: 13px; font-weight: 760; }
.room-creation-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.room-creation-option { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: flex-start; gap: 10px; min-height: 86px; padding: 12px; border: 1px solid #d5dad5; border-radius: 12px; background: white; cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; }
.room-creation-option:hover { border-color: #aebfb4; }
.room-creation-option:has(input:checked) { border-color: var(--forest-2); background: #f1f7f3; box-shadow: 0 0 0 2px rgba(49, 102, 83, .09); }
.room-creation-option input { width: 19px; height: 19px; margin: 1px 0 0; accent-color: var(--forest); }
.room-creation-option span { display: grid; gap: 4px; min-width: 0; }
.room-creation-option strong { color: var(--ink); font-size: 13px; }
.room-creation-option small { color: var(--muted); font-size: 10px; line-height: 1.45; }

.alert { padding: 11px 13px; border: 1px solid; border-radius: 11px; font-size: 13px; }
.alert-success { border-color: #b8dcc5; color: #175d39; background: #eaf7ef; }
.alert-error { border-color: #efc0c4; color: #882731; background: #fff0f1; }
.toast { position: fixed; z-index: 80; top: 76px; right: 18px; max-width: min(360px, calc(100% - 36px)); box-shadow: var(--shadow); }
.live-update-banner { position: fixed; z-index: 75; right: 18px; bottom: 18px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; width: min(680px, calc(100% - 36px)); padding: 11px 12px; border: 1px solid #bcd4c5; border-radius: 15px; background: rgba(255, 254, 251, .97); box-shadow: 0 18px 48px rgba(25, 50, 39, .18); backdrop-filter: blur(14px); }
.live-update-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--done); box-shadow: 0 0 0 5px rgba(35, 122, 75, .12); animation: live-pulse 1.8s ease-in-out infinite; }
.live-update-copy { display: grid; min-width: 0; }
.live-update-copy strong, .live-update-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-update-copy strong { color: var(--forest); font-size: 12px; }
.live-update-copy small { color: var(--muted); font-size: 9px; }
.live-dialog-notice { position: sticky; z-index: 3; top: 70px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 14px; border-bottom: 1px solid #bcd4c5; color: var(--forest); background: #edf6f0; box-shadow: 0 7px 18px rgba(30, 65, 48, .1); }
.live-dialog-notice > span { display: grid; min-width: 0; }
.live-dialog-notice strong, .live-dialog-notice small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-dialog-notice strong { font-size: 11px; }
.live-dialog-notice small { color: var(--muted); font-size: 8px; }
@keyframes live-pulse { 50% { box-shadow: 0 0 0 8px rgba(35, 122, 75, 0); } }

.status-pill { display: inline-flex; align-items: center; justify-content: center; min-height: 28px; padding: 5px 9px; border-radius: 999px; color: var(--skipped); background: var(--skipped-bg); font-size: 11px; font-weight: 800; white-space: nowrap; }
.status-waiting { color: var(--waiting); background: var(--waiting-bg); }
.status-skipped { color: var(--skipped); background: var(--skipped-bg); }
.status-doing { color: var(--doing); background: var(--doing-bg); }
.status-blocked { color: var(--blocked); background: var(--blocked-bg); }
.status-fixing { color: var(--fixing); background: var(--fixing-bg); }
.status-done { color: var(--done); background: var(--done-bg); }

.login-page { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); min-height: 100vh; }
.login-story { display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: clamp(28px, 6vw, 80px); color: white; background: radial-gradient(circle at 75% 15%, #3e735f 0, transparent 34%), linear-gradient(150deg, #183b2e, #285642); }
.login-story .brand-mark { color: var(--forest); background: white; }
.login-brand { display: flex; align-items: center; gap: 10px; font-weight: 850; }
.login-copy { max-width: 600px; margin: auto 0; }
.login-copy .eyebrow { color: #b7d8c6; }
.login-copy h1 { margin-bottom: 20px; font-size: clamp(45px, 7vw, 78px); }
.login-copy p:last-child { max-width: 540px; color: #d9e9e0; font-size: 17px; }
.login-legend { display: flex; flex-wrap: wrap; gap: 7px; }
.login-form-side { display: grid; place-items: center; padding: 28px; background: var(--paper); }
.login-form-wrap { width: min(390px, 100%); }
.login-form-wrap h2 { font-size: 30px; }
.login-form { margin-top: 28px; }
.login-version { margin-top: 22px; color: #9aa29d; font-size: 11px; text-align: center; }

.page-heading-actions, .inline-actions { display: flex; align-items: center; gap: 8px; }
.stock-top-link { position: relative; display: inline-flex; align-items: center; gap: 5px; }
.stock-top-link > strong { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; color: white; background: var(--danger); font-size: 9px; }
.stock-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.stock-stat { display: grid; gap: 2px; min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); }
.stock-stat > span { color: var(--muted); font-size: 11px; }
.stock-stat > strong { overflow: hidden; font-size: 26px; line-height: 1.1; text-overflow: ellipsis; }
.stock-stat > small { color: #9aa39d; font-size: 8px; }
.stock-stat-toBuy { border-color: #efc0c4; background: #fff8f8; }
.stock-stat-toBuy > strong { color: var(--danger); }
.stock-browser { overflow: hidden; }
.stock-controls { display: grid; grid-template-columns: minmax(260px, 1fr) auto; gap: 12px; padding: 0 18px 15px; }
.stock-filter-list { display: flex; gap: 6px; overflow-x: auto; }
.stock-filter-chip { min-height: 44px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: white; cursor: pointer; font-size: 11px; font-weight: 760; white-space: nowrap; }
.stock-filter-chip.is-active { border-color: var(--forest); color: white; background: var(--forest); }
.stock-list-head, .stock-row { display: grid; grid-template-columns: minmax(240px, 1.7fr) repeat(5, minmax(76px, .55fr)); align-items: center; gap: 8px; }
.stock-list-head { padding: 9px 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); background: #f8f8f5; font-size: 9px; font-weight: 800; text-align: right; }
.stock-list-head span:first-child { text-align: left; }
.stock-row { min-height: 74px; padding: 11px 18px; border-bottom: 1px solid #edf0ed; text-decoration: none; transition: background .15s; }
.stock-row:hover { background: #f4f8f5; }
.stock-row.is-archived { opacity: .58; }
.stock-item-name { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-width: 0; }
.stock-item-name > span:nth-child(2) { display: grid; min-width: 0; }
.stock-item-name strong, .stock-item-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stock-item-name strong { font-size: 13px; }
.stock-item-name small { color: var(--muted); font-size: 9px; }
.stock-box-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--forest); background: #e9f2ec; }
.stock-state-label { padding: 4px 7px; border-radius: 99px; color: var(--done); background: var(--done-bg); font-size: 9px; font-style: normal; font-weight: 800; white-space: nowrap; }
.stock-state-shortage .stock-state-label { color: var(--waiting); background: var(--waiting-bg); }
.stock-state-negative .stock-state-label { color: var(--danger); background: #fff0f1; }
.stock-state-unplanned .stock-state-label { color: #66716a; background: #edf0ed; }
.stock-number { display: grid; justify-items: end; }
.stock-number strong { font-size: 14px; }
.stock-number small { color: var(--muted); font-size: 8px; }
.stock-state-negative .stock-number:nth-last-child(2) strong, .stock-state-negative .stock-number:nth-last-child(1) strong { color: var(--danger); }
.stock-manage-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 16px; align-items: start; }
.inventory-manage-list, .material-template-list { padding: 0 18px 18px; }
.inventory-manage-item, .material-template-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 62px; padding: 10px 0; border-top: 1px solid var(--line); }
.material-template-item { grid-template-columns: auto minmax(0, 1fr) auto; }
.inventory-manage-item > div:first-child, .material-template-item > div:nth-child(2) { display: grid; min-width: 0; }
.inventory-manage-item small, .material-template-item small { color: var(--muted); font-size: 9px; }
.inventory-manage-item.is-archived, .material-template-item.is-archived { opacity: .5; }
.template-order { display: flex; align-items: center; gap: 5px; }
.template-order > strong { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 8px; background: #eef2ef; font-size: 10px; }
.template-order form { display: flex; }
.template-order button { width: 28px; height: 32px; border: 0; color: var(--forest); background: transparent; cursor: pointer; }
.inventory-clean-start { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 16px; padding: 18px; border-color: #efc0c4; }
.inventory-clean-start p { color: var(--muted); font-size: 11px; }
.stock-sheet { width: min(680px, calc(100% - 28px)); }
.stock-detail-sheet { max-width: 820px; }
.stock-detail-metrics { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin-bottom: 20px; }
.stock-detail-metrics > div { display: grid; padding: 10px; border-radius: 10px; background: #f3f5f2; }
.stock-detail-metrics span, .stock-detail-metrics small { color: var(--muted); font-size: 8px; }
.stock-detail-metrics strong { font-size: 17px; }
.stock-detail-section { margin-top: 18px; }
.stock-detail-section h3 { margin-bottom: 8px; }
.stock-detail-line, .stock-movement { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 54px; padding: 8px 0; border-top: 1px solid var(--line); text-decoration: none; }
.stock-detail-line > span, .stock-movement > span { display: grid; }
.stock-detail-line small, .stock-movement small { color: var(--muted); font-size: 9px; }
.stock-movement { grid-template-columns: auto minmax(0, 1fr) auto; }
.stock-movement > small { text-align: right; }
.movement-type { min-width: 62px; padding: 5px 7px; border-radius: 8px; color: var(--forest); background: #e9f2ec; font-size: 9px; font-weight: 800; text-align: center; }
.movement-consume { color: var(--waiting); background: var(--waiting-bg); }
.movement-adjustment { color: var(--doing); background: var(--doing-bg); }
.stock-adjust-panel { margin-top: 18px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.stock-adjust-panel summary { min-height: 44px; cursor: pointer; font-weight: 760; }
.stock-adjust-panel form { margin-top: 12px; }
.form-note { color: var(--muted); font-size: 10px; }
.text-danger { color: var(--danger) !important; }
.alert-info { border-color: #b8d3eb; color: #145b91; background: #eef7ff; }

.template-apply-dialog { width: min(720px, calc(100% - 24px)); }
.template-apply-types { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 15px 0; padding: 0; border: 0; }
.template-apply-types legend { grid-column: 1 / -1; margin-bottom: 1px; font-size: 13px; font-weight: 760; }
.template-apply-types label, .template-room-option { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: flex-start; gap: 10px; min-height: 62px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: white; cursor: pointer; }
.template-apply-types label:has(input:checked), .template-room-option:has(input:checked) { border-color: var(--forest-2); background: #f0f7f2; box-shadow: inset 0 0 0 1px rgba(49, 102, 83, .16); }
.template-apply-types input, .template-room-option input { width: 19px; height: 19px; margin: 1px 0 0; accent-color: var(--forest); }
.template-apply-types span, .template-room-option span { display: grid; gap: 3px; min-width: 0; }
.template-apply-types small, .template-room-option small { color: var(--muted); font-size: 9px; }
.template-room-picker-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 14px 0 8px; }
.template-room-picker-head > div:first-child { display: grid; }
.template-room-picker-head small { color: var(--muted); font-size: 9px; }
.template-room-picker-head > div:last-child { display: flex; gap: 5px; }
.template-room-picker-head button { min-height: 40px; padding: 7px 10px; border: 0; color: var(--forest); background: transparent; cursor: pointer; font-weight: 760; }
.template-room-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; max-height: 320px; overflow: auto; }
.template-room-option { min-height: 58px; padding: 10px; }
.template-apply-preview { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 12px; border-radius: 11px; color: var(--forest); background: #edf5f0; }
.template-apply-preview span { color: var(--muted); font-size: 10px; }

.room-material-panel { margin-bottom: 16px; overflow: hidden; }
.room-material-panel > summary { list-style: none; }
.room-material-panel > summary::-webkit-details-marker { display: none; }
.room-material-summary-actions { display: flex; align-items: center; gap: 10px; }
.room-material-list { padding: 0 17px 14px; }
.room-material-item { display: grid; grid-template-columns: minmax(260px, 1.25fr) minmax(280px, 1fr) auto; align-items: center; gap: 14px; min-height: 72px; padding: 10px 0; border-top: 1px solid var(--line); }
.room-material-item.is-skipped { opacity: .58; }
.room-material-name { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 10px; min-width: 0; }
.room-material-name > span:last-child { display: grid; min-width: 0; }
.room-material-name strong, .room-material-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-material-name small { color: var(--muted); font-size: 9px; }
.room-material-numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.room-material-numbers > span { display: grid; padding: 7px; border-radius: 9px; background: #f4f5f2; }
.room-material-numbers small { color: var(--muted); font-size: 8px; }
.room-material-numbers strong { font-size: 11px; }
.room-material-numbers .is-warning { color: var(--waiting); background: var(--waiting-bg); }
.room-material-numbers .is-ready { color: var(--done); background: var(--done-bg); }
.room-material-actions { display: flex; align-items: center; gap: 5px; }
.compact-empty { padding: 22px; }
.stock-after-preview { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; padding: 12px; border-radius: 11px; background: #f3f5f2; }
.task-material-chip { display: inline-flex; align-items: center; width: fit-content; margin-top: 3px; padding: 3px 6px; border-radius: 7px; color: var(--done); background: var(--done-bg); font-size: 8px; font-style: normal; font-weight: 800; }
.task-material-chip.is-shortage { color: var(--danger); background: #fff0f1; }
.stock-completion-list { display: grid; gap: 7px; margin: 16px 0; }
.stock-completion-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; }
.stock-completion-item > span { display: grid; }
.stock-completion-item small { color: var(--muted); font-size: 9px; }

.template-notice { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 13px 15px; border: 1px solid #d8e4dc; border-radius: 14px; color: var(--forest); background: #edf5f0; font-size: 13px; }
.template-notice span { color: var(--muted); }
.template-editor { display: grid; grid-template-columns: minmax(220px, .65fr) minmax(0, 1.35fr); align-items: end; gap: 20px; margin-bottom: 14px; padding: 17px; }
.template-editor-copy p:last-child { color: var(--muted); font-size: 12px; }
.template-add-form { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(190px, .8fr) auto; align-items: end; gap: 10px; }
.template-add-form .field { margin: 0; }
.template-add-form .btn { min-height: 46px; }
.phase-template-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.template-phase { padding: 16px; }
.phase-title-row { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.phase-title-row h2 { font-size: 17px; }
.phase-title-row p { color: var(--muted); font-size: 12px; }
.phase-number { display: inline-grid; flex: 0 0 auto; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: white; background: var(--forest); font-size: 13px; font-weight: 850; }
.template-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; counter-reset: template; }
.template-list > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 10px 2px; border-top: 1px solid #eceeea; counter-increment: template; font-size: 13px; }
.template-list > li.is-focused { margin: 0 -7px; padding-right: 7px; padding-left: 7px; border-radius: 9px; background: #edf5f0; }
.template-list > li.template-empty { display: block; padding: 20px 2px; color: var(--muted); text-align: center; counter-increment: none; }
.template-item-copy { display: grid; min-width: 0; }
.template-item-name { font-weight: 720; line-height: 1.35; }
.template-item-name::before { content: counter(template) ". "; color: #9aa39d; font-weight: 500; }
.template-item-copy small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.template-item-copy code { color: #87918b; font-size: 8px; }
.template-item-actions { display: flex; align-items: center; gap: 4px; }
.template-item-actions form { display: contents; }
.template-icon-btn, .template-text-btn { min-height: 34px; border: 1px solid #dfe4df; border-radius: 8px; color: var(--ink); background: white; cursor: pointer; font-size: 11px; font-weight: 750; }
.template-icon-btn { width: 34px; padding: 0; font-size: 14px; }
.template-text-btn { padding: 6px 8px; }
.template-icon-btn:hover:not(:disabled), .template-text-btn:hover { border-color: #b9c5bd; background: #f8faf8; }
.template-icon-btn:disabled { cursor: not-allowed; opacity: .35; }
.template-text-btn.is-danger { border-color: #f1c8cc; color: var(--danger); background: #fff8f8; }
.template-sync-option { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid #cfe0d5; border-radius: 11px; background: #f1f7f3; cursor: pointer; }
.template-sync-option input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--forest); }
.template-sync-option span { display: grid; gap: 2px; }
.template-sync-option small { color: var(--muted); font-size: 10px; }
.template-impact { padding: 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: #f8f9f7; font-size: 12px; }
.template-delete-warning { margin-bottom: 16px; padding: 12px; border: 1px solid #edc4c8; border-radius: 11px; color: #832b35; background: #fff2f3; }
.template-delete-warning p { margin-top: 4px; color: #81575c; font-size: 11px; }
.template-dialog { width: min(560px, calc(100% - 24px)); }
.permission-note { color: var(--muted); font-size: 9px; white-space: nowrap; }

.role-badge { padding: 8px 12px; border-radius: 999px; font-size: 12px; font-weight: 850; }
.role-owner { color: #6f4a00; background: #fff0bd; }
.role-admin { color: var(--forest); background: #e7f2eb; }
.account-panel { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr); gap: 24px; margin-bottom: 14px; padding: 20px; }
.account-copy p:last-child { color: var(--muted); font-size: 12px; }
.account-form { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 10px; }
.account-form .field { margin: 0; }
.account-form .btn { min-height: 46px; }
.field label small { color: var(--muted); font-weight: 500; }
.user-add-panel { display: grid; grid-template-columns: minmax(190px, .45fr) minmax(0, 1.55fr); gap: 18px; margin-bottom: 18px; padding: 18px; }
.user-add-form { display: grid; grid-template-columns: 1fr 1fr 1fr .8fr auto; align-items: end; gap: 8px; }
.user-add-form .field { margin: 0; }
.user-add-form .btn { min-height: 46px; }
.user-list-section { margin-top: 18px; }
.user-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.user-card { position: relative; padding: 15px; }
.user-card.is-inactive { opacity: .68; }
.user-card-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-bottom: 15px; }
.user-avatar-lg { width: 40px; height: 40px; font-size: 14px; }
.user-card-head h3 { margin: 0; font-size: 15px; }
.user-card-head p { color: var(--muted); font-size: 10px; }
.account-state { padding: 4px 7px; border-radius: 99px; color: var(--done); background: var(--done-bg); font-size: 9px; font-weight: 800; }
.user-card.is-inactive .account-state { color: var(--skipped); background: var(--skipped-bg); }
.user-edit-form .field { margin-bottom: 10px; }
.active-toggle { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; font-size: 11px; font-weight: 700; }
.active-toggle input { width: 18px; height: 18px; accent-color: var(--forest); }
.user-delete-form { position: absolute; top: 62px; right: 15px; }
.notification-panel { overflow: hidden; }
.notification-list { display: grid; }
.notification-item { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); }
.notification-item:first-child { border-top: 0; }
.notification-item.is-unread { background: #f2f8f4; }
.notification-dot { width: 8px; height: 8px; border-radius: 50%; background: #c8ceca; }
.notification-item.is-unread .notification-dot { background: var(--doing); box-shadow: 0 0 0 4px var(--doing-bg); }
.notification-copy { display: grid; }
.notification-copy strong { font-size: 13px; }
.notification-copy small { color: var(--muted); font-size: 10px; }

.hero-actions, .room-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { display: flex; align-items: center; justify-content: space-between; min-height: 74px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); }
.stat span { color: var(--muted); font-size: 12px; }
.stat strong { font-size: 25px; line-height: 1; }
.stat-doing strong { color: var(--doing); }
.stat-blocked strong { color: var(--blocked); }
.dashboard-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 292px; gap: 14px; align-items: start; }
.room-browser { overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 16px 11px; border-bottom: 1px solid #eceeea; }
.panel-heading h2 { font-size: 17px; }
.panel-heading p, .panel-heading > span { color: var(--muted); font-size: 11px; }
.search-area { display: flex; align-items: center; gap: 12px; padding: 12px 14px 9px; }
.search-control { position: relative; flex: 1; }
.search-control > span { position: absolute; z-index: 1; top: 50%; left: 13px; color: #8c9690; transform: translateY(-50%); }
.search-control .input { padding-left: 37px; padding-right: 42px; }
.search-control button { position: absolute; top: 50%; right: 7px; width: 34px; height: 34px; border: 0; border-radius: 9px; color: var(--muted); background: #eff1ee; cursor: pointer; transform: translateY(-50%); }
.search-result-count { color: var(--muted); font-size: 11px; white-space: nowrap; }
.status-filter-list { display: flex; gap: 7px; padding: 3px 14px 12px; overflow-x: auto; scrollbar-width: thin; }
.status-filter-chip { flex: 0 0 auto; min-height: 34px; border: 1px solid transparent; cursor: pointer; }
.status-filter-chip span { margin-left: 5px; opacity: .75; }
.status-filter-chip[aria-pressed="true"] { border-color: currentColor; box-shadow: 0 0 0 2px white, 0 0 0 4px currentColor; }
.room-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px 14px 14px; }
.room-card { display: flex; flex-direction: column; min-height: 145px; padding: 13px 14px 11px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: white; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.room-card:hover { border-color: #bac6bd; box-shadow: 0 8px 22px rgba(31, 48, 40, .08); transform: translateY(-1px); }
.room-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; }
.room-card-top > div { display: grid; min-width: 0; }
.room-card-top strong { font-size: 18px; line-height: 1.15; }
.room-card-top small { color: var(--muted); font-size: 10px; }
.room-card-progress { margin-top: 14px; }
.room-card-progress > div:first-child { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.room-card-progress strong { color: var(--ink); font-size: 15px; }
.progress { height: 6px; overflow: hidden; border-radius: 999px; background: #e8ebe7; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--done); }
.room-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 9px; color: #87908a; font-size: 9px; }
.issue-count { color: var(--blocked); font-weight: 800; }
.room-search-match { margin-top: 7px; padding: 5px 7px; border-radius: 7px; color: #6d5500; background: #fff7d8; font-size: 9px; line-height: 1.3; }
.no-results { display: none; grid-column: 1 / -1; padding: 34px 15px; color: var(--muted); text-align: center; }
.no-results span { display: block; margin-top: 4px; font-size: 12px; }

.panel-summary { display: flex; align-items: center; justify-content: space-between; padding: 14px 15px; cursor: pointer; list-style: none; }
.panel-summary::-webkit-details-marker, .phase-summary::-webkit-details-marker, .legacy-section > summary::-webkit-details-marker, .legacy-item > summary::-webkit-details-marker, .status-history-summary::-webkit-details-marker, .status-history-row::-webkit-details-marker { display: none; }
.panel-summary > span:first-child { display: grid; }
.panel-summary small { color: var(--muted); font-size: 10px; font-weight: 500; }
.chevron { transition: transform .18s ease; }
details[open] > summary .chevron { transform: rotate(180deg); }
.activity-list { display: grid; gap: 0; margin: 0; padding: 0 14px 10px; list-style: none; }
.activity-item { padding: 0; border-top: 1px solid #eceeea; }
.activity-link, .activity-static { position: relative; display: block; min-height: 44px; padding: 11px 28px 11px 1px; color: inherit; text-decoration: none; }
.activity-static { padding-right: 1px; }
.activity-link { margin: 0 -6px; padding-right: 34px; padding-left: 7px; border-radius: 9px; transition: background .16s ease, transform .16s ease; }
.activity-link:hover { background: #f0f5f1; }
.activity-link:active { transform: scale(.99); }
.activity-link:focus-visible { outline: 2px solid var(--forest-2); outline-offset: 2px; }
.activity-arrow { position: absolute; top: 50%; right: 9px; transform: translateY(-50%); color: var(--forest-2); font-size: 22px; font-weight: 500; }
.activity-item strong { display: block; font-size: 12px; }
.activity-item p { margin: 3px 0; color: var(--muted); font-size: 10px; }
.activity-item small { color: #8d9690; font-size: 9px; }
.empty-list { padding: 18px 0; color: var(--muted); text-align: center; }

.room-topline { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.room-topline .back-link { margin: 0; }
.room-topline .subtle { font-size: 11px; }
.room-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 22px; margin-bottom: 10px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: 0 5px 20px rgba(31,48,40,.035); }
.room-title-row { display: flex; align-items: center; gap: 10px; }
.room-title-row h1 { margin-bottom: 0; }
.room-progress-block { grid-column: 1 / -1; }
.room-progress-label, .room-progress-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.room-progress-label { margin-bottom: 6px; font-size: 11px; }
.room-progress-label strong { font-size: 20px; }
.room-progress-meta { margin-top: 6px; color: var(--muted); font-size: 10px; }
.progress-lg { height: 8px; }
.status-counts { display: flex; gap: 7px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: thin; }
.status-count { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; min-height: 34px; padding: 6px 9px; border-radius: 10px; font-size: 10px; font-weight: 750; }
.status-count strong { font-size: 13px; }
.room-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; align-items: start; }
.section-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; padding: 0 2px; }
.section-toolbar h2 { font-size: 17px; }
.section-toolbar p { color: var(--muted); font-size: 11px; }
.room-side-column { position: sticky; top: 76px; }

.phase-section { margin-bottom: 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); overflow: hidden; }
.phase-summary { display: grid; grid-template-columns: 34px minmax(0, 1fr) minmax(88px, 140px) 18px; align-items: center; gap: 11px; padding: 13px 14px; cursor: pointer; list-style: none; }
.phase-summary-copy { display: grid; min-width: 0; }
.phase-summary-copy strong { font-size: 14px; }
.phase-summary-copy small { color: var(--muted); font-size: 10px; }
.phase-summary-progress { display: grid; grid-template-columns: auto minmax(48px, 1fr); align-items: center; gap: 8px; font-size: 12px; }
.mini-progress { display: block; height: 5px; overflow: hidden; border-radius: 99px; background: #e7ebe7; }
.mini-progress i { display: block; height: 100%; border-radius: inherit; background: var(--done); }
.phase-section[open] .phase-summary { border-bottom: 1px solid #e9ece8; background: #fbfcfa; }
.phase-empty { padding: 26px; color: var(--muted); text-align: center; }
.task-list { display: grid; gap: 8px; padding: 9px; }
.task-card { border: 1px solid #e3e6e2; border-radius: 13px; background: white; overflow: hidden; }
.task-card-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 10px 10px 6px; }
.task-toggle { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto 16px; align-items: center; gap: 8px; min-width: 0; padding: 0; border: 0; color: var(--ink); background: transparent; cursor: pointer; text-align: left; }
.task-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.task-order { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: var(--forest); background: #edf3ef; font-size: 11px; font-weight: 850; }
.task-title-copy { display: grid; min-width: 0; }
.task-title-copy strong { overflow: hidden; font-size: 13px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.task-title-copy small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.custom-badge { margin-left: 6px; padding: 2px 5px; border-radius: 5px; color: #765200; background: #fff1bf; font-size: 8px; vertical-align: 1px; }
.task-comment-badge { display: inline-flex; align-items: center; gap: 3px; min-width: 30px; min-height: 26px; padding: 3px 6px; border-radius: 999px; color: #56635c; background: #f0f3f0; font-size: 9px; font-weight: 800; white-space: nowrap; }
.task-comment-badge span { font-size: 10px; }
.task-primary-actions { display: flex; gap: 5px; }
.quick-view-button { display: inline-grid; flex: 0 0 auto; place-items: center; width: 36px; min-height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 9px; color: var(--forest); background: white; cursor: pointer; font-size: 22px; font-weight: 700; line-height: 1; }
.quick-view-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.quick-view-button:hover, .quick-view-button:focus-visible { border-color: #a9beb0; background: #edf5f0; outline: none; }
.quick-status-row { display: flex; gap: 5px; padding: 4px 10px 9px 46px; overflow-x: auto; scrollbar-width: thin; }
.quick-status-row form { flex: 0 0 auto; }
.quick-status-btn { min-height: 32px; padding: 5px 9px; border: 1px solid #e0e4e0; border-radius: 999px; color: #59635d; background: white; cursor: pointer; font-size: 10px; font-weight: 750; white-space: nowrap; }
.quick-status-btn[aria-pressed="true"] { border-color: currentColor; box-shadow: inset 0 0 0 1px currentColor; }
.quick-status-btn[data-status="waiting"] { color: var(--waiting); }
.quick-status-btn[data-status="skipped"] { color: var(--skipped); }
.quick-status-btn[data-status="doing"] { color: var(--doing); }
.quick-status-btn[data-status="blocked"] { color: var(--blocked); }
.quick-status-btn[data-status="fixing"] { color: var(--fixing); }
.quick-status-btn[data-status="done"] { color: var(--done); }
.quick-status-btn:disabled { opacity: 1; cursor: default; }
.quick-status-btn:disabled[data-status="waiting"] { background: var(--waiting-bg); }
.quick-status-btn:disabled[data-status="skipped"] { background: var(--skipped-bg); }
.quick-status-btn:disabled[data-status="doing"] { background: var(--doing-bg); }
.quick-status-btn:disabled[data-status="blocked"] { background: var(--blocked-bg); }
.quick-status-btn:disabled[data-status="fixing"] { background: var(--fixing-bg); }
.quick-status-btn:disabled[data-status="done"] { background: var(--done-bg); }
.task-thumbnails { display: flex; align-items: center; gap: 6px; padding: 0 10px 9px 46px; }
.thumb-button { width: 48px; height: 48px; padding: 0; overflow: hidden; border: 1px solid #dfe3df; border-radius: 9px; background: #eef0ed; cursor: zoom-in; }
.thumb-button { position: relative; }
.thumb-button img, .thumb-button video { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.video-play-badge { position: absolute; right: 4px; bottom: 4px; display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid rgba(255,255,255,.75); border-radius: 50%; color: white; background: rgba(17, 24, 20, .78); font-size: 8px; line-height: 1; pointer-events: none; }
.thumb-small { width: 44px; height: 44px; }
.photo-more { color: var(--muted); font-size: 10px; font-weight: 700; }
.task-panel { padding: 12px 12px 11px 46px; border-top: 1px solid #e9ebe8; background: #fbfcfa; }
.task-panel-head, .quick-view-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.task-panel-head p, .quick-view-summary p { color: var(--muted); font-size: 10px; }
.update-timeline { display: grid; gap: 7px; }
.status-history-group { overflow: hidden; border: 1px solid #dce4de; border-radius: 10px; background: #f7f9f7; }
.status-history-group.is-focused { border-color: #79aa90; box-shadow: 0 0 0 3px rgba(49, 102, 83, .1); }
.status-history-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto 14px; align-items: center; gap: 9px; min-height: 50px; padding: 8px 10px; cursor: pointer; list-style: none; }
.status-history-summary:hover, .status-history-summary:focus-visible { background: #f0f5f1; outline: none; }
.status-history-copy { display: grid; min-width: 0; }
.status-history-copy strong { font-size: 11px; }
.status-history-copy small { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.status-history-list { display: grid; gap: 1px; padding: 5px; border-top: 1px solid #e2e8e3; background: #eef2ef; }
.status-history-item { overflow: hidden; border-radius: 8px; background: white; }
.status-history-item.is-focused { box-shadow: inset 0 0 0 2px #79aa90, 0 0 0 2px rgba(49, 102, 83, .1); }
.status-history-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 14px; align-items: center; gap: 8px; min-height: 44px; padding: 7px 8px; cursor: pointer; list-style: none; }
.status-history-row:hover, .status-history-row:focus-visible, .status-history-item[open] > .status-history-row { background: #f7faf8; outline: none; }
.status-history-row .update-meta { overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.status-history-comment-count { color: var(--muted); font-size: 9px; font-weight: 750; white-space: nowrap; }
.status-history-thread { padding: 0 8px 8px; border-top: 1px solid #edf0ed; }
.status-history-thread .comment-thread { margin-top: 0; padding-top: 8px; }
.update-entry { padding: 10px; border: 1px solid #e1e5e1; border-radius: 10px; background: white; }
.update-entry.is-focused { border-color: #79aa90; box-shadow: 0 0 0 3px rgba(49, 102, 83, .12); }
.update-entry-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.update-meta { color: var(--muted); font-size: 9px; text-align: right; }
.update-note, .update-problem { font-size: 12px; white-space: normal; overflow-wrap: anywhere; }
.update-problem { margin-bottom: 5px; padding: 7px 8px; border-radius: 8px; color: var(--blocked); background: var(--blocked-bg); }
.update-quiet, .timeline-empty { color: var(--muted); font-size: 11px; }
.update-thumbs { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.comment-thread { margin-top: 10px; padding-top: 9px; border-top: 1px solid #edf0ed; }
.comment-thread-task { margin: 0 0 13px; padding: 10px; border: 1px solid #dce7df; border-radius: 11px; background: #f5f9f6; }
.comment-thread.is-focused { border-color: #79aa90; box-shadow: 0 0 0 3px rgba(49, 102, 83, .12); }
.comment-thread-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.comment-thread-heading > div:first-child { display: grid; min-width: 0; }
.comment-thread-heading strong { font-size: 11px; }
.comment-thread-heading small { color: var(--muted); font-size: 8px; }
.comment-thread-actions { display: flex; align-items: center; gap: 4px; }
.comment-text-button { min-height: 30px; padding: 5px 8px; border: 0; border-radius: 8px; color: var(--forest); background: transparent; cursor: pointer; font-size: 9px; font-weight: 800; white-space: nowrap; }
.comment-list { display: grid; gap: 6px; margin-top: 7px; }
.comment-item { position: relative; display: flex; align-items: flex-start; gap: 7px; padding: 8px 62px 8px 8px; border-radius: 9px; background: #f4f6f3; }
.comment-item.is-focused { background: #e9f3ec; box-shadow: inset 0 0 0 1px #8bb49b; }
.comment-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 27px; height: 27px; border-radius: 50%; color: white; background: var(--forest-2); font-size: 9px; font-weight: 850; }
.comment-copy { display: grid; min-width: 0; flex: 1; }
.comment-copy strong { color: var(--forest); font-size: 10px; }
.comment-copy strong small { color: #5b477e; font-size: 8px; font-weight: 750; }
.comment-copy span { font-size: 11px; overflow-wrap: anywhere; }
.comment-copy small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.mention-token { display: inline; padding: 1px 4px; border-radius: 5px; color: #5b3f87; background: #eee8f8; font-weight: 800; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.comment-thumbs { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.comment-thumbs .thumb-button { width: 54px; height: 54px; border-radius: 8px; }
.comment-edit { position: absolute; top: 8px; right: 33px; flex: 0 0 auto; font-size: 9px; }
.comment-edit summary { display: grid; place-items: center; min-width: 28px; min-height: 26px; color: var(--forest); cursor: pointer; font-weight: 750; list-style: none; }
.comment-edit[open] { position: absolute; z-index: 2; top: calc(100% - 3px); right: 0; left: 0; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: white; box-shadow: var(--shadow); }
.comment-edit form { display: grid; gap: 6px; }
.comment-edit .textarea { min-height: 70px; font-size: 16px; }
.comment-delete { position: absolute; top: 6px; right: 6px; }
.comment-delete button { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 7px; color: var(--danger); background: transparent; cursor: pointer; }
.comment-empty { margin: 6px 0 0; color: var(--muted); font-size: 9px; }
.comment-form { display: grid; gap: 5px; margin-top: 9px; }
.comment-compose-shell { border: 1px solid #cad8ce; border-radius: 12px; background: white; box-shadow: 0 1px 2px rgba(24, 46, 36, .04); transition: border-color .16s ease, box-shadow .16s ease; }
.comment-compose-shell:focus-within { border-color: #729d85; box-shadow: 0 0 0 3px rgba(49, 102, 83, .12); }
.comment-compose-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 6px; border-top: 1px solid #edf1ee; }
.mention-field { position: relative; min-width: 0; }
.mention-suggestions { position: relative; z-index: 15; max-height: 230px; margin-top: 4px; padding: 5px; overflow: auto; border: 1px solid #d5dfd8; border-radius: 12px; background: white; box-shadow: 0 12px 28px rgba(24, 46, 36, .14); }
.mention-suggestion { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 44px; padding: 7px 9px; border: 0; border-radius: 9px; color: var(--ink); background: transparent; cursor: pointer; text-align: left; }
.mention-suggestion:hover, .mention-suggestion[aria-selected="true"] { background: #f0ecf7; }
.mention-suggestion-avatar { display: grid; flex: 0 0 auto; place-items: center; width: 29px; height: 29px; border-radius: 50%; color: white; background: #6d568e; font-size: 10px; font-weight: 850; }
.mention-suggestion > span:last-child { display: grid; min-width: 0; }
.mention-suggestion strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.mention-suggestion small { color: #6d568e; font-size: 9px; font-weight: 750; }
.mention-suggestion-empty { padding: 12px 10px; color: var(--muted); font-size: 10px; text-align: center; }
.mention-hint { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 8px; }
.mention-hint > span { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; color: #5b3f87; background: #eee8f8; font-size: 10px; font-weight: 900; }
.comment-compose-shell .textarea { min-height: 58px; padding: 10px 11px 8px; border: 0; border-radius: 12px 12px 0 0; background: transparent; box-shadow: none; font-size: 16px; resize: vertical; }
.comment-compose-shell .textarea:focus { outline: none; box-shadow: none; }
.comment-attachment-preview { display: flex; gap: 7px; padding: 8px; overflow-x: auto; border-top: 1px solid #edf1ee; background: #f8faf8; scrollbar-width: thin; }
.comment-attachment-preview[hidden] { display: none; }
.attachment-preview-item { position: relative; display: grid; flex: 0 0 92px; grid-template-rows: 62px auto; gap: 4px; min-width: 0; padding: 4px; border: 1px solid #dce4de; border-radius: 10px; background: white; }
.attachment-preview-media { position: relative; overflow: hidden; border-radius: 7px; background: #e8ece9; }
.attachment-preview-media img, .attachment-preview-media video { display: block; width: 100%; height: 100%; object-fit: cover; }
.attachment-preview-copy { display: grid; min-width: 0; padding: 0 2px 2px; }
.attachment-preview-copy strong { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.attachment-preview-copy small { color: var(--muted); font-size: 7px; }
.attachment-preview-remove { position: absolute; z-index: 2; top: 1px; right: 1px; display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 2px solid white; border-radius: 50%; color: white; background: rgba(157, 43, 54, .92); cursor: pointer; font-size: 15px; }
.comment-attachment-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.comment-attachment-actions label { position: relative; display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding: 6px 9px; overflow: hidden; border: 0; border-radius: 8px; color: var(--forest); background: #f2f6f3; cursor: pointer; font-size: 9px; font-weight: 800; }
.comment-attachment-actions input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.comment-send-button { flex: 0 0 auto; min-width: 62px; min-height: 34px; }
.comment-upload-limit { color: var(--muted); font-size: 8px; }
.comment-file-summary { margin: 0; color: var(--muted); font-size: 8px; }
.mention-chips { display: flex; align-items: center; gap: 5px; overflow-x: auto; scrollbar-width: thin; }
.mention-chips > span { flex: 0 0 auto; color: var(--muted); font-size: 8px; }
.mention-chips button { flex: 0 0 auto; min-height: 28px; padding: 4px 8px; border: 1px solid #dbe3dc; border-radius: 999px; color: var(--forest); background: white; cursor: pointer; font-size: 9px; font-weight: 800; }
.task-management { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 11px; padding-top: 10px; border-top: 1px solid #e4e8e4; }
.move-actions { display: flex; flex-wrap: wrap; gap: 5px; }

.legacy-section { margin-top: 12px; border: 1px dashed #cfd5d0; border-radius: 14px; background: #f8f9f7; }
.legacy-section > summary { display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; cursor: pointer; list-style: none; }
.legacy-section > summary > span:first-child { display: grid; }
.legacy-section small { color: var(--muted); font-size: 10px; font-weight: 500; }
.legacy-list { display: grid; gap: 6px; padding: 0 9px 9px; }
.legacy-item { border: 1px solid #e0e3df; border-radius: 10px; background: white; }
.legacy-item > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; cursor: pointer; list-style: none; font-size: 12px; }
.legacy-status { padding: 4px 7px; border-radius: 999px; color: #656e68; background: #ecefec; font-size: 9px; font-weight: 750; }
.legacy-body { padding: 0 9px 9px; }

dialog { width: min(680px, calc(100% - 24px)); max-height: min(88vh, 850px); padding: 0; overflow: hidden auto; border: 0; border-radius: 18px; color: var(--ink); background: white; box-shadow: 0 30px 90px rgba(18,35,28,.28); }
dialog::backdrop { background: rgba(18, 30, 25, .56); backdrop-filter: blur(3px); }
.dialog-head { position: sticky; z-index: 2; top: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.dialog-head h2 { margin: 0; font-size: 18px; }
.dialog-body { padding: 16px 18px; }
.dialog-foot { position: sticky; z-index: 2; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: rgba(255,255,255,.97); }
.status-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.status-option input { position: absolute; opacity: 0; pointer-events: none; }
.status-option span { display: grid; place-items: center; min-height: 42px; padding: 7px; border: 1px solid #dfe3df; border-radius: 10px; cursor: pointer; font-size: 11px; font-weight: 750; }
.status-option input:checked + span { border-color: var(--forest); color: var(--forest); background: #edf5f0; box-shadow: inset 0 0 0 1px var(--forest); }
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.upload-card { position: relative; display: grid; align-content: center; gap: 2px; min-height: 82px; padding: 13px; overflow: hidden; border: 1px dashed #aebbb2; border-radius: 12px; cursor: pointer; background: #f8faf8; }
.upload-card span { color: var(--muted); font-size: 10px; }
.upload-card input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-summary { margin-top: 7px; color: var(--muted); font-size: 10px; }
.current-photo-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; margin-top: 14px; }
.photo-manage { position: relative; }
.photo-manage .thumb-button { width: 100%; height: auto; aspect-ratio: 1; }
.photo-delete { position: absolute; top: -5px; right: -5px; width: 24px; height: 24px; border: 2px solid white; border-radius: 50%; color: white; background: var(--danger); cursor: pointer; }
.add-task-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.add-task-option { display: grid; align-content: start; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; }
.add-task-option p { color: var(--muted); font-size: 11px; }
.danger-zone { margin-top: 8px; padding: 13px; border: 1px solid #f0c7ca; border-radius: 12px; background: #fff8f8; }
.danger-zone p { margin: 3px 0 10px; color: var(--muted); font-size: 11px; }
.settings-danger { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 420px); gap: 18px; margin-top: 18px; }
.settings-danger form { display: grid; gap: 10px; align-content: start; }
.lightbox { width: min(1100px, calc(100% - 20px)); background: #111; }
.lightbox .dialog-head { color: white; border-color: #333; background: #111; }
.lightbox-body { display: grid; place-items: center; min-height: 240px; max-height: calc(88vh - 70px); }
.lightbox-body img, .lightbox-body video { display: block; max-width: 100%; max-height: calc(88vh - 70px); object-fit: contain; }
.lightbox-body [hidden] { display: none; }
.empty-page { padding: 45px 20px; text-align: center; }
.empty-mark { display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 15px; color: var(--forest); background: #e7f1eb; font-size: 22px; font-weight: 850; }

.getting-started-card { margin: 0 0 16px; overflow: hidden; border: 1px solid #cddfd4; border-radius: 18px; background: linear-gradient(135deg, #f6fbf7 0%, #fff 70%); box-shadow: var(--shadow); }
.getting-started-card.is-page { max-width: 920px; margin: 0 auto; }
.getting-started-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 22px 16px; }
.getting-started-head h1 { margin: 2px 0 4px; font-size: 24px; }
.getting-started-head p:last-child { margin: 0; color: var(--muted); font-size: 12px; }
.getting-started-progress { display: grid; flex: 0 0 78px; place-items: center; width: 78px; height: 78px; border-radius: 24px; color: white; background: var(--forest); }
.getting-started-progress strong { align-self: end; font-size: 23px; line-height: 1; }
.getting-started-progress span { align-self: start; font-size: 9px; font-weight: 750; }
.getting-started-list { display: grid; gap: 0; margin: 0; padding: 0 22px; list-style: none; }
.getting-started-list li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 11px; min-height: 66px; padding: 10px 0; border-top: 1px solid #e0e9e2; }
.getting-started-number { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 11px; color: var(--forest); background: #e7f1eb; font-size: 12px; font-weight: 850; }
.getting-started-list li.is-complete .getting-started-number { color: white; background: var(--green); }
.getting-started-copy { display: grid; min-width: 0; gap: 2px; }
.getting-started-copy strong { font-size: 13px; }
.getting-started-copy small { color: var(--muted); font-size: 10px; }
.getting-started-done { color: var(--green); font-size: 10px; font-weight: 800; }
.getting-started-foot { display: flex; justify-content: flex-end; padding: 12px 22px 16px; }
.getting-started-foot > a:not(.btn) { min-height: 36px; color: var(--forest); font-size: 11px; font-weight: 800; }

.stock-summary-note { grid-column: 1 / -1; margin: -2px 2px 0; color: var(--muted); font-size: 10px; }
.stock-stat-shortage strong, .stock-stat-negative strong { color: var(--danger); }
.stock-stat-ready strong { color: var(--green); }

.task-filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.task-filter-list { display: flex; align-items: center; gap: 7px; width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; padding: 2px 1px 5px; scrollbar-width: thin; }
.task-filter-chip { display: inline-flex; align-items: center; flex: 0 0 auto; gap: 6px; min-height: 38px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: white; cursor: pointer; font: inherit; font-size: 10px; font-weight: 800; }
.task-filter-chip span { display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #edf1ee; font-size: 9px; }
.task-filter-chip.is-active { color: white; border-color: var(--forest); background: var(--forest); }
.task-filter-chip.is-active span { color: var(--forest); background: white; }
.task-filter-result { flex: 0 0 auto; color: var(--muted); font-size: 10px; }

.lazy-fragment-loading { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 104px; padding: 22px; color: var(--muted); font-size: 11px; }
.lazy-fragment-loading span { width: 18px; height: 18px; border: 2px solid #d9e2dc; border-top-color: var(--forest); border-radius: 50%; animation: lazy-spin .75s linear infinite; }
.lazy-fragment-error { display: grid; place-items: center; gap: 6px; min-height: 120px; padding: 22px; color: var(--muted); text-align: center; }
.lazy-fragment-error strong { color: var(--ink); }
.lazy-task-dialog > [data-task-dialog-content] { min-height: 120px; }
.task-inline-edit { position: relative; }
.task-inline-edit > summary { list-style: none; cursor: pointer; }
.task-inline-edit > summary::-webkit-details-marker { display: none; }
.task-inline-edit > form { position: absolute; z-index: 3; top: calc(100% + 6px); left: 0; display: grid; gap: 8px; width: min(320px, 76vw); padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
@keyframes lazy-spin { to { transform: rotate(360deg); } }

.account-logout { grid-column: 2; align-self: end; }
.mobile-bottom-nav { display: none; }
.room-main-column, .section-toolbar { min-width: 0; }

@media (max-width: 900px) {
    .stock-stats { grid-template-columns: repeat(3, 1fr); }
    .stock-manage-grid { grid-template-columns: 1fr; }
    .room-material-item { grid-template-columns: minmax(0, 1fr) auto; }
    .room-material-numbers { grid-column: 1 / -1; grid-row: 2; }
    .template-editor { grid-template-columns: 1fr; }
    .phase-template-grid { grid-template-columns: 1fr; }
    .dashboard-workspace, .room-workspace { grid-template-columns: 1fr; }
    .room-side-column { position: static; }
    .activity-panel { margin-top: 0; }
    .user-add-panel, .account-panel { grid-template-columns: 1fr; }
    .user-add-form { grid-template-columns: 1fr 1fr; }
    .user-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
    body { font-size: 14px; }
    .topbar-inner { width: calc(100% - 20px); min-height: calc(54px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
    .brand, .top-link, .back-link { display: inline-flex; align-items: center; min-height: 44px; }
    .brand-text, .user-chip > span:last-child { display: none; }
    .top-actions { gap: 5px; }
    .top-actions .top-link, .top-actions .notification-link, .top-actions > form { display: none; }
    .top-link { padding: 7px; font-size: 11px; }
    .stock-top-link { position: relative; width: 44px; min-height: 44px; justify-content: center; padding: 0; }
    .stock-top-link > span:nth-child(2) { display: none; }
    .stock-top-link > strong { position: absolute; top: -3px; right: -3px; }
    .user-avatar { width: 28px; height: 28px; }
    .icon-btn { width: 44px; min-height: 44px; }
    .notification-link { width: 44px; min-height: 44px; }
    .notification-popover { top: calc(59px + env(safe-area-inset-top)); right: 10px; left: 10px; width: auto; max-height: calc(100dvh - 69px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); border-radius: 15px; }
    .notification-popover-head { padding: 11px 12px; }
    .notification-popover-head .icon-btn { width: 44px; min-height: 44px; }
    .notification-popover-item { min-height: 68px; padding: 11px 12px; }
    .notification-popover-foot { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
    .notification-popover-foot a { min-height: 44px; }
    .site-main { width: calc(100% - 20px); padding: 14px 0 calc(94px + env(safe-area-inset-bottom)); }
    h1 { font-size: 27px; }
    .page-heading, .dashboard-hero { align-items: stretch; flex-direction: column; gap: 12px; margin-bottom: 13px; }
    .page-heading-actions { width: 100%; }
    .page-heading-actions { flex-wrap: wrap; }
    .page-heading-actions .btn { flex: 1 1 120px; }
    .stock-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .stock-stat { min-height: 83px; padding: 11px; }
    .stock-stat > strong { font-size: 21px; }
    .stock-stat-empty-rooms { grid-column: 1 / -1; }
    .stock-summary-note { margin-top: 1px; line-height: 1.45; }
    .stock-controls { grid-template-columns: 1fr; padding: 0 10px 10px; }
    .stock-filter-list { margin: 0 -10px; padding: 0 10px 2px; }
    .stock-list-head { display: none; }
    .stock-row { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; min-height: 130px; padding: 11px 10px; }
    .stock-item-name { grid-column: 1 / -1; grid-template-columns: 34px minmax(0, 1fr) auto; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
    .stock-number { justify-items: start; min-width: 0; padding: 5px 2px; }
    .stock-number::before { content: attr(data-label); color: var(--muted); font-size: 7px; white-space: nowrap; }
    .stock-number strong { max-width: 100%; overflow: hidden; font-size: 12px; text-overflow: ellipsis; }
    .stock-number small { display: none; }
    .inventory-manage-list, .material-template-list { padding: 0 11px 11px; }
    .inventory-manage-item, .material-template-item { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px 0; }
    .material-template-item { grid-template-columns: auto minmax(0, 1fr); }
    .material-template-item .inline-actions { grid-column: 1 / -1; }
    .inline-actions { width: 100%; }
    .inline-actions > *, .inline-actions .btn { flex: 1; }
    .inventory-clean-start { align-items: stretch; flex-direction: column; }
    .stock-detail-metrics { grid-template-columns: repeat(3, 1fr); }
    .stock-detail-line { min-height: 64px; }
    .stock-movement { grid-template-columns: auto minmax(0, 1fr); }
    .stock-movement > small { grid-column: 2; text-align: left; }
    .dashboard-hero .subtle { font-size: 11px; }
    .hero-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .btn { min-height: 44px; }
    .btn-sm { min-height: 44px; }
    .stats { grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 9px; }
    .stat { min-height: 66px; padding: 11px 12px; border-radius: 13px; }
    .stat span { font-size: 10px; }
    .stat strong { font-size: 22px; }
    .panel { border-radius: 15px; }
    .panel-heading { padding: 12px; }
    .panel-heading h2 { font-size: 15px; }
    .search-area { align-items: stretch; flex-direction: column; gap: 4px; padding: 10px 10px 6px; }
    .search-result-count { padding-left: 2px; }
    .status-filter-list { margin: 0 -1px; padding: 4px 10px 11px; }
    .status-filter-chip { min-height: 44px; }
    .room-grid { grid-template-columns: 1fr; gap: 8px; padding: 9px; }
    .room-card { min-height: 132px; padding: 12px; }
    .room-card-top strong { font-size: 17px; }
    .room-card-progress { margin-top: 10px; }
    .room-card-footer { padding-top: 7px; }
    .activity-panel { margin-top: 9px; }
    .getting-started-card { margin-right: -1px; margin-left: -1px; border-radius: 15px; }
    .getting-started-head { align-items: flex-start; gap: 10px; padding: 15px 13px 11px; }
    .getting-started-head h1 { font-size: 19px; }
    .getting-started-head p:last-child { font-size: 10px; line-height: 1.5; }
    .getting-started-progress { flex-basis: 62px; width: 62px; height: 62px; border-radius: 18px; }
    .getting-started-progress strong { font-size: 19px; }
    .getting-started-list { padding: 0 13px; }
    .getting-started-list li { grid-template-columns: 34px minmax(0, 1fr); min-height: 68px; gap: 9px; padding: 9px 0; }
    .getting-started-list li .btn, .getting-started-list li .getting-started-done { grid-column: 2; justify-self: stretch; margin-top: -3px; }
    .getting-started-list li .btn { width: 100%; }
    .getting-started-foot { padding: 9px 13px 13px; }
    .room-topline .subtle { display: none; }
    .room-hero { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 15px; }
    .room-title-row { align-items: flex-start; justify-content: space-between; }
    .room-title-row h1 { font-size: 27px; }
    .room-hero-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); order: 3; }
    .room-hero-actions .btn:last-child:nth-child(3) { grid-column: 1 / -1; }
    .room-progress-block { order: 2; }
    .status-counts { gap: 6px; margin-bottom: 10px; }
    .status-count { min-height: 32px; padding: 5px 8px; }
    .room-material-panel { margin: 0 -5px 12px; }
    .room-material-panel .panel-summary { padding: 11px 10px; }
    .room-material-summary-actions .btn { min-width: 44px; min-height: 44px; padding: 7px 10px; }
    .room-material-list { padding: 0 9px 9px; }
    .room-material-item { grid-template-columns: minmax(0, 1fr); gap: 7px; padding: 11px 0; }
    .room-material-numbers { grid-column: auto; grid-row: auto; }
    .room-material-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .room-material-actions .btn { min-height: 44px; padding-right: 7px; padding-left: 7px; }
    .stock-completion-item { min-height: 60px; }
    .section-toolbar { align-items: flex-start; }
    .section-toolbar p { max-width: 230px; }
    .task-filter-bar { align-items: stretch; flex-direction: column; gap: 3px; margin: 0 -1px 9px; }
    .task-filter-list { width: calc(100% + 18px); max-width: calc(100% + 18px); margin: 0 -9px; padding: 2px 9px 5px; }
    .task-filter-chip { min-height: 44px; padding: 8px 12px; }
    .task-filter-result { padding-left: 2px; }
    .phase-section { margin-bottom: 8px; border-radius: 14px; }
    .phase-summary { grid-template-columns: 32px minmax(0, 1fr) auto 14px; gap: 8px; padding: 11px 10px; }
    .phase-number { width: 32px; height: 32px; }
    .phase-summary-copy strong { font-size: 12px; }
    .phase-summary-progress { display: block; font-size: 12px; }
    .phase-summary-progress .mini-progress { display: none; }
    .task-list { gap: 7px; padding: 7px; }
    .task-card-head { grid-template-columns: 1fr; padding: 9px 8px 5px; }
    .task-toggle { grid-template-columns: 27px minmax(0, 1fr) auto auto 14px; gap: 5px; min-height: 44px; }
    .task-order { width: 27px; height: 27px; }
    .task-title-copy strong { font-size: 12px; }
    .task-toggle .status-pill { padding: 4px 6px; font-size: 8px; }
    .task-comment-badge { min-width: 27px; min-height: 25px; padding: 3px 5px; }
    .task-primary-actions { display: grid; grid-template-columns: 44px minmax(0, 1fr); padding-left: 33px; }
    .task-primary-actions .btn { min-height: 44px; }
    .quick-view-button { width: 44px; min-height: 44px; border-radius: 11px; }
    .quick-status-row { margin: 0 -1px; padding: 5px 8px 8px 41px; }
    .quick-status-btn { min-height: 44px; padding: 8px 11px; }
    .task-thumbnails { padding-left: 41px; }
    .thumb-button { width: 44px; height: 44px; }
    .task-panel { padding: 10px 9px; }
    .task-panel-head { align-items: flex-start; }
    .task-management { align-items: stretch; flex-direction: column; }
    .move-actions { display: grid; grid-template-columns: repeat(3, 1fr); }
    .task-management > form .btn { width: 100%; }
    .task-inline-edit > form { position: fixed; z-index: 20; top: auto; right: 8px; bottom: calc(76px + env(safe-area-inset-bottom)); left: 8px; width: auto; }
    .update-entry-head { align-items: flex-start; flex-direction: column; gap: 4px; }
    .update-meta { text-align: left; }
    .form-grid, .upload-grid, .add-task-options, .settings-danger, .account-form, .user-add-form, .user-grid, .room-creation-options, .template-apply-types, .template-room-picker { grid-template-columns: 1fr; }
    .status-options { grid-template-columns: repeat(2, 1fr); }
    .current-photo-grid { grid-template-columns: repeat(4, 1fr); }
    dialog { width: calc(100% - 12px); max-height: calc(96vh - env(safe-area-inset-top) - env(safe-area-inset-bottom)); border-radius: 16px; }
    .dialog-head { padding: 13px 14px; }
    .dialog-body { padding: 13px 14px; }
    .dialog-foot { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
    .dialog-foot .btn { flex: 1; }
    .toast { top: calc(64px + env(safe-area-inset-top)); right: 10px; }
    .live-update-banner { right: 10px; bottom: calc(76px + env(safe-area-inset-bottom)); grid-template-columns: auto minmax(0, 1fr); width: calc(100% - 20px); padding: 11px; }
    .live-update-banner .btn { width: 100%; }
    .live-update-banner [data-live-target] { grid-column: 1 / -1; grid-row: 2; }
    .live-update-banner [data-live-refresh] { grid-column: 1 / -1; grid-row: 3; }
    .live-dialog-notice { top: 69px; padding: 9px 12px; }
    .live-dialog-notice .btn { flex: 0 0 auto; width: auto; min-height: 40px; }
    .template-notice { align-items: flex-start; flex-direction: column; }
    .template-add-form { grid-template-columns: 1fr; }
    .template-list > li { grid-template-columns: 1fr; gap: 9px; padding: 12px 2px; }
    .template-item-actions { display: grid; grid-template-columns: 44px 44px minmax(0, 1fr) minmax(0, 1fr); width: 100%; }
    .template-icon-btn, .template-text-btn { width: 100%; min-height: 44px; }
    .template-item-copy code { display: none; }
    .notification-item { grid-template-columns: 9px minmax(0, 1fr); padding: 13px 11px; }
    .notification-item .btn { grid-column: 2; width: 100%; }
    .user-delete-form { position: static; margin-top: 10px; }
    .comment-thread-heading { align-items: flex-start; flex-direction: column; }
    .comment-thread-actions { width: 100%; overflow-x: auto; }
    .comment-text-button { min-height: 44px; padding: 8px 11px; }
    .comment-item { padding-right: 68px; }
    .comment-edit summary, .comment-delete button { min-width: 44px; min-height: 44px; }
    .comment-edit { top: 0; right: 45px; }
    .comment-delete { top: 0; right: 1px; }
    .comment-compose-toolbar { align-items: stretch; }
    .comment-send-button { min-width: 62px; min-height: 44px; }
    .comment-attachment-actions { flex-wrap: nowrap; overflow-x: auto; }
    .comment-attachment-actions label { flex: 0 0 auto; min-height: 44px; padding: 8px 11px; }
    .comment-attachment-actions small { flex: 0 0 auto; margin-left: 0; }
    .attachment-preview-item { flex-basis: 104px; grid-template-rows: 70px auto; }
    .attachment-preview-remove { width: 44px; height: 44px; top: -3px; right: -3px; }
    .comment-thumbs .thumb-button { width: 62px; height: 62px; }
    .mention-suggestions { max-height: 210px; }
    .mobile-bottom-nav { position: fixed; z-index: 18; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4, 1fr); min-height: calc(64px + env(safe-area-inset-bottom)); padding: 5px 7px env(safe-area-inset-bottom); border-top: 1px solid rgba(33, 64, 52, .14); background: rgba(255,255,255,.97); box-shadow: 0 -10px 30px rgba(26, 53, 42, .1); backdrop-filter: blur(15px); }
    .mobile-bottom-nav a { position: relative; display: grid; place-items: center; align-content: center; gap: 2px; min-width: 0; min-height: 54px; border-radius: 12px; color: var(--muted); font-size: 9px; font-weight: 800; text-decoration: none; }
    .mobile-bottom-nav a.is-active { color: var(--forest); background: #edf5f0; }
    .mobile-bottom-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
    .mobile-bottom-nav strong { position: absolute; top: 3px; left: calc(50% + 8px); display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border: 2px solid white; border-radius: 999px; color: white; background: var(--danger); font-size: 8px; }
    .account-logout { grid-column: auto; width: 100%; }
    .account-logout .btn { width: 100%; }
}

@media (max-width: 760px) {
    .login-page { display: block; }
    .login-story { min-height: 38vh; padding: 24px; }
    .login-copy { margin: 45px 0 28px; }
    .login-copy h1 { margin-bottom: 12px; font-size: 42px; }
    .login-copy p:last-child { font-size: 14px; }
    .login-legend { display: none; }
    .login-form-side { min-height: 62vh; padding: 30px 20px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
