/* Republic Remodeling & Construction project desk. Brand kit: managers/brand/kits/republic.md (navy #1F3157, Texas red
   #A6212F, cream #EBE2CA, limestone #F7F4EE, slate #4A5468, steel #6B7385, caliche #DCD8CF; Merriweather headings,
   Source Sans 3 body; buttons radius 4; one red element per screen at most). */
:root { --navy: #1F3157; --navy-d: #0F1A30; --red: #A6212F; --brick: #8E1B29; --cream: #EBE2CA; --stone: #F7F4EE;
  --slate: #4A5468; --steel: #6B7385; --line: #DCD8CF; --ok: #2E6B3F; --wait: #8A5A00; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--stone); color: var(--slate); font: 16px/1.45 "Source Sans 3", Arial, sans-serif; padding-bottom: env(safe-area-inset-bottom); }
h1, h2, h3 { font-family: Merriweather, Georgia, serif; color: var(--navy); margin: 0; }
h1 { font-size: 21px; line-height: 1.25; }
h2 { font-size: 17px; margin: 22px 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--red); }
button, input, textarea { font: inherit; }
[hidden] { display: none !important; }

.top { background: var(--navy); display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px; position: sticky; top: 0; z-index: 5; }
.top .logo { height: 38px; width: auto; }
.lang { display: flex; border: 1px solid var(--cream); border-radius: 4px; overflow: hidden; flex: none; }
.lang button { background: transparent; color: var(--cream); border: 0; padding: 6px 11px; font-weight: 700; font-size: 14px; min-height: 34px; }
.lang button[aria-pressed="true"] { background: var(--cream); color: var(--navy); }

.out { padding: 28px 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 14px; }
.center { text-align: center; }
.badge { width: 120px; height: 120px; margin: 4px auto 12px; display: block; }
.err { color: var(--brick); font-weight: 600; }

.head { padding: 16px 16px 6px; }
.sub { margin: 4px 0 0; color: var(--steel); font-size: 15px; }
.bar { height: 8px; background: #fff; border: 1px solid var(--line); border-radius: 4px; margin: 10px 0 2px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--navy); transition: width .3s; }

.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 8px 10px; position: sticky; top: calc(58px + env(safe-area-inset-top)); background: var(--stone); z-index: 4; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { background: #fff; border: 1px solid var(--line); color: var(--navy); border-radius: 4px; padding: 6px 2px; font-weight: 600; font-size: 14px; line-height: 1.2; min-height: 44px; min-width: 0; hyphens: manual; }
.tabs button[aria-current="page"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.tabs .n { display: inline-block; min-width: 18px; padding: 0 4px; margin-left: 4px; border-radius: 10px; background: var(--cream); color: var(--navy); font-size: 13px; line-height: 20px; text-align: center; }

main { padding: 4px 12px 40px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 2px; }
.chips button { background: transparent; border: 1px solid var(--line); border-radius: 16px; padding: 5px 12px; color: var(--slate); min-height: 34px; }
.chips button[aria-pressed="true"] { border-color: var(--navy); color: var(--navy); font-weight: 700; background: #fff; }

.item { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 12px; margin: 10px 0; }
.item .row { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.item .what { color: #1d2433; font-size: 16px; }
.item .num { color: var(--steel); font-size: 13px; font-weight: 700; margin-right: 4px; }
.st { flex: none; font-size: 13px; font-weight: 700; border-radius: 12px; padding: 2px 9px; white-space: nowrap; border: 1px solid currentColor; }
.st.open { color: var(--steel); }
.st.pending { color: var(--wait); background: #FFF6E5; }
.st.fix { color: var(--brick); background: #FBEDEE; }
.st.accepted { color: var(--navy); background: #EEF1F7; }
.st.final { color: var(--ok); background: #EAF4EC; }
.fixnote { margin: 10px 0 0; padding: 8px 10px; border-left: 3px solid var(--red); background: #FBEDEE; color: #4b1219; border-radius: 0 4px 4px 0; white-space: pre-wrap; }
.rec { margin: 10px 0 0; padding: 8px 10px; border-left: 3px solid var(--navy); background: #EEF1F7; color: var(--navy); border-radius: 0 4px 4px 0; white-space: pre-wrap; }
.rec.fix { border-color: var(--red); }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 0; }
.thumb { position: relative; width: 74px; height: 74px; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); background: var(--stone); padding: 0; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .del { position: absolute; top: 2px; right: 2px; width: 24px; height: 24px; border-radius: 12px; border: 0; background: rgba(15,26,48,.8); color: #fff; font-size: 16px; line-height: 22px; padding: 0; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.btn { border-radius: 4px; padding: 10px 16px; min-height: 44px; font-weight: 600; font-size: 15px; border: 1.5px solid var(--navy); background: #fff; color: var(--navy); }
.btn.primary { background: var(--navy); color: #fff; }
.btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.btn:disabled { opacity: .45; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.hint { color: var(--steel); font-size: 14px; margin: 6px 0 0; }
.comments { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.cmt { margin: 6px 0; font-size: 15px; white-space: pre-wrap; }
.cmt b { color: var(--navy); }
.cmt .when, .when { color: var(--steel); font-size: 13px; }
.cmt .tr { display: block; color: var(--steel); font-style: italic; }
textarea, input[type=text], input[type=number] { width: 100%; border: 1px solid var(--line); border-radius: 4px; padding: 10px; background: #fff; color: #1d2433; min-height: 44px; }
textarea { min-height: 80px; resize: vertical; }
textarea:focus, input:focus { outline: none; border-color: var(--navy); }
.box { margin-top: 10px; }
.box .acts { margin-top: 8px; }
.note { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--navy); border-radius: 4px; padding: 10px 12px; margin: 10px 0; }
.note.red { border-left-color: var(--red); }
.walk { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 12px; margin: 8px 0; }
.walk input { width: 26px; height: 26px; margin: 0; flex: none; accent-color: var(--ok); }
.walk.done .what { color: var(--steel); text-decoration: line-through; }
.empty { color: var(--steel); text-align: center; padding: 26px 10px; }
.reply { margin: 8px 0 0 12px; padding: 8px 10px; background: var(--stone); border-radius: 4px; white-space: pre-wrap; }
.reply b { color: var(--navy); }
table.mat { width: 100%; border-collapse: collapse; background: #fff; font-size: 15px; }
table.mat th, table.mat td { border-bottom: 1px solid var(--line); padding: 7px 6px; text-align: left; }
table.mat td.r, table.mat th.r { text-align: right; }
.toast { position: fixed; left: 12px; right: 12px; bottom: calc(16px + env(safe-area-inset-bottom)); background: var(--navy-d); color: #fff; padding: 12px 14px; border-radius: 6px; z-index: 20; font-weight: 600; text-align: center; }
.toast.bad { background: var(--brick); }
.viewer { position: fixed; inset: 0; background: rgba(15,26,48,.95); z-index: 30; display: flex; align-items: center; justify-content: center; }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer .x { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px; border-radius: 22px; border: 0; background: rgba(255,255,255,.18); color: #fff; font-size: 28px; line-height: 40px; }

/* Home Depot welcome: first-open screen for the worker, same steps at the bottom of Materials. */
.hdwelcome { position: fixed; top: calc(58px + env(safe-area-inset-top)); left: 0; right: 0; bottom: 0; background: var(--stone); z-index: 6;
  overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 14px calc(28px + env(safe-area-inset-bottom)); }
.hdwelcome .x { position: sticky; top: 0; display: block; margin: 0 0 8px auto; width: 44px; height: 44px; border-radius: 22px;
  border: 1px solid var(--line); background: #fff; color: var(--navy); font-size: 28px; line-height: 40px; padding: 0; z-index: 1; }
.hd { max-width: 640px; margin: 0 auto; }
.hdwarn { font-weight: 600; color: #4b1219; margin: 0 0 14px; }
.hdsteps { margin: 0; padding: 0 0 0 22px; color: #1d2433; }
.hdsteps li { margin: 0 0 18px; padding-left: 2px; }
.hdsteps li::marker { color: var(--navy); font-weight: 700; }
.hdsteps p { margin: 0 0 8px; }
.hdshot { display: block; width: 100%; max-width: 520px; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: #fff; overflow: hidden; }
.hdshot img { display: block; width: 100%; height: auto; }
.hdtail { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 14px; }
