:root {
  color-scheme: light;
  --forest: #009fdf;
  --forest-dark: #007caf;
  --lime: #e4f5fc;
  --canvas: #f4f7f9;
  --paper: #ffffff;
  --ink: #28353d;
  --muted: #65727a;
  --line: #d6e1e7;
  --danger: #a33a35;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); }
button, input, textarea, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.topbar { display: flex; flex-wrap: wrap; min-height: 116px; justify-content: space-between; align-items: center; gap: 15px 20px; padding: 19px max(20px, calc((100vw - 720px) / 2)); border-bottom: 4px solid var(--forest); color: var(--ink); background: linear-gradient(112deg, #fff 0%, #fff 72%, #eef8fc 100%); box-shadow: 0 5px 18px rgba(29, 69, 92, .08); }
.brand-lockup { display: flex; align-items: center; min-width: 0; gap: 15px; }
.brand-logo { display: block; width: 119px; height: 63px; object-fit: contain; object-position: left center; }
.brand-title { min-width: 0; padding-left: 15px; border-left: 1px solid #c9dbe4; }
.brand-title h1 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; color: #22343d; font-size: 1.55rem; letter-spacing: -.045em; }
.brand-title h1 span { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 8px; border: 1px solid #b9dce9; border-radius: 99px; color: var(--forest-dark); background: #eef9fd; font-size: .49em; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.top-actions { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.eyebrow, .section-label { margin: 0; color: var(--forest-dark); font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
h1 { margin: 5px 0 0; font-size: 1.6rem; line-height: 1.1; letter-spacing: -.03em; }
h2 { margin: 4px 0 0; font-size: 1.15rem; line-height: 1.16; letter-spacing: -.025em; }
h3 { margin: 4px 0 0; font-size: .94rem; line-height: 1.2; }
.local-badge, .header-button { min-height: 31px; padding: 5px 8px; border: 1px solid #b9d6e5; border-radius: 99px; color: #28617d; background: #fff; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.local-badge { color: #28617d; background: #f1f9fd; }
.header-button { cursor: pointer; }
main { max-width: 720px; margin: 0 auto; padding: 20px 16px 42px; }
.intro-card, .project-card, .photo-editor, .summary-card, .notes-card { border: 1px solid var(--line); border-radius: 19px; background: var(--paper); box-shadow: 0 10px 28px rgba(29, 69, 92, .055); }
.project-card { padding: 18px; }
.auth-gate { max-width: 490px; margin: 9vh auto 0; padding: 27px 22px 22px; text-align: center; }
.auth-gate .intro-icon { margin-inline: auto; }
.auth-gate .project-help { margin-inline: auto; }
.auth-gate .small-note { margin-top: 14px; }
.intro-card { padding: 21px 18px 18px; }
.project-card .section-label, .intro-card .section-label, .progress-head .section-label, .summary-card .section-label, .subsection-heading .section-label { color: var(--forest); }
.project-help { margin: 10px 0 16px; color: var(--muted); font-size: .84rem; line-height: 1.45; }
.project-action, .profile-save { width: 100%; }
.project-list-heading { display: flex; align-items: center; gap: 9px; margin: 22px 0 10px; color: var(--muted); font-size: .75rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.project-list-heading::after { flex: 1; height: 1px; content: ""; background: var(--line); }
.project-list { display: grid; gap: 9px; }
.empty-state { margin: 2px 0; color: var(--muted); font-size: .84rem; }
.project-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #fbfdfe; }
.project-row strong, .project-row span, .project-row small { display: block; }
.project-row strong { color: #253228; font-size: .86rem; }
.project-row span { margin-top: 3px; color: var(--muted); font-size: .74rem; }
.project-row small { margin-top: 5px; color: var(--forest); font-size: .69rem; font-weight: 800; }
.project-row-actions { display: grid; justify-items: end; gap: 6px; }
.project-row-actions .secondary-button { min-height: 35px; padding: 6px 10px; font-size: .75rem; }
.danger-text-button { padding: 3px 0; border: 0; color: var(--danger); background: transparent; font-size: .74rem; font-weight: 850; cursor: pointer; }
.danger-text-button:hover { text-decoration: underline; }
.project-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.project-fields .span-full, .weather-fields .span-full { grid-column: 1 / -1; }
.profile-save { margin-top: 15px; }
.hidden { display: none !important; }

.intro-icon { display: grid; width: 40px; height: 40px; place-items: center; margin-bottom: 13px; border-radius: 12px; color: var(--forest); background: var(--lime); font-size: 1.3rem; font-weight: 900; }
.intro-card > p:not(.section-label):not(.small-note) { margin: 10px 0 17px; color: var(--muted); font-size: .9rem; line-height: 1.48; }
.inline-edit { margin: 7px 0 0; padding: 0; border: 0; color: var(--forest); background: transparent; font-size: .76rem; font-weight: 850; cursor: pointer; }
.sync-card { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; margin: 16px 0; padding: 13px; border: 1px solid #d5e6ee; border-radius: 13px; background: #f5fbfe; }
.sync-card h3 { margin: 2px 0 0; font-size: .96rem; }
.sync-card .small-note { margin-top: 5px; }
.sync-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.sync-actions .secondary-button { min-height: 40px; padding: 8px 12px; font-size: .8rem; }
.connection-form { display: grid; grid-column: 1 / -1; grid-template-columns: 1fr auto; gap: 9px; align-items: end; }
.connection-form input { min-height: 40px; }
label { display: grid; gap: 6px; color: #37474f; font-size: .8rem; font-weight: 750; }
input, textarea, select { width: 100%; min-height: 44px; padding: 10px 11px; border: 1px solid #b9cbd4; border-radius: 10px; color: var(--ink); background: white; outline: none; font-weight: 520; }
textarea { min-height: 76px; resize: vertical; line-height: 1.42; }
input:focus, textarea:focus, select:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(0,159,223,.16); }
input[readonly] { color: #5d6b73; background: #f4f8fa; }
.required { color: var(--danger); }
.day-details { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.day-section, .weather-card { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.subsection-heading { display: flex; align-items: end; justify-content: space-between; gap: 10px; }
.subsection-heading .text-button { white-space: nowrap; }
.small-note { margin: 10px 1px 0; color: var(--muted); font-size: .74rem; line-height: 1.38; }
.company-note { margin-bottom: 11px; }
.company-rows, .machine-rows { display: grid; gap: 10px; }
.company-row, .machine-row { display: grid; gap: 9px; padding: 11px; border: 1px solid #d9e4e9; border-radius: 12px; background: #fbfdfe; }
.company-row { grid-template-columns: minmax(0, 1.3fr) minmax(0, .8fr) minmax(0, 1.3fr); }
.machine-row { grid-template-columns: minmax(130px, 1fr) 96px minmax(140px, 1fr); }
.company-row label, .machine-row label { font-size: .71rem; }
.company-row label { min-width: 0; }
.company-row input, .company-row select, .machine-row input { width: 100%; min-width: 0; min-height: 40px; padding: 8px 9px; }
.remove-company, .remove-machine { grid-column: 1 / -1; justify-self: start; padding: 1px 0; border: 0; color: var(--danger); background: transparent; font-size: .72rem; font-weight: 800; cursor: pointer; }
.weather-card { padding: 15px; border: 1px solid #d5e6ee; border-radius: 13px; background: #f7fcfe; }
.weather-card .small-note { margin-bottom: 12px; }
.weather-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.photo-actions { display: grid; gap: 10px; margin-top: 18px; }
.photo-picker { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px dashed #79bad8; border-radius: 13px; color: var(--forest-dark); background: #f5fbfe; cursor: pointer; }
.gallery-picker { border-style: solid; background: #fff; }
.photo-picker input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.photo-picker strong { font-size: .91rem; }
.photo-picker small { display: block; margin-top: 2px; color: var(--muted); font-size: .73rem; font-weight: 550; }
.camera-icon, .gallery-icon { display: grid; flex: none; width: 37px; height: 37px; place-items: center; border-radius: 10px; font-weight: 900; }
.camera-icon { color: white; background: var(--forest); font-size: 1.55rem; transform: rotate(180deg); }
.gallery-icon { color: var(--forest); background: var(--lime); font-size: 1.2rem; }

.workspace { margin-top: 23px; }
.progress-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 0 2px 9px; }
.progress-count { color: var(--muted); font-size: .78rem; font-weight: 750; white-space: nowrap; }
.progress-bar { height: 7px; overflow: hidden; margin: 0 2px 15px; border-radius: 10px; background: #dce9ef; }
.progress-bar span { display: block; width: 0%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--forest-dark), var(--forest)); transition: width .25s ease; }
.photo-editor { overflow: hidden; padding: 0 15px 15px; }
.image-frame { position: relative; display: grid; width: calc(100% + 30px); min-height: 225px; place-items: center; margin-left: -15px; overflow: hidden; background: #deebf1; }
.image-frame img { display: none; width: 100%; max-height: 350px; object-fit: contain; background: #263840; }
.image-frame img.visible { display: block; }
.image-placeholder { padding: 40px 24px; color: #526156; font-size: .85rem; font-weight: 700; text-align: center; }
.image-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 54px; color: var(--muted); font-size: .76rem; font-weight: 650; }
.image-meta > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-pill { flex: none; padding: 4px 8px; border-radius: 99px; color: #806007; background: #fff5c6; font-size: .68rem; font-weight: 850; }
.status-pill.done { color: #007caf; background: #dff3fc; }
.field-block { margin: 3px 0 15px; }
.field-title { display: block; margin-bottom: 8px; color: #334137; font-size: .8rem; font-weight: 750; }
.category-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.category-grid button { min-height: 35px; padding: 6px 10px; border: 1px solid #c7d3c9; border-radius: 99px; color: #435247; background: white; font-size: .75rem; font-weight: 750; cursor: pointer; }
.category-grid button[aria-pressed="true"] { border-color: var(--forest); color: white; background: var(--forest); }
.detail-pair { margin-top: 13px; }
.editor-actions { display: grid; grid-template-columns: 44px 1fr 44px; gap: 8px; margin-top: 16px; }
.icon-button, .primary-button, .secondary-button { min-height: 48px; border-radius: 11px; font-weight: 820; cursor: pointer; }
.icon-button { border: 1px solid #c5d5dd; color: var(--forest); background: white; font-size: 1.25rem; }
.primary-button { border: 1px solid var(--forest); color: white; background: var(--forest); }
.primary-button:hover { background: var(--forest-dark); }
.secondary-button { border: 1px solid #c5d1c7; color: #46554a; background: white; }
.photo-message, .save-message { min-height: 18px; margin: 10px 1px 0; color: var(--forest); font-size: .78rem; font-weight: 700; }
.summary-card, .notes-card { margin-top: 14px; padding: 17px; }
.card-heading { display: flex; align-items: start; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.text-button { padding: 3px 0; border: 0; color: var(--forest); background: transparent; font-size: .82rem; font-weight: 850; cursor: pointer; }
.photo-list { display: grid; gap: 9px; }
.photo-row { display: grid; grid-template-columns: 54px 1fr auto; gap: 10px; align-items: center; padding: 7px; border: 1px solid #d9e4e9; border-radius: 12px; background: #fbfdfe; cursor: pointer; text-align: left; }
.photo-row.active { border-color: #63b8de; box-shadow: 0 0 0 2px rgba(0,159,223,.12); }
.thumbnail { display: grid; width: 54px; height: 54px; place-items: center; overflow: hidden; border-radius: 8px; color: #607066; background: #e5eef2; font-size: .69rem; font-weight: 800; }
.thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.row-text { min-width: 0; }
.row-title, .row-subtitle { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-title { color: #253228; font-size: .78rem; font-weight: 800; }
.row-subtitle { margin-top: 3px; color: var(--muted); font-size: .71rem; font-weight: 560; }
.row-tag { padding: 4px 6px; border-radius: 7px; color: #806007; background: #fff5c6; font-size: .64rem; font-weight: 850; }
.row-tag.done { color: #007caf; background: #dff3fc; }
.sticky-actions { display: grid; grid-template-columns: 1fr auto; gap: 9px; margin-top: 17px; }
.sticky-actions .primary-button { padding-inline: 13px; }
.sticky-actions .secondary-button { padding-inline: 12px; }
.sticky-actions .create-report-button { grid-column: 1 / -1; }

@media (min-width: 740px) { main { padding-inline: 28px; } .image-frame { min-height: 330px; } }
@media (max-width: 480px) {
  .topbar { padding-inline: 16px; }
  .brand-lockup { gap: 11px; }
  .brand-logo { width: 104px; height: 55px; }
  .brand-title { padding-left: 11px; }
  h1 { font-size: 1.42rem; letter-spacing: -.04em; }
  .top-actions { width: 100%; margin-left: 0; justify-content: space-between; }
  .project-fields, .day-details, .weather-fields, .detail-pair { grid-template-columns: 1fr; }
  .project-fields .span-full, .weather-fields .span-full { grid-column: auto; }
  .company-row, .machine-row { grid-template-columns: minmax(0, 1fr) minmax(0, .78fr); }
  .company-row label:first-child, .company-row label:nth-child(3), .company-row label:nth-child(6), .machine-row label:first-child, .machine-row label:nth-child(3) { grid-column: 1 / -1; }
  .sticky-actions { grid-template-columns: 1fr; }
  .sync-card, .connection-form { grid-template-columns: 1fr; }
}
