:root {
  --bg: #f6f3ed;
  --surface: rgba(255,255,252,.88);
  --surface-solid: #fffdf9;
  --text: #263640;
  --muted: #778188;
  --line: rgba(38,50,58,.10);
  --soft: rgba(94,117,133,.08);
  --shadow: 0 14px 34px rgba(35,35,28,.09);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --accent: #587687;
  --danger: #b3261e;
  --success: #236a43;
  --safe-bottom: max(20px, env(safe-area-inset-bottom));
}

* { box-sizing: border-box; }
html, body { margin:0; padding:0; background:var(--bg); color:var(--text); font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,Helvetica,Arial,sans-serif; }
body { min-height:100vh; }
button, input, textarea, select { font: inherit; }
button { color:inherit; }
svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.hidden { display:none !important; }

.app-shell { min-height:100vh; }
.topbar {
  position:sticky; top:0; z-index:30; height:78px;
  display:flex; align-items:center; gap:12px; padding:12px clamp(16px,4vw,34px);
  background:rgba(244,244,240,.86); backdrop-filter: blur(18px) saturate(150%);
  border-bottom:1px solid rgba(20,20,20,.05);
}
.brand { display:flex; align-items:center; gap:12px; min-width:0; cursor:pointer; flex:1; }
.brand-mark { width:39px; height:39px; border-radius:13px; display:grid; place-items:center; background:#587687; color:#fff; font-weight:700; letter-spacing:-.03em; font-size:14px; box-shadow:0 7px 18px rgba(0,0,0,.12); }
.brand-name { font-weight:650; letter-spacing:-.025em; line-height:1.05; }
.brand-sub { color:var(--muted); font-size:12px; margin-top:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:48vw; }
.top-actions { display:flex; gap:4px; }
.icon-btn { width:42px; height:42px; border-radius:50%; border:0; background:transparent; display:grid; place-items:center; cursor:pointer; }
.icon-btn:hover { background:var(--soft); }

.main { max-width:1180px; margin:0 auto; padding:38px clamp(18px,5vw,50px) 120px; }
.hero { margin:12px 0 30px; }
.eyebrow { text-transform:uppercase; letter-spacing:.12em; font-size:11px; font-weight:700; color:var(--muted); }
h1 { margin:8px 0 10px; font-size:clamp(36px,6vw,64px); line-height:.98; letter-spacing:-.055em; font-weight:700; }
h2 { margin:0; font-size:clamp(25px,4vw,36px); letter-spacing:-.035em; }
h3 { margin:0; font-size:18px; letter-spacing:-.02em; }
p { line-height:1.55; }
.lead { color:#525252; font-size:17px; max-width:700px; margin:0; }

.home-summary { display:grid; grid-template-columns:1.45fr .8fr .8fr; gap:14px; margin:26px 0 34px; }
.summary-card { background:var(--surface); border:1px solid rgba(255,255,255,.7); border-radius:var(--radius-xl); padding:24px; box-shadow:var(--shadow); backdrop-filter:blur(12px); }
.summary-main { min-height:150px; display:flex; flex-direction:column; justify-content:space-between; }
.home-address { color:var(--muted); margin-top:6px; }
.summary-stat { font-size:36px; letter-spacing:-.045em; font-weight:650; }
.summary-label { color:var(--muted); font-size:13px; margin-top:5px; }
.progress { height:8px; border-radius:999px; background:rgba(20,20,20,.08); overflow:hidden; margin-top:14px; }
.progress > span { display:block; height:100%; background:#1d1d1d; border-radius:inherit; }

.section-row { display:flex; align-items:end; justify-content:space-between; gap:18px; margin:34px 0 16px; }
.section-copy { color:var(--muted); font-size:14px; margin-top:5px; }
.text-btn { border:0; background:transparent; padding:8px 0; cursor:pointer; font-weight:600; }
.text-btn:hover { opacity:.66; }

.room-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:15px; }
.room-card { border:0; text-align:left; background:var(--surface-solid); border-radius:var(--radius-xl); min-height:176px; padding:22px; cursor:pointer; box-shadow:0 7px 26px rgba(30,30,24,.07); transition:transform .18s ease, box-shadow .18s ease; position:relative; overflow:hidden; }
.room-card:hover { transform:translateY(-2px); box-shadow:0 12px 34px rgba(30,30,24,.11); }
.room-card:active { transform:scale(.99); }
.room-icon { width:49px; height:49px; display:grid; place-items:center; border-radius:16px; background:var(--soft); margin-bottom:24px; }
.room-icon svg { width:25px; height:25px; }
.room-name { font-weight:650; font-size:19px; letter-spacing:-.02em; }
.room-meta { color:var(--muted); font-size:13px; margin-top:7px; }
.room-arrow { position:absolute; right:20px; bottom:20px; opacity:.38; }

.room-head { display:flex; justify-content:space-between; gap:20px; align-items:flex-end; margin-bottom:25px; }
.room-title-wrap { display:flex; gap:16px; align-items:center; }
.room-title-icon { width:60px; height:60px; border-radius:19px; background:var(--surface-solid); display:grid; place-items:center; box-shadow:0 8px 24px rgba(30,30,24,.08); }
.room-title-icon svg { width:29px; height:29px; }
.room-actions { display:flex; gap:8px; flex-wrap:wrap; }
.btn { border:0; border-radius:999px; padding:11px 16px; cursor:pointer; font-weight:620; background:#191919; color:white; box-shadow:0 5px 14px rgba(0,0,0,.12); }
.btn.secondary { background:var(--surface-solid); color:var(--text); box-shadow:none; border:1px solid var(--line); }
.btn.ghost { background:transparent; color:var(--text); box-shadow:none; border:1px solid var(--line); }
.btn.danger { background:var(--danger); }
.btn:disabled { opacity:.42; cursor:not-allowed; }

.dropzone { border:1.5px dashed rgba(20,20,20,.2); background:rgba(255,255,255,.42); border-radius:var(--radius-xl); padding:26px; display:flex; align-items:center; justify-content:space-between; gap:18px; margin:18px 0 28px; cursor:pointer; transition:.18s ease; }
.dropzone.dragover { background:white; transform:scale(1.005); border-color:#1b1b1b; }
.drop-title { font-weight:650; }
.drop-copy { color:var(--muted); font-size:13px; margin-top:4px; }
.drop-icon { width:48px; height:48px; border-radius:16px; background:#587687; color:white; display:grid; place-items:center; flex:0 0 auto; }

.product-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.product-card { background:white; border-radius:var(--radius-lg); padding:20px; box-shadow:0 7px 22px rgba(30,30,24,.065); border:1px solid rgba(20,20,20,.035); }
.product-top { display:flex; justify-content:space-between; gap:12px; }
.product-type { color:var(--muted); font-size:12px; margin-bottom:4px; text-transform:uppercase; letter-spacing:.075em; font-weight:650; }
.product-name { font-size:20px; font-weight:650; letter-spacing:-.025em; }
.product-brand { color:var(--muted); font-size:13px; margin-top:4px; }
.product-menu { border:0; background:var(--soft); width:36px; height:36px; border-radius:50%; cursor:pointer; display:grid; place-items:center; }
.product-details { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:19px 0; }
.detail-label { color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:.08em; }
.detail-value { margin-top:3px; font-size:13px; overflow-wrap:anywhere; }
.doc-chips { display:flex; flex-wrap:wrap; gap:7px; margin-top:14px; }
.doc-chip { border:0; border-radius:999px; background:var(--soft); padding:7px 10px; font-size:12px; cursor:pointer; display:inline-flex; align-items:center; gap:6px; max-width:100%; }
.doc-chip span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:180px; }
.add-file-chip { background:#587687; color:white; }
.product-notes { border-top:1px solid var(--line); margin-top:17px; padding-top:15px; color:#4f4f4f; font-size:13px; white-space:pre-wrap; }

.room-notes { background:#fff; border-radius:var(--radius-xl); padding:22px; margin-top:30px; box-shadow:0 7px 22px rgba(30,30,24,.055); }
.notes-header { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:10px; }
.notes-content { white-space:pre-wrap; color:#4f4f4f; min-height:34px; }
.notes-empty { color:#9a9a9a; }

.inbox { margin-top:30px; }
.file-list { display:flex; flex-direction:column; gap:9px; }
.file-row { display:flex; align-items:center; gap:12px; background:white; border-radius:17px; padding:12px 14px; border:1px solid rgba(20,20,20,.04); }
.file-type { width:38px; height:38px; border-radius:12px; background:var(--soft); display:grid; place-items:center; font-size:10px; font-weight:700; color:#585858; flex:0 0 auto; }
.file-info { min-width:0; flex:1; }
.file-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; font-weight:600; }
.file-meta { color:var(--muted); font-size:11px; margin-top:2px; }
.file-actions { display:flex; gap:4px; }
.mini-btn { border:0; background:transparent; padding:7px; border-radius:10px; cursor:pointer; color:#555; }
.mini-btn:hover { background:var(--soft); }

.fab { position:fixed; right:max(22px, calc((100vw - 1180px)/2 + 22px)); bottom:calc(var(--safe-bottom) + 4px); z-index:25; width:58px; height:58px; border-radius:50%; border:0; background:#587687; color:#fff; display:grid; place-items:center; box-shadow:0 14px 34px rgba(0,0,0,.24); cursor:pointer; }
.fab svg { width:26px; height:26px; }

.empty-state { background:rgba(255,255,255,.55); border:1px dashed rgba(20,20,20,.16); border-radius:var(--radius-xl); padding:40px 24px; text-align:center; color:var(--muted); }
.empty-state strong { color:var(--text); display:block; font-size:18px; margin-bottom:7px; }

.modal-backdrop { position:fixed; inset:0; z-index:100; background:rgba(0,0,0,.28); backdrop-filter:blur(6px); display:flex; align-items:flex-end; justify-content:center; padding:20px; }
.modal { width:min(650px,100%); max-height:min(88vh,850px); overflow:auto; background:#fdfdfb; border-radius:30px; box-shadow:0 30px 80px rgba(0,0,0,.25); padding:22px; animation:sheetIn .2s ease; }
@keyframes sheetIn { from { transform:translateY(15px); opacity:.3; } }
.modal-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:18px; }
.modal-title { font-size:22px; font-weight:690; letter-spacing:-.035em; }
.close-btn { border:0; width:36px; height:36px; border-radius:50%; background:var(--soft); cursor:pointer; display:grid; place-items:center; }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:13px; }
.field { display:flex; flex-direction:column; gap:7px; }
.field.full { grid-column:1/-1; }
.field label { font-size:12px; color:#676767; font-weight:600; }
.field input, .field textarea, .field select, .search-input { width:100%; border:1px solid var(--line); background:white; border-radius:14px; padding:12px 13px; outline:none; }
.field input:focus, .field textarea:focus, .field select:focus, .search-input:focus { border-color:rgba(0,0,0,.35); box-shadow:0 0 0 3px rgba(0,0,0,.04); }
.field textarea { min-height:105px; resize:vertical; }
.modal-actions { display:flex; justify-content:flex-end; gap:9px; margin-top:20px; }
.action-list { display:flex; flex-direction:column; gap:9px; }
.action-item { border:0; background:white; border-radius:18px; padding:14px 15px; text-align:left; cursor:pointer; display:flex; align-items:center; gap:13px; }
.action-item:hover { background:#f6f6f2; }
.action-icon { width:38px; height:38px; border-radius:12px; background:var(--soft); display:grid; place-items:center; }
.action-copy strong { display:block; }
.action-copy small { color:var(--muted); display:block; margin-top:2px; }

.search-wrap { max-width:760px; margin:0 auto; }
.search-input { font-size:18px; border-radius:18px; padding:16px 18px; box-shadow:0 8px 25px rgba(30,30,24,.05); }
.search-results { margin-top:20px; display:flex; flex-direction:column; gap:10px; }
.search-result { background:white; border-radius:18px; padding:15px 16px; cursor:pointer; border:1px solid var(--line); }
.search-result:hover { transform:translateY(-1px); }
.result-kicker { color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:.08em; font-weight:700; }
.result-title { font-weight:650; margin-top:3px; }
.result-copy { color:var(--muted); font-size:13px; margin-top:4px; }

.settings-card { background:white; border-radius:var(--radius-xl); padding:22px; margin-bottom:14px; }
.settings-row { display:flex; justify-content:space-between; align-items:center; gap:18px; padding:13px 0; border-bottom:1px solid var(--line); }
.settings-row:last-child { border-bottom:0; }
.settings-note { color:var(--muted); font-size:12px; margin-top:4px; }

.toast { position:fixed; left:50%; bottom:calc(var(--safe-bottom) + 76px); z-index:200; transform:translate(-50%,20px); background:#587687; color:#fff; padding:11px 16px; border-radius:999px; font-size:13px; opacity:0; pointer-events:none; transition:.2s ease; white-space:nowrap; max-width:90vw; overflow:hidden; text-overflow:ellipsis; box-shadow:0 12px 35px rgba(0,0,0,.24); }
.toast.show { opacity:1; transform:translate(-50%,0); }

.onboard { min-height:calc(100vh - 140px); display:grid; place-items:center; }
.onboard-card { width:min(740px,100%); background:rgba(255,255,255,.78); border-radius:34px; padding:clamp(26px,6vw,54px); box-shadow:0 22px 65px rgba(35,35,28,.1); backdrop-filter:blur(12px); }
.onboard-logo { width:66px; height:66px; border-radius:21px; background:#587687; color:#fff; display:grid; place-items:center; font-weight:750; margin-bottom:28px; }
.onboard h1 { font-size:clamp(42px,7vw,70px); }
.onboard-form { display:grid; gap:12px; margin-top:30px; }
.big-input { border:1px solid var(--line); background:#fff; border-radius:17px; padding:15px 16px; font-size:16px; outline:none; }
.big-input:focus { border-color:rgba(0,0,0,.4); }
.start-btn { margin-top:6px; border:0; background:#587687; color:#fff; border-radius:17px; padding:15px 18px; font-weight:650; cursor:pointer; }
.privacy-note { color:var(--muted); font-size:12px; margin-top:14px; line-height:1.5; }

@media (max-width: 850px) {
  .home-summary { grid-template-columns:1fr 1fr; }
  .summary-main { grid-column:1/-1; }
  .room-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .product-grid { grid-template-columns:1fr; }
}
@media (max-width: 560px) {
  .topbar { height:68px; padding:10px 13px; }
  .brand-sub { display:none; }
  .brand-mark { width:36px; height:36px; }
  .main { padding:27px 14px 110px; }
  h1 { font-size:43px; }
  .home-summary { gap:10px; }
  .summary-card { padding:18px; border-radius:22px; }
  .room-grid { grid-template-columns:1fr 1fr; gap:10px; }
  .room-card { min-height:145px; border-radius:22px; padding:17px; }
  .room-icon { width:42px; height:42px; margin-bottom:19px; }
  .room-name { font-size:16px; }
  .room-meta { font-size:11px; }
  .room-arrow { right:15px; bottom:15px; }
  .room-head { align-items:flex-start; flex-direction:column; }
  .room-title-icon { width:52px; height:52px; }
  .dropzone { padding:20px; }
  .drop-copy { max-width:250px; }
  .form-grid { grid-template-columns:1fr; }
  .field.full { grid-column:auto; }
  .modal-backdrop { padding:0; align-items:flex-end; }
  .modal { border-radius:28px 28px 0 0; max-height:92vh; padding-bottom:calc(22px + env(safe-area-inset-bottom)); }
  .fab { right:18px; }
}

/* HomeWorks cloud + AI integration */
.hw-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:0 0 24px}.hw-action{display:flex;align-items:center;gap:14px;text-align:left;border:1px solid #dedbd3;background:#faf9f5;color:#33322e;border-radius:22px;padding:18px;min-height:86px}.hw-action.primary{background:#3d3c37;color:#fff;border-color:#3d3c37}.hw-action-icon{font-size:28px;line-height:1}.hw-action strong{display:block;font-size:16px}.hw-action small{display:block;margin-top:4px;opacity:.7;font-weight:500;line-height:1.3}.hw-known{font-size:15px;margin-top:7px}.hw-glyph{font-size:24px;display:grid;place-items:center}.hw-worker-card,.hw-ask-card{display:flex;gap:15px;align-items:flex-start;background:#f1eee7;border:1px solid #ded9cf;border-radius:22px;padding:18px;margin:0 0 24px}.hw-worker-card.success{background:#eaf0e8}.hw-worker-card.error{background:#f4e6e3}.hw-worker-card.review{display:block}.hw-worker-card p{margin:5px 0;color:#6d685f;line-height:1.45}.hw-check{width:36px;height:36px;border-radius:50%;background:#fff;display:grid;place-items:center;font-weight:800}.hw-spinner{width:30px;height:30px;border:3px solid #d0cbc0;border-top-color:#4a4943;border-radius:50%;animation:hwspin .8s linear infinite;flex:none}@keyframes hwspin{to{transform:rotate(360deg)}}.hw-ask-card{display:block;background:#fbfaf6}.hw-ask-card form{display:grid;gap:12px;margin-top:10px}.hw-ask-card textarea{resize:vertical}.hw-answer{margin-top:16px;background:#e9efe7;border-radius:18px;padding:16px}.hw-answer.not-found{background:#f2ede3}.hw-answer small,.hw-answer span{display:block;color:#79746b;font-size:12px}.hw-answer p{font-size:20px;line-height:1.35;margin:8px 0 12px;color:#2f2e2a}.hw-thinking{padding:16px 0;color:#777168}.hw-room-list{display:grid;gap:12px}.hw-item{background:#faf9f5;border:1px solid #e0ddd5;border-radius:20px;padding:18px}.hw-item h3{margin:5px 0}.hw-item p{margin:5px 0;color:#6f6a61}.empty-state{background:#f4f1eb;border-radius:20px;padding:22px}.empty-state h3{margin-top:0}
@media(max-width:620px){.hw-actions{grid-template-columns:1fr}.hw-action{min-height:76px}}
@media(prefers-reduced-motion:reduce){.hw-spinner{animation:none}}

/* HomeWorks v0.4 polish */
.topbar{background:rgba(243,241,235,.88);border-bottom:1px solid rgba(38,50,58,.06)}
.brand-mark,.onboard-logo,.fab,.start-btn{background:#587687}
.start-btn:hover,.fab:hover{background:#465e6b}
.hw-action.primary{background:linear-gradient(145deg,#526b79,#405965);border-color:transparent;box-shadow:0 12px 28px rgba(64,89,101,.16)}
.hw-action:not(.primary){background:#fffefa;border-color:rgba(38,50,58,.08)}
.hw-upload-action{cursor:default;align-items:flex-start}
.hw-action-copy{flex:1;min-width:0}
.quick-upload-row{display:flex;gap:9px;margin-top:13px;flex-wrap:wrap}
.quick-upload{border:1px solid rgba(255,255,255,.28);background:rgba(255,255,255,.14);color:#fff;border-radius:13px;padding:10px 13px;font-weight:650;cursor:pointer;box-shadow:none}
.quick-upload:hover{background:rgba(255,255,255,.22)}
.room-card,.summary-card,.hw-item,.onboard-card{border-color:rgba(38,50,58,.055)}
.room-icon{color:#526b79;background:rgba(82,107,121,.09)}
.hw-worker-card{background:#eceae3;border-color:rgba(38,50,58,.08)}
.hw-worker-card.success,.hw-answer{background:#e5eee8}
.hw-check{color:#567363}
.hw-spinner{border-color:#ccd3d3;border-top-color:#526b79}
.big-input:focus{border-color:rgba(82,107,121,.55);box-shadow:0 0 0 3px rgba(82,107,121,.08)}
@media(max-width:720px){.hw-actions{grid-template-columns:1fr}.quick-upload{flex:1}.hw-action{min-height:unset}}

/* =========================================================
   HomeWorks beta 0.5 — warm Apple-ish polish + native upload
   ========================================================= */
:root{
  --bg:#f4f1ea;
  --surface:rgba(253,252,248,.90);
  --surface-solid:#fdfcf8;
  --text:#2b353d;
  --muted:#737b7d;
  --line:rgba(43,53,61,.085);
  --soft:rgba(87,111,123,.085);
  --accent:#5b7480;
  --accent-deep:#435d69;
  --accent-soft:#e8edec;
  --success:#547360;
  --success-soft:#e5eee8;
  --danger:#a65b52;
  --shadow:0 14px 36px rgba(50,55,50,.075);
}
html,body{background:var(--bg);color:var(--text)}
body{background:linear-gradient(180deg,#f7f4ee 0%,#f3f0e9 100%);background-attachment:fixed}
.topbar{background:rgba(247,244,238,.88);border-bottom:1px solid rgba(43,53,61,.055);backdrop-filter:blur(22px) saturate(145%)}
.brand-mark,.onboard-logo,.fab,.start-btn,.drop-icon{background:var(--accent);box-shadow:none}
.brand-copy{min-width:0}.brand-line{display:flex;align-items:center;gap:8px}.brand-name{color:var(--text)}
.build-badge{font-size:9px;text-transform:uppercase;letter-spacing:.07em;font-weight:700;color:var(--accent-deep);background:var(--accent-soft);border:1px solid rgba(67,93,105,.08);padding:3px 6px;border-radius:999px}
.icon-btn{color:var(--text)}.icon-btn:hover{background:rgba(87,111,123,.08)}
.lead{color:#596267}.summary-card,.room-card,.hw-item,.onboard-card,.settings-card,.product-card,.room-notes,.file-row{background:var(--surface-solid);border:1px solid rgba(43,53,61,.045);box-shadow:var(--shadow)}
.summary-card{box-shadow:0 10px 30px rgba(50,55,50,.055)}
.room-card:hover{box-shadow:0 14px 34px rgba(50,55,50,.09)}
.room-icon,.room-title-icon,.action-icon,.file-type{background:var(--accent-soft);color:var(--accent-deep)}
.btn{background:var(--accent-deep);color:#fff}.btn.secondary,.btn.ghost{background:var(--surface-solid);color:var(--text);border-color:var(--line)}
.text-btn{color:var(--accent-deep)}
.progress{background:rgba(43,53,61,.07)}.progress>span{background:var(--accent)}
.start-btn{background:var(--accent-deep);box-shadow:0 8px 22px rgba(67,93,105,.12)}.start-btn:hover{background:#39535f}
.big-input,.field input,.field textarea,.field select,.search-input{background:#fffefb;border-color:rgba(43,53,61,.10);color:var(--text)}
.big-input:focus,.field input:focus,.field textarea:focus,.field select:focus,.search-input:focus{border-color:rgba(91,116,128,.55);box-shadow:0 0 0 3px rgba(91,116,128,.08)}
.fab{background:var(--accent-deep);box-shadow:0 13px 30px rgba(53,76,87,.22);cursor:pointer;-webkit-tap-highlight-color:transparent}
.toast{background:var(--accent-deep);box-shadow:0 12px 34px rgba(53,76,87,.20)}
.empty-state{background:rgba(253,252,248,.65);border-color:rgba(43,53,61,.13)}
.hw-worker-card{background:#eeece6;border-color:rgba(43,53,61,.07)}.hw-worker-card.success,.hw-answer{background:var(--success-soft)}
.hw-check{color:var(--success);background:#f9fbf9}.hw-spinner{border-color:#ccd3d3;border-top-color:var(--accent)}
.hw-ask-card{background:#fbfaf6;border-color:rgba(43,53,61,.07)}

/* Main AI ingestion surface */
.home-hero{margin-bottom:22px}
.home-upload-box{display:flex;align-items:flex-start;gap:18px;background:linear-gradient(145deg,#6f8996 0%,#58717e 100%);color:#fff;border-radius:30px;padding:26px;margin:0 0 16px;box-shadow:0 18px 42px rgba(67,93,105,.16);border:1px solid rgba(255,255,255,.12);transition:transform .16s ease,box-shadow .16s ease}
.home-upload-box.dragover{transform:translateY(-2px);box-shadow:0 22px 48px rgba(67,93,105,.22);outline:2px solid rgba(255,255,255,.55);outline-offset:3px}
.home-upload-box.compact{padding:22px;border-radius:26px;margin-bottom:22px}
.upload-box-icon{width:58px;height:58px;flex:0 0 58px;border-radius:19px;display:grid;place-items:center;background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.12)}
.upload-box-icon svg{width:29px;height:29px;stroke:#fff}
.upload-box-copy{flex:1;min-width:0}.home-upload-box .eyebrow{color:rgba(255,255,255,.72)}
.home-upload-box h2{font-size:clamp(25px,4vw,34px);margin:5px 0 7px;color:#fff}.home-upload-box p{margin:0;color:rgba(255,255,255,.82);max-width:720px;line-height:1.45}
.upload-buttons{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}.upload-btn{min-height:46px;display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:15px;padding:11px 16px;font-weight:680;cursor:pointer;-webkit-tap-highlight-color:transparent;user-select:none}
.upload-btn svg{width:20px;height:20px}.upload-btn.primary{background:#fff;color:var(--accent-deep);border:1px solid rgba(255,255,255,.7)}.upload-btn.secondary{background:rgba(255,255,255,.12);color:#fff;border:1px solid rgba(255,255,255,.25)}
.upload-btn:active{transform:scale(.985)}.upload-btn:focus-visible{outline:3px solid rgba(255,255,255,.65);outline-offset:3px}
.desktop-drop-note{font-size:11px;color:rgba(255,255,255,.58);margin-top:11px}

/* Native file inputs stay real, but visually out of the layout. This is intentional for iOS. */

.ask-home-card{width:100%;display:flex;align-items:center;gap:14px;text-align:left;background:var(--surface-solid);border:1px solid rgba(43,53,61,.055);border-radius:24px;padding:17px 18px;margin:0 0 22px;box-shadow:0 9px 28px rgba(50,55,50,.055);cursor:pointer;color:var(--text)}
.ask-home-card:hover{transform:translateY(-1px)}.ask-icon{width:45px;height:45px;flex:0 0 45px;border-radius:15px;background:var(--accent-soft);color:var(--accent-deep);display:grid;place-items:center}.ask-icon svg{width:23px;height:23px}.ask-home-card strong{display:block;font-size:17px}.ask-home-card small{display:block;color:var(--muted);margin-top:3px;font-size:13px}.ask-arrow{margin-left:auto;font-size:30px;font-weight:300;color:#98a0a0}

.hw-room-list{display:grid;gap:12px}.hw-item{border-radius:22px;padding:19px}.hw-item p{color:var(--muted)}
.hw-ask-card h2{margin:5px 0 4px}

@media(max-width:620px){
  .build-badge{display:none}.main{padding-top:24px}.home-hero h1{font-size:44px}.home-upload-box{padding:20px;border-radius:25px;gap:13px}.upload-box-icon{width:48px;height:48px;flex-basis:48px;border-radius:16px}.upload-box-icon svg{width:24px;height:24px}.home-upload-box h2{font-size:26px}.home-upload-box p{font-size:14px}.upload-buttons{display:grid;grid-template-columns:1fr 1fr;width:100%;gap:8px}.upload-btn{padding:11px 9px;font-size:14px}.desktop-drop-note{display:none}.ask-home-card{border-radius:22px}.fab{right:18px;bottom:calc(max(18px,env(safe-area-inset-bottom)) + 6px)}
}
@media(max-width:390px){.upload-buttons{grid-template-columns:1fr}.upload-box-icon{display:none}.home-upload-box{display:block}}

/* v0.6: the actual native input covers the button. This is deliberately not a label-triggered hidden input. */
.direct-upload-button,.fab{position:relative;overflow:hidden}
.button-file-input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;z-index:5;font-size:0}
.direct-upload-button{isolation:isolate}
.direct-upload-button>svg,.direct-upload-button>span{pointer-events:none}
.build-badge{background:rgba(88,118,135,.12);color:#587687;border:1px solid rgba(88,118,135,.16);border-radius:999px;padding:3px 7px;font-size:10px;font-weight:700;margin-left:7px;vertical-align:2px}
.home-upload-box{background:linear-gradient(145deg,#718b98 0%,#536f7d 100%)}

/* =========================================================
   HomeWorks beta 0.7 — Option A: Apple neutral
   Functional behavior is unchanged from v0.6.
   ========================================================= */
:root{
  --bg:#f5f4f1;
  --surface:rgba(252,252,250,.92);
  --surface-solid:#fcfcfa;
  --text:#292b2d;
  --muted:#777a7c;
  --line:rgba(41,43,45,.085);
  --soft:rgba(78,82,85,.075);
  --accent:#676c70;
  --accent-deep:#51565a;
  --accent-soft:#eceeec;
  --success:#5e7465;
  --success-soft:#e8eee9;
  --danger:#a35d56;
  --shadow:0 14px 36px rgba(42,43,40,.07);
}
html,body{background:var(--bg);color:var(--text)}
body{background:linear-gradient(180deg,#f8f7f4 0%,#f3f2ef 100%);background-attachment:fixed}
.topbar{background:rgba(248,247,244,.90);border-bottom:1px solid rgba(41,43,45,.055)}
.brand-mark,.onboard-logo,.fab,.start-btn,.drop-icon{background:var(--accent-deep)}
.brand-mark{box-shadow:0 6px 16px rgba(35,36,34,.10)}
.build-badge{background:#eceeec;color:#61666a;border-color:rgba(81,86,90,.10)}
.lead{color:#5d6062}
.summary-card,.room-card,.hw-item,.onboard-card,.settings-card,.product-card,.room-notes,.file-row,.ask-home-card{background:var(--surface-solid);border-color:rgba(41,43,45,.045)}
.room-icon,.room-title-icon,.action-icon,.file-type,.ask-icon{background:var(--accent-soft);color:var(--accent-deep)}
.progress>span{background:#666b6e}
.text-btn{color:#575c60}
.btn{background:#53575a}.btn:hover{background:#464a4d}
.btn.secondary,.btn.ghost{background:#fcfcfa;color:var(--text);border-color:var(--line)}
.fab{background:#555a5d;box-shadow:0 13px 30px rgba(45,48,49,.20)}
.toast{background:#555a5d;box-shadow:0 12px 34px rgba(45,48,49,.18)}
.big-input:focus,.field input:focus,.field textarea:focus,.field select:focus,.search-input:focus{border-color:rgba(81,86,90,.46);box-shadow:0 0 0 3px rgba(81,86,90,.075)}
.hw-spinner{border-color:#d1d2d0;border-top-color:#5c6164}

/* Main ingestion surface: deliberately neutral gray, not blue-gray. */
.home-upload-box{
  background:linear-gradient(145deg,#74787a 0%,#606467 100%);
  box-shadow:0 18px 42px rgba(45,47,46,.14);
  border-color:rgba(255,255,255,.12);
}
.home-upload-box.dragover{box-shadow:0 22px 48px rgba(45,47,46,.20)}
.home-upload-box .eyebrow{color:rgba(255,255,255,.70)}
.home-upload-box p{color:rgba(255,255,255,.82)}
.upload-box-icon{background:rgba(255,255,255,.13)}
.upload-btn.primary{color:#4f5457;background:#fbfbfa}
.upload-btn.secondary{background:rgba(255,255,255,.10);border-color:rgba(255,255,255,.24)}
.desktop-drop-note{color:rgba(255,255,255,.60)}

/* Keep status green functional but muted, never decorative. */
.hw-worker-card.success,.hw-answer{background:var(--success-soft)}
.hw-check{color:var(--success)}
.item-fact{display:flex;justify-content:space-between;gap:16px;padding:8px 0;border-top:1px solid rgba(45,45,43,.08);font-size:.86rem}.item-fact span{color:var(--muted)}.item-fact strong{text-align:right;color:var(--ink);font-weight:600}

/* v0.9 object correction sheet */
.hw-item{position:relative;padding-right:58px}.item-menu-btn{position:absolute;top:12px;right:12px;width:40px;height:40px;border:0;border-radius:50%;background:transparent;color:var(--text,#292b2d);font-size:26px;line-height:1;display:grid;place-items:center;cursor:pointer}.item-menu-btn:active,.item-menu-btn:hover{background:rgba(40,42,44,.07)}.sheet-close{width:40px;height:40px;border:0;border-radius:50%;background:#f0efeb;color:#303133;font-size:28px;line-height:1}.edit-object-form{display:grid;gap:15px}.edit-object-form label{display:grid;gap:7px;font-size:13px;font-weight:650;color:#62615d}.edit-object-form .big-input{width:100%;box-sizing:border-box}.edit-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.edit-source-note{font-size:13px;color:#74716a;background:#f3f1eb;border-radius:14px;padding:12px 14px}.delete-object-btn{border:0;background:transparent;color:#9b4038;font-weight:650;padding:12px 8px;margin-right:auto}.edit-object-modal .modal-actions{align-items:center}.edit-object-modal .start-btn{width:auto;min-width:150px}@media(max-width:560px){.edit-grid{grid-template-columns:1fr}.edit-object-modal .modal-actions{display:grid;grid-template-columns:1fr}.edit-object-modal .start-btn{width:100%}.delete-object-btn{order:2;margin:auto}}


/* HomeWorks v1.1 passwordless sign-in */
.code-input {
  text-align: center;
  letter-spacing: .28em;
  font-variant-numeric: tabular-nums;
  font-size: 1.35rem;
  font-weight: 650;
}
.code-input::placeholder { letter-spacing: .28em; }
