/* ================================================================
   TileIQ Pro – style.css
================================================================ */

:root {
    --bg:       #f4f4f2;
    --surface:  #ffffff;
    --border:   #e2e2de;
    --ink:      #1e2328;
    --muted:    #72757a;
    --amber:    #e6af2e;
    --amber-lt: #fdf6e3;
    --green:    #27ae60;
    --red:      #e74c3c;
    --blue:     #2980b9;
    --radius:   10px;
    --shadow:   0 2px 8px rgba(0,0,0,.07);
}

[data-theme="dark"] {
    --bg:       #111418;
    --surface:  #1c2128;
    --border:   #2d333b;
    --ink:      #e6edf3;
    --muted:    #8b949e;
    --amber:    #e6af2e;
    --amber-lt: #2a2210;
    --green:    #3fb950;
    --red:      #f85149;
    --blue:     #58a6ff;
    --shadow:   0 2px 8px rgba(0,0,0,.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'DM Sans', system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

#app { max-width: 480px; margin: 0 auto; min-height: 100vh; }

/* ── SCREENS ──────────────────────────────────────────────── */
.screen { display: block; }
.hidden { display: none !important; }

/* ── LOADING ──────────────────────────────────────────────── */
.loading-center {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    height: 100vh; gap: 10px;
}
.logo-mark { font-size: 40px; }
.logo-text  { font-family: 'Syne', sans-serif; font-size: 24px; font-weight: 800; }
.loading-bar {
    width: 160px; height: 3px; background: var(--border);
    border-radius: 2px; overflow: hidden; margin-top: 8px;
}
.loading-fill {
    height: 100%; width: 0; background: var(--amber);
    animation: loadprog 0.7s ease-out forwards;
}
@keyframes loadprog { to { width: 100%; } }

/* ── HEADER ──────────────────────────────────────────────── */
.app-header {
    background: var(--ink);
    color: #fff;
    padding: 14px 16px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 10;
}
.header-brand { display: flex; align-items: center; gap: 8px; }
.brand-icon   { font-size: 18px; }
.brand-name   { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 17px; color: var(--amber); }
.header-title { font-family: 'Syne', sans-serif; font-size: 16px; font-weight: 700; flex: 1; text-align: center; }
.header-actions { display: flex; gap: 8px; align-items: center; }

/* ── BUTTONS ──────────────────────────────────────────────── */
button { cursor: pointer; font-family: inherit; font-size: 14px; border: none; border-radius: 8px; transition: all .15s; }

.btn-primary {
    background: var(--amber); color: var(--ink);
    font-weight: 600; padding: 9px 18px;
}
.btn-primary:hover { background: #d4a028; }

.btn-secondary {
    background: transparent; color: var(--ink);
    border: 1.5px solid var(--border); padding: 9px 16px;
}
.btn-secondary:hover { background: var(--bg); }

.btn-sm { padding: 6px 12px; font-size: 13px; }

.btn-back {
    background: transparent; color: rgba(255,255,255,.8);
    padding: 6px 10px; font-size: 13px;
}
.btn-back:hover { color: #fff; }

.btn-icon {
    background: transparent; color: rgba(255,255,255,.7);
    font-size: 18px; padding: 4px 8px;
}
.btn-icon:hover { color: #fff; }

.btn-danger {
    background: transparent; color: var(--red);
    border: 1.5px solid var(--red); padding: 9px 16px;
    width: 100%; margin-top: 8px;
}
.btn-danger:hover { background: var(--red); color: #fff; }

/* ── LAYOUT ──────────────────────────────────────────────── */
.page-body { padding: 16px; display: flex; flex-direction: column; gap: 0; }

.page-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.page-title     { font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 800; }

.badge {
    background: var(--amber); color: var(--ink);
    font-size: 12px; font-weight: 700;
    padding: 2px 8px; border-radius: 20px;
}

/* ── STATUS BADGES ──────────────────────────────────────── */
.status-badge { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 20px; }
.badge-enquiry  { background: #eef2ff; color: #4a5abf; }
.badge-quoted   { background: #fffbea; color: #b7860a; }
.badge-accepted { background: #eafaf1; color: #1e8449; }
.badge-complete { background: #f0f0f0; color: #555; }

/* ── CARDS ──────────────────────────────────────────────── */
.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 14px;
}

/* ── FIELDS ──────────────────────────────────────────────── */
.field-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field-group:last-child { margin-bottom: 0; }
.field-group label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.field-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }

input, select, textarea {
    width: 100%; padding: 10px 12px;
    border: 1.5px solid var(--border); border-radius: 8px;
    font-family: inherit; font-size: 15px; color: var(--ink);
    background: var(--bg);
    outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--amber); background: #fff; }
textarea { resize: vertical; }

.form-section-label {
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--muted); margin-bottom: 12px;
    padding-bottom: 6px; border-bottom: 1px solid var(--border);
}

.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.checkbox-label input { width: auto; }

.form-actions { display: flex; gap: 10px; margin-top: 16px; }
.form-actions button { flex: 1; }

/* ── JOB CARDS ──────────────────────────────────────────── */
.job-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform .1s, box-shadow .1s;
}
.job-card:hover       { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.1); }
.job-card:active      { transform: translateY(0); }
.job-card-header      { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.job-card-name        { font-weight: 600; font-size: 16px; margin-bottom: 2px; }
.job-card-sub         { font-size: 13px; color: var(--muted); }
.job-card-footer      { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.job-card-total       { font-weight: 700; color: var(--ink); }

/* ── JOB VIEW ──────────────────────────────────────────── */
.customer-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: 14px;
}
.cbar-name    { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.cbar-address { color: var(--muted); margin-bottom: 4px; }
.cbar-contact { color: var(--muted); margin-right: 12px; font-size: 13px; }
.cbar-badge   { display: inline-block; background: var(--amber-lt); color: #8a6000; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 20px; margin-top: 4px; }

.section-heading-row { margin-bottom: 8px; }

.empty-state {
    text-align: center; padding: 40px 20px;
    color: var(--muted);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state-small {
    text-align: center;
    padding: 20px;
    color: var(--muted);
    font-size: 14px;
    background: var(--surface);
    border: 1.5px dashed var(--border);
    border-radius: var(--radius);
    margin-bottom: 14px;
}

/* ── ROOM CARDS ──────────────────────────────────────────── */
.room-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 13px 14px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
}
.room-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.room-card-name   { font-weight: 600; font-size: 15px; }
.room-card-meta   { font-size: 12px; color: var(--muted); margin-top: 2px; }
.room-card-total  { font-weight: 700; font-size: 17px; color: var(--amber); white-space: nowrap; }
.room-card-actions{ display: flex; gap: 8px; margin-top: 10px; }

.surf-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 4px; }
.surf-chip  {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 6px; padding: 3px 8px;
    font-size: 12px; color: var(--muted);
}

.running-total {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--ink); color: #fff;
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 14px;
    font-size: 14px;
}
.running-total strong { font-size: 18px; color: var(--amber); }

.job-actions { display: flex; gap: 10px; margin-bottom: 8px; }
.job-actions button { flex: 1; }

/* ── ROOM EDITOR ──────────────────────────────────────────── */
.stype-row {
    display: grid; grid-template-columns: 1fr 1fr 1fr;
    gap: 10px; margin-bottom: 14px;
}
.stype-btn {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 8px;
    font-size: 22px;
    text-align: center; cursor: pointer;
    transition: all .15s;
    color: var(--ink);
    line-height: 1.4;
}
.stype-btn span { display: block; font-size: 12px; font-weight: 600; margin-top: 4px; }
.stype-btn:hover  { border-color: var(--amber); background: var(--amber-lt); }
.stype-active     { border-color: var(--amber) !important; background: var(--amber-lt) !important; }

.measure-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 14px;
}

.divider-label {
    display: flex; align-items: center; gap: 10px;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--muted); margin: 14px 0 10px;
}
.divider-label::before, .divider-label::after {
    content: ""; flex: 1; height: 1px; background: var(--border);
}

/* ── LIVE TOTAL ──────────────────────────────────────────── */
.live-total-card {
    background: var(--ink); color: #fff;
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 0;
}
.live-total-label { font-size: 12px; color: rgba(255,255,255,.6); margin-bottom: 4px; }
.live-total-value { font-size: 26px; font-weight: 700; color: var(--amber); }
.total-breakdown  { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.breakdown-item   { font-size: 12px; color: rgba(255,255,255,.65); }

/* ── QUOTE ──────────────────────────────────────────────── */
.quote-preview-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
}
.quote-doc { font-size: 13px; }
.quote-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 2px solid var(--amber); }
.quote-company-name { font-size: 16px; font-weight: 700; font-family: 'Syne', sans-serif; color: var(--ink); margin-bottom: 4px; }
.quote-company { color: var(--muted); font-size: 12px; }
.quote-meta { text-align: right; color: var(--muted); font-size: 12px; }
.quote-ref  { font-weight: 700; color: var(--ink); font-size: 14px; margin-bottom: 3px; }
.quote-customer { background: var(--bg); border-radius: 6px; padding: 10px 12px; margin-bottom: 16px; font-size: 13px; line-height: 1.6; }
.quote-description { font-size: 13px; line-height: 1.6; color: var(--muted); margin-bottom: 16px; padding: 10px 12px; border-left: 3px solid var(--amber); background: var(--bg); border-radius: 0 6px 6px 0; }

.quote-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: 12px; }
.quote-table th { background: var(--ink); color: var(--amber); padding: 6px 8px; text-align: left; }
.quote-table th:last-child, .quote-table td:last-child { text-align: right; }
.quote-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); color: var(--muted); }
.quote-table td:first-child { color: var(--ink); }

.quote-totals { border-top: 2px solid var(--border); padding-top: 10px; }
.quote-total-row { display: flex; justify-content: space-between; padding: 3px 0; font-size: 13px; color: var(--muted); }
.quote-grand { font-size: 15px; font-weight: 700; color: var(--ink); padding-top: 6px; border-top: 1px solid var(--border); margin-top: 4px; }
.quote-terms { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); line-height: 1.5; }

.ai-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.ai-loading { color: var(--muted); font-size: 13px; padding: 10px 0; }
.ai-result  { font-size: 13px; line-height: 1.6; padding: 10px 0; color: var(--muted); border-top: 1px solid var(--border); margin-top: 10px; }

.action-row { display: flex; gap: 10px; margin-bottom: 8px; }
.action-row button { flex: 1; }

/* ── PREP OPTIONS ─────────────────────────────────────────── */
.prep-options { display: flex; flex-direction: column; gap: 6px; }

.prep-option {
    display: flex; align-items: center; gap: 10px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.prep-option:hover { border-color: var(--amber); background: var(--amber-lt); }
.prep-option input[type="checkbox"] { width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--amber); }
.prep-option input[type="checkbox"]:checked + .prep-text { color: var(--ink); }

.prep-text {
    display: flex; justify-content: space-between;
    align-items: center; flex: 1;
    font-size: 14px; color: var(--muted);
}
.prep-cost {
    font-size: 12px; font-weight: 600;
    color: var(--muted); white-space: nowrap;
    margin-left: 8px;
}

.prep-depth {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 12px 4px 38px;
    font-size: 13px; color: var(--muted);
}
.prep-depth label { font-size: 12px; font-weight: 600; white-space: nowrap; }
.prep-depth select { width: auto; padding: 6px 10px; font-size: 13px; }

/* ── LABOUR TOGGLE ─────────────────────────────────────────── */
.labour-toggle {
    display: flex;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.ltbtn {
    flex: 1; padding: 9px 12px;
    background: var(--bg); color: var(--muted);
    border: none; border-radius: 0;
    font-weight: 600; font-size: 14px;
    transition: all .15s;
}
.ltbtn:first-child { border-right: 1.5px solid var(--border); }
.ltbtn-active {
    background: var(--amber) !important;
    color: var(--ink) !important;
}
.ltbtn:hover:not(.ltbtn-active) { background: var(--amber-lt); color: var(--ink); }

/* ── Room cost breakdown bar ─────────────────────────────── */
.room-cost-breakdown {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0 4px;
    flex-wrap: wrap;
}
.rcb-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.rcb-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted, #888);
    line-height: 1;
}
.rcb-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink, #1a1a2e);
    line-height: 1.3;
}
.rcb-sep {
    color: var(--border, #ddd);
    font-size: 14px;
    padding: 0 2px;
    align-self: center;
}

/* ── Quote table room rows ───────────────────────────────── */
.qt-room-header td {
    background: #f4f4f8;
    padding-top: 10px;
    padding-bottom: 6px;
    font-size: 13px;
}
.qt-area-note {
    font-weight: 400;
    color: #888;
    font-size: 12px;
    margin-left: 6px;
}
.qt-mat-row td {
    padding-top: 4px;
    padding-bottom: 4px;
    font-size: 12px;
    color: #444;
}
.qt-indent {
    padding-left: 16px !important;
}
.qt-detail {
    color: #999;
    font-size: 11px;
    margin-left: 6px;
}

.live-total-m2 {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted, #888);
    margin-left: 8px;
    letter-spacing: 0.01em;
}

/* ── Room card materials schedule ────────────────────────── */
.room-mat-schedule {
    font-size: 11.5px;
    color: var(--muted, #777);
    padding: 4px 0 6px;
    border-top: 1px dashed var(--border, #e0e0e8);
    margin-top: 4px;
    line-height: 1.6;
}

/* ── Quote materials schedule ────────────────────────────── */
.quote-mat-schedule {
    margin-top: 16px;
    padding: 12px 16px;
    background: #f8f8fc;
    border: 1px solid #e4e4f0;
    border-radius: 6px;
    font-size: 13px;
}
.qms-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #888;
    margin-bottom: 8px;
}
.qms-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    border-bottom: 1px solid #eee;
    color: #333;
}
.qms-row:last-child { border-bottom: none; }
.qms-row span:last-child { font-weight: 600; }

/* ── Materials Screen ─────────────────────────────────────── */
.mat-totals-card {
    background: var(--primary, #1a1a2e);
    color: #fff;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}
.mat-totals-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    opacity: .7;
    margin-bottom: 12px;
}
.mat-totals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
}
.mat-total-item {
    background: rgba(255,255,255,.08);
    border-radius: 6px;
    padding: 8px 10px;
}
.mat-total-label {
    display: block;
    font-size: 10px;
    opacity: .7;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 4px;
}
.mat-total-value {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}
.mat-room-block {
    background: #fff;
    border-radius: 10px;
    border: 1px solid var(--border, #e4e4f0);
    margin-bottom: 14px;
    overflow: hidden;
}
.mat-room-title {
    font-weight: 700;
    font-size: 14px;
    padding: 12px 14px 8px;
    border-bottom: 1px solid var(--border, #e4e4f0);
    background: #f8f8fc;
}
.mat-room-area {
    font-weight: 400;
    font-size: 12px;
    color: #888;
    margin-left: 8px;
}
.mat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.mat-table th {
    padding: 6px 10px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #888;
    border-bottom: 1px solid var(--border, #e4e4f0);
    white-space: nowrap;
}
.mat-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f5;
    vertical-align: top;
    line-height: 1.4;
}
.mat-surf-row:last-child td { border-bottom: none; }
.mat-sub {
    font-size: 10px;
    color: #aaa;
    display: block;
}

/* ── Deduction presets ───────────────────────────────────── */
.deduct-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}
.deduct-btn {
    background: #f0f0f8;
    border: 1px solid #d0d0e0;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 11px;
    line-height: 1.3;
    cursor: pointer;
    text-align: center;
    min-width: 72px;
    color: #333;
    transition: background .15s;
}
.deduct-btn span {
    display: block;
    font-size: 10px;
    color: #888;
    margin-top: 1px;
}
.deduct-btn:hover { background: #e2e2f4; border-color: #a0a0cc; }
.deduct-btn-wide { min-width: 60px; }
.deduct-items {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 4px;
}
.deduct-tag {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #fff0f0;
    border: 1px solid #f0c0c0;
    border-radius: 20px;
    padding: 3px 8px 3px 10px;
    font-size: 11px;
    color: #c00;
}
.deduct-remove {
    background: none;
    border: none;
    color: #c00;
    font-size: 14px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}

/* ── Deduction section (standalone, outside field-group) ─── */
.deduct-section {
    background: #f8f4ff;
    border: 1px dashed #c9b8f0;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
}
.deduct-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #8060c0;
    margin-bottom: 8px;
}

/* ── Dark mode overrides for hardcoded colours ── */
[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus { background: var(--surface); }

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea { background: var(--bg); color: var(--ink); }

[data-theme="dark"] .badge-enquiry  { background: #1a2040; color: #7b8fdf; }
[data-theme="dark"] .badge-quoted   { background: #2a2210; color: #e6af2e; }
[data-theme="dark"] .badge-accepted { background: #0d2818; color: #3fb950; }
[data-theme="dark"] .badge-complete { background: #2d333b; color: #8b949e; }

[data-theme="dark"] .quote-doc { background: var(--surface); color: var(--ink); }
[data-theme="dark"] .deduct-tag { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .prep-option { background: var(--bg); border-color: var(--border); }
[data-theme="dark"] .prep-option:hover { background: var(--surface); }

/* Dark mode theme toggle button */
#theme-toggle {
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 13px;
    cursor: pointer;
    color: var(--muted);
    line-height: 1;
}
#theme-toggle:hover { border-color: var(--amber); color: var(--amber); }

/* ── Extra surfaces ── */
.btn-add-surface {
    display: block; width: 100%; margin-top: 12px;
    padding: 9px 0; border: 1.5px dashed var(--amber);
    border-radius: var(--radius); background: transparent;
    color: var(--amber); font-size: 13px; font-weight: 600;
    cursor: pointer; letter-spacing: .3px;
}
.btn-add-surface:hover { background: var(--amber-lt); }

.extra-surface-card {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 12px 14px; margin-top: 10px;
}
.extra-surface-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px;
}
.extra-surface-title {
    font-size: 13px; font-weight: 700; color: var(--amber); text-transform: uppercase; letter-spacing: .4px;
}
.btn-remove-surface {
    background: transparent; border: none; color: var(--muted);
    font-size: 18px; cursor: pointer; padding: 0 4px; line-height: 1;
}
.btn-remove-surface:hover { color: var(--red); }
.extra-surface-card .field-row { margin-bottom: 8px; }
.extra-surface-card .field-group label { font-size: 11px; }
.extra-surface-card .prep-options { margin-top: 8px; }

/* ── Collapsible deductions ── */
.deduct-toggle {
    cursor: pointer; user-select: none;
    display: flex; align-items: center; gap: 4px;
}
.deduct-toggle:hover { color: var(--amber); }
.deduct-toggle-arrow { font-size: 11px; color: var(--muted); }

/* Deduction chip grid */
.deduct-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 8px;
}

.deduct-chip {
    display: inline-block;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 11px;
    line-height: 1.3;
    cursor: pointer;
    text-align: center;
    min-width: 72px;
    color: var(--ink);
    transition: background .15s, border-color .15s;
    user-select: none;
}
.deduct-chip:hover { background: var(--amber-lt); border-color: var(--amber); }
.deduct-chip input[type=checkbox] { display: none; }
.deduct-chip:has(input:checked) {
    background: var(--amber-lt);
    border-color: var(--amber);
    color: var(--ink);
    font-weight: 600;
}
.deduct-chip-manual { border-style: dashed; color: var(--muted); }
.deduct-chip-manual:hover { color: var(--amber); border-color: var(--amber); }



/* ── Postcode Lookup ── */
.pc-lookup-row {
    display: flex; gap: 8px; margin: 6px 0 4px;
}
.pc-lookup-input {
    flex: 1; background: var(--bg);
    border: 1px solid var(--border); border-radius: 8px;
    padding: 9px 12px; font-size: 14px; color: var(--ink);
    text-transform: uppercase; letter-spacing: 1px;
}
.pc-lookup-input:focus { outline: none; border-color: var(--amber); }
.pc-result {
    padding: 8px 12px; border-radius: 8px; font-size: 13px;
    margin-bottom: 4px;
}
.pc-result.hidden { display: none !important; }
.pc-result.pc-ok  { background: var(--amber-lt); border: 1px solid var(--amber); font-weight: 600; color: var(--ink); }
.pc-result.pc-err { background: #fff0f0; border: 1px solid #f99; color: #a00; }

/* ══════════════════════════════════════════════════════════════
   AUTH SCREENS — Premium dark design
══════════════════════════════════════════════════════════════ */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 0;
    position: relative;
    overflow: hidden;
    background: #111214;
}

/* Tile grid background pattern */
.auth-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(230,175,46,0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(230,175,46,0.07) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 20%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 20%, transparent 80%);
}

/* Amber glow orb at top */
.auth-wrap::after {
    content: '';
    position: absolute;
    top: -80px; left: 50%;
    transform: translateX(-50%);
    width: 340px; height: 340px;
    background: radial-gradient(circle, rgba(230,175,46,0.18) 0%, transparent 70%);
    pointer-events: none;
}

/* Floating tile decorations */
.auth-tiles {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 55%;
    pointer-events: none;
}
.auth-tile {
    position: absolute;
    border-radius: 8px;
    background: linear-gradient(135deg, #E6AF2E, #C8900E);
    opacity: 0;
    animation: tileFade 3s ease-in-out forwards;
}
.auth-tile:nth-child(1)  { width:72px; height:42px; top:14%; left:8%;  opacity:.12; animation-delay:.1s; }
.auth-tile:nth-child(2)  { width:72px; height:42px; top:14%; left:calc(8% + 80px); opacity:.18; animation-delay:.2s; }
.auth-tile:nth-child(3)  { width:72px; height:42px; top:14%; left:calc(8% + 160px); opacity:.10; animation-delay:.3s; }
.auth-tile:nth-child(4)  { width:72px; height:42px; top:calc(14% + 50px); left:8%;  opacity:.08; animation-delay:.4s; }
.auth-tile:nth-child(5)  { width:72px; height:42px; top:calc(14% + 50px); left:calc(8% + 80px); opacity:.22; animation-delay:.2s; }
.auth-tile:nth-child(6)  { width:72px; height:42px; top:calc(14% + 50px); left:calc(8% + 160px); opacity:.14; animation-delay:.1s; }
.auth-tile:nth-child(7)  { width:72px; height:42px; top:calc(14% + 100px); left:8%;  opacity:.16; animation-delay:.3s; }
.auth-tile:nth-child(8)  { width:72px; height:42px; top:calc(14% + 100px); left:calc(8% + 80px); opacity:.09; animation-delay:.15s; }
.auth-tile:nth-child(9)  { width:72px; height:42px; top:calc(14% + 100px); left:calc(8% + 160px); opacity:.20; animation-delay:.25s; }
.auth-tile:nth-child(10) { width:72px; height:42px; top:calc(14% + 150px); left:calc(8% + 40px); opacity:.11; animation-delay:.35s; }
.auth-tile:nth-child(11) { width:72px; height:42px; top:calc(14% + 150px); left:calc(8% + 120px); opacity:.17; animation-delay:.05s; }

@keyframes tileFade {
    from { opacity: 0; transform: translateY(6px); }
    to   { transform: translateY(0); }
}

/* Brand mark above card */
.auth-brand {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 0 28px;
}
.auth-brand-icon {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 64px; height: 64px;
    background: linear-gradient(135deg, #E6AF2E, #C8900E);
    border-radius: 18px;
    font-size: 28px;
    margin-bottom: 12px;
    box-shadow: 0 8px 32px rgba(230,175,46,0.35);
}
.auth-brand-name {
    font-size: 26px; font-weight: 900;
    font-family: 'Syne', sans-serif;
    color: #fff;
    letter-spacing: 1px;
}
.auth-brand-sub {
    font-size: 12px; font-weight: 500;
    color: rgba(255,255,255,0.35);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 2px;
}

/* Bottom sheet card */
.auth-card {
    position: relative;
    z-index: 2;
    width: 100%;
    background: #1A1A1C;
    border-top: 1px solid rgba(255,255,255,0.08);
    border-radius: 28px 28px 0 0;
    padding: 32px 28px 48px;
    box-shadow: 0 -16px 60px rgba(0,0,0,0.6);
}

.auth-title {
    font-size: 20px; font-weight: 700;
    font-family: 'Syne', sans-serif;
    color: #fff;
    margin: 0 0 22px;
}

/* Input fields */
.auth-card .field-group {
    margin-bottom: 14px;
}
.auth-card .field-group label {
    display: block;
    font-size: 12px; font-weight: 600;
    color: rgba(255,255,255,0.45);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    margin-bottom: 7px;
}
.auth-card .field-group input {
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 15px;
    color: #fff;
    outline: none;
    transition: border-color .15s, background .15s;
    -webkit-appearance: none;
}
.auth-card .field-group input::placeholder { color: rgba(255,255,255,0.25); }
.auth-card .field-group input:focus {
    border-color: #E6AF2E;
    background: rgba(230,175,46,0.06);
}

/* Buttons */
.auth-btn {
    width: 100%; margin-top: 8px; padding: 15px;
    font-size: 15px; font-weight: 700;
    border-radius: 12px; border: none;
    cursor: pointer; transition: all .15s;
    letter-spacing: 0.3px;
}
.auth-card .btn-primary {
    background: linear-gradient(135deg, #E6AF2E, #C8900E);
    color: #111;
    box-shadow: 0 4px 20px rgba(230,175,46,0.3);
}
.auth-card .btn-primary:active { transform: scale(0.98); }
.auth-card .btn-secondary {
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.10);
}

/* Biometric button */
.btn-biometric {
    width: 100%; margin-top: 10px; padding: 14px;
    font-size: 14px; font-weight: 600;
    background: transparent;
    border: 1px solid rgba(230,175,46,0.4);
    color: #E6AF2E;
    border-radius: 12px;
    cursor: pointer;
    transition: all .15s;
    letter-spacing: 0.3px;
}
.btn-biometric:active { background: rgba(230,175,46,0.08); }

/* Links */
.auth-links {
    margin-top: 20px; text-align: center;
    font-size: 13px; color: rgba(255,255,255,0.35);
}
.auth-links a { color: #E6AF2E; text-decoration: none; font-weight: 600; }
.auth-sep { margin: 0 8px; }

/* Messages */
.auth-error {
    background: rgba(248,81,73,0.12);
    border: 1px solid rgba(248,81,73,0.3);
    color: #f85149;
    border-radius: 10px;
    padding: 10px 14px; font-size: 13px; margin-bottom: 14px;
}
.auth-success {
    background: rgba(230,175,46,0.10);
    border: 1px solid rgba(230,175,46,0.3);
    color: #E6AF2E;
    border-radius: 10px;
    padding: 10px 14px; font-size: 13px; margin-bottom: 14px;
}
