    :root {
      --bg: #f4f5f7;
      --card: #ffffff;
      --text: #1a1f29;
      --muted: #6b7280;
      --border: #e3e6ea;
      /* Sampled from the logo artwork — the maroon of the YANTRIK wordmark. */
      --brand-maroon: #a50123;
      --primary: #2563eb;
      --primary-hover: #1d4ed8;
      --danger: #dc2626;
      --danger-hover: #b91c1c;
      --warn: #b45309;
      --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
      --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.18);
      --radius: 10px;
      --done: #16a34a;
      --under: #f59e0b;
      --notdone: #ef4444;

      /* Fill for a date cell that has been set and is not overdue.
         NOTE: "#82b7h" is not a valid hex colour ('h' is not a hex digit), so
         this is the nearest light blue in that family. Change these three
         values to restyle every date cell in the app. */
      --cell-blue: #82b7e8;
      --cell-blue-border: #5d9bd5;
      --cell-blue-text: #0f2d4d;
    }

    * { box-sizing: border-box; }

    body {
      margin: 0;
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
      background: var(--bg);
      color: var(--text);
      line-height: 1.5;
    }

    header.app-header {
      background: var(--card);
      border-bottom: 1px solid var(--border);
      padding: 14px 20px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      position: sticky;
      top: 0;
      z-index: 40;
    }

    .brand h1 { margin: 0; font-size: 1.25rem; letter-spacing: -0.02em; }
    .brand p { margin: 2px 0 0; color: var(--muted); font-size: 0.82rem; }

    .header-actions { display: flex; align-items: center; gap: 6px; position: relative; }

    .icon-btn {
      background: transparent;
      border: 1px solid transparent;
      border-radius: 8px;
      padding: 7px 9px;
      font-size: 1rem;
      line-height: 1;
      cursor: pointer;
      color: var(--text);
      position: relative;
    }
    .icon-btn:hover { background: #f1f5f9; }

    .bell-dot {
      position: absolute;
      top: 2px; right: 2px;
      min-width: 16px;
      height: 16px;
      padding: 0 4px;
      background: var(--danger);
      color: #fff;
      font-size: 0.62rem;
      font-weight: 700;
      line-height: 16px;
      border-radius: 999px;
      text-align: center;
    }

    .user-chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      border: 1px solid var(--border);
      background: #fff;
      border-radius: 999px;
      padding: 4px 12px 4px 5px;
      font: inherit;
      font-size: 0.82rem;
      cursor: pointer;
    }
    .user-chip:hover { border-color: var(--primary); color: var(--primary); }
    .avatar {
      width: 22px; height: 22px;
      border-radius: 50%;
      background: var(--primary);
      color: #fff;
      font-size: 0.7rem;
      font-weight: 700;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    /* Notification dropdown */
    .notif-panel {
      position: absolute;
      top: 44px;
      right: 0;
      width: 340px;
      max-height: 420px;
      overflow-y: auto;
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      box-shadow: var(--shadow-lg);
      z-index: 60;
    }
    .notif-panel h4 {
      margin: 0;
      padding: 12px 14px;
      font-size: 0.85rem;
      border-bottom: 1px solid var(--border);
    }
    .notif-item {
      padding: 10px 14px;
      border-bottom: 1px solid var(--border);
      font-size: 0.84rem;
      cursor: pointer;
    }
    .notif-item:last-child { border-bottom: none; }
    .notif-item:hover { background: #f8fafc; }
    .notif-item .n-meta { color: var(--muted); font-size: 0.74rem; margin-top: 2px; }
    .notif-item.unread { background: #eff6ff; }
    .notif-empty { padding: 24px 14px; text-align: center; color: var(--muted); font-size: 0.85rem; }

    .container {
      max-width: 100%;
      margin: 0;
      padding: 20px 24px 56px;
    }

    .container.wide { max-width: 100%; padding: 20px 24px 56px; }

    .hidden { display: none !important; }

    /* ---------- Buttons / forms ---------- */
    .field { margin-bottom: 14px; }

    .field label {
      display: block;
      font-size: 0.82rem;
      font-weight: 600;
      color: var(--muted);
      margin-bottom: 5px;
    }

    .field input,
    .field textarea,
    .field select {
      width: 100%;
      padding: 10px 12px;
      font-size: 0.95rem;
      font-family: inherit;
      color: var(--text);
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 8px;
      transition: border-color 0.15s, box-shadow 0.15s;
    }

    .field input:focus,
    .field textarea:focus,
    .field select:focus {
      outline: none;
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    }

    .field input.invalid {
      border-color: var(--danger);
      box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
    }

    .field textarea { resize: vertical; min-height: 62px; }

    .field-row { display: flex; gap: 12px; flex-wrap: wrap; }
    .field-row .field { flex: 1; min-width: 180px; }

    .error-msg { display: none; color: var(--danger); font-size: 0.8rem; margin-top: 5px; }
    .error-msg.show { display: block; }

    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding: 9px 16px;
      font-size: 0.9rem;
      font-weight: 600;
      font-family: inherit;
      border: none;
      border-radius: 8px;
      cursor: pointer;
      transition: background 0.15s, border-color 0.15s;
      white-space: nowrap;
    }

    .btn-primary { background: var(--primary); color: #fff; }
    .btn-primary:hover { background: var(--primary-hover); }

    .btn-danger { background: transparent; color: var(--danger); padding: 6px 10px; font-size: 0.82rem; }
    .btn-danger:hover { background: rgba(220, 38, 38, 0.08); }

    .btn-ghost { background: transparent; color: var(--primary); padding: 8px 12px; }
    .btn-ghost:hover { background: rgba(37, 99, 235, 0.08); }

    .btn-secondary { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }
    .btn-secondary:hover { background: #e2e8f0; }

    .btn-excel { background: #16a34a; color: #fff; }
    .btn-excel:hover { background: #15803d; }

    .btn-sm { padding: 6px 10px; font-size: 0.8rem; }

    /* ---------- List view toolbar ---------- */
    .view-bar {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
      margin-bottom: 18px;
    }
    .view-bar .spacer { flex: 1; }

    .search-box { position: relative; }
    .search-box input {
      padding: 9px 12px 9px 32px;
      border: 1px solid var(--border);
      border-radius: 8px;
      font: inherit;
      font-size: 0.88rem;
      background: #fff;
      min-width: 220px;
    }
    .search-box input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
    .search-box .s-icon {
      position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
      color: var(--muted); font-size: 0.85rem; pointer-events: none;
    }

    select.filter-select, input.filter-date {
      padding: 8px 10px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fff;
      font: inherit;
      font-size: 0.85rem;
      color: var(--text);
    }
    select.filter-select:focus, input.filter-date:focus { outline: none; border-color: var(--primary); }

    .toggle-group { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
    .toggle-group button {
      border: none;
      background: transparent;
      padding: 8px 12px;
      font: inherit;
      font-size: 0.85rem;
      cursor: pointer;
      color: var(--muted);
    }
    .toggle-group button.active { background: var(--primary); color: #fff; }

    /* Add project form */
    .add-form {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      padding: 20px;
      margin-bottom: 24px;
    }
    .add-form h2 { margin: 0 0 16px; font-size: 1.05rem; }

    /* ---------- Project cards / dashboard ---------- */
    .list-header {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      margin-bottom: 12px;
    }
    .list-header h2 { margin: 0; font-size: 1.05rem; }
    .count { color: var(--muted); font-size: 0.85rem; }

    /* Rectangular tiles, not full-width rows. */
    .project-list {
      list-style: none;
      margin: 0;
      padding: 0;
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
      gap: 16px;
      align-items: stretch;
    }
    /* "Compact" toggle — denser tiles, still boxes rather than lines. */
    .project-list.compact {
      grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
      gap: 12px;
    }

    .project-card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      padding: 16px 18px;
      cursor: pointer;
      transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
      position: relative;
      display: flex;
      flex-direction: column;
      gap: 10px;
      min-height: 250px;
    }
    .project-card:hover {
      border-color: #c7d2fe;
      box-shadow: 0 6px 18px rgba(37,99,235,0.13);
      transform: translateY(-2px);
    }
    .project-card.editing { cursor: default; border-color: var(--primary); }

    .card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
    .project-name { margin: 0; font-size: 1rem; font-weight: 600; word-break: break-word; }
    .project-card:hover .project-name { color: var(--primary); }
    .project-desc { margin: 0; color: var(--muted); font-size: 0.86rem; word-break: break-word; }

    .card-tools { display: flex; gap: 2px; flex-shrink: 0; }

    .card-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

    .status-badge {
      display: inline-block;
      padding: 3px 10px;
      font-size: 0.7rem;
      font-weight: 600;
      border-radius: 999px;
      text-transform: uppercase;
      letter-spacing: 0.03em;
    }
    .status-active     { background: #dbeafe; color: #1e40af; }
    .status-in-progress{ background: #fef3c7; color: #92400e; }
    .status-completed  { background: #dcfce7; color: #166534; }
    .status-on-hold    { background: #f3f4f6; color: #4b5563; }

    .rows-hint { font-size: 0.78rem; color: var(--muted); }

    .progress-wrap { display: flex; align-items: center; gap: 10px; }
    .progress-track { flex: 1; height: 7px; background: #eef1f5; border-radius: 999px; overflow: hidden; }
    .progress-fill { height: 100%; background: var(--primary); border-radius: 999px; transition: width 0.3s; }
    .progress-pct { font-size: 0.78rem; font-weight: 700; color: var(--muted); min-width: 34px; text-align: right; }

    .mini-bar { display: flex; height: 6px; border-radius: 999px; overflow: hidden; background: #eef1f5; }
    .mini-bar span { display: block; height: 100%; }
    .mini-legend { display: flex; gap: 12px; font-size: 0.72rem; color: var(--muted); flex-wrap: wrap; }
    .mini-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }

    .card-footer {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      font-size: 0.74rem;
      color: var(--muted);
      border-top: 1px solid var(--border);
      padding-top: 8px;
      flex-wrap: wrap;
    }

    .card-banner {
      font-size: 0.76rem;
      font-weight: 600;
      padding: 6px 10px;
      border-radius: 6px;
      background: #fff7ed;
      color: var(--warn);
      border: 1px solid #fed7aa;
    }
    .card-banner.overdue { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

    .inline-edit { display: flex; flex-direction: column; gap: 10px; }
    .inline-edit input, .inline-edit textarea, .inline-edit select {
      width: 100%;
      padding: 8px 10px;
      font: inherit;
      font-size: 0.9rem;
      border: 1px solid var(--border);
      border-radius: 7px;
      background: #fff;
    }
    .inline-edit textarea { resize: vertical; min-height: 54px; }
    .inline-edit-actions { display: flex; gap: 8px; }

    /* Empty state */
    .empty-state {
      text-align: center;
      padding: 44px 20px;
      background: var(--card);
      border: 1px dashed var(--border);
      border-radius: var(--radius);
      grid-column: 1 / -1;
    }
    .empty-state h3 { margin: 14px 0 4px; font-size: 1.05rem; }
    .empty-state p { margin: 0; color: var(--muted); font-size: 0.9rem; }
    .empty-state .cta { margin-top: 16px; }
    .empty-art { width: 132px; height: 92px; }

    /* ---------- Cross-project summary (Phase 6.1) ---------- */
    .panel-section {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      margin-top: 28px;
      overflow: hidden;
    }
    .panel-section > summary {
      padding: 14px 18px;
      font-weight: 600;
      font-size: 0.95rem;
      cursor: pointer;
      list-style: none;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .panel-section > summary::-webkit-details-marker { display: none; }
    .panel-section > summary::before { content: "▸"; color: var(--muted); }
    .panel-section[open] > summary::before { content: "▾"; }
    .panel-body { padding: 0 18px 18px; }

    table.summary-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
    table.summary-table th, table.summary-table td {
      border-bottom: 1px solid var(--border);
      padding: 8px 10px;
      text-align: left;
    }
    table.summary-table th {
      font-size: 0.72rem;
      text-transform: uppercase;
      letter-spacing: 0.03em;
      color: #475569;
      cursor: pointer;
      user-select: none;
      white-space: nowrap;
    }
    table.summary-table th:hover { color: var(--primary); }
    table.summary-table tbody tr { cursor: pointer; }
    table.summary-table tbody tr:hover { background: #f8fafc; }
    table.summary-table td.num, table.summary-table th.num { text-align: right; }
    .pill-overdue { color: var(--danger); font-weight: 700; }

    /* ---------- Detail view ---------- */
    .detail-top {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 14px;
      margin-bottom: 4px;
      flex-wrap: wrap;
    }
    .detail-title { margin: 0; font-size: 1.4rem; letter-spacing: -0.02em; word-break: break-word; }
    .detail-title-input {
      font: inherit;
      font-size: 1.4rem;
      font-weight: 700;
      border: 1px solid var(--primary);
      border-radius: 8px;
      padding: 2px 8px;
      width: min(520px, 100%);
    }
    .detail-sub { color: var(--muted); font-size: 0.86rem; margin: 4px 0 16px; }
    .detail-stats { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
    .stat { font-size: 0.8rem; color: var(--muted); }
    .stat b { color: var(--text); font-size: 0.9rem; }

    .target-field { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--muted); }
    .target-field input {
      border: 1px solid var(--border);
      border-radius: 7px;
      padding: 5px 8px;
      font: inherit;
      font-size: 0.82rem;
      background: #fff;
      color: var(--text);
    }

    /* Scrolls in both directions.  The height is capped against the viewport
       so the sticky header has something to stick to — without a bounded
       container `position: sticky` on <thead> has no effect. */
    .sheet-wrap {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      overflow: auto;
      width: 100%;
      max-height: calc(100vh - 330px);
      min-height: 220px;
      position: relative;
      overscroll-behavior: contain;
    }

    /* A visible, comfortable scrollbar — this table is scrolled constantly. */
    .sheet-wrap::-webkit-scrollbar { width: 12px; height: 12px; }
    .sheet-wrap::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 8px; }
    .sheet-wrap::-webkit-scrollbar-thumb {
      background: #c3ccd8;
      border-radius: 8px;
      border: 3px solid #f1f5f9;
    }
    .sheet-wrap::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
    .sheet-wrap::-webkit-scrollbar-corner { background: #f1f5f9; }
    .sheet-wrap { scrollbar-color: #c3ccd8 #f1f5f9; }

    table.sheet {
      border-collapse: separate;
      border-spacing: 0;
      width: 100%;
      font-size: 0.85rem;
    }

    table.sheet th,
    table.sheet td {
      border-right: 1px solid var(--border);
      border-bottom: 1px solid var(--border);
      padding: 5px 4px;
      text-align: center;
      white-space: nowrap;
      background: #fff;
    }

    /* The column headings stay put while the sheet scrolls vertically.  The
       left-hand columns deliberately do NOT stick — they scroll away with
       everything else so the full width of the sheet is reachable. */
    table.sheet thead th {
      background: #eef2f7;
      font-size: 0.68rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.02em;
      color: #334155;
      position: sticky;
      top: 0;
      z-index: 5;
      border-top: 1px solid var(--border);
      /* Sticky cells lose their bottom border when scrolled, so draw it here. */
      box-shadow: inset 0 -2px 0 0 #cbd5e1;
    }

    .col-handle { width: 30px; min-width: 30px; }
    .col-sno    { width: 46px; min-width: 46px; }
    .col-station{ width: 168px; min-width: 168px; }
    .col-due    { width: 128px; min-width: 128px; }
    .col-cmt    { width: 40px; min-width: 40px; }
    .col-del    { width: 38px; min-width: 38px; }

    table.sheet td.sno { color: var(--muted); font-weight: 600; }

    .drag-handle {
      color: #cbd5e1;
      cursor: grab;
      font-size: 0.95rem;
      line-height: 1;
      user-select: none;
      padding: 2px;
    }
    .drag-handle:hover { color: var(--primary); }
    tr.dragging td { opacity: 0.45; }
    tr.drop-above td { box-shadow: inset 0 2px 0 0 var(--primary); }
    tr.drop-below td { box-shadow: inset 0 -2px 0 0 var(--primary); }

    table.sheet input.cell-text,
    table.sheet input.cell-number {
      width: 100%;
      border: 1px solid transparent;
      background: transparent;
      padding: 4px;
      font: inherit;
      border-radius: 5px;
      text-align: center;
      color: inherit;
    }
    table.sheet input.cell-text:focus,
    table.sheet input.cell-number:focus {
      outline: none;
      border-color: var(--primary);
      background: #fff;
    }

    select.status-select {
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 4px 2px;
      font: inherit;
      font-size: 0.74rem;
      font-weight: 600;
      cursor: pointer;
      width: 100%;
    }
    select.status-select:focus { outline: none; box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25); }

    input.cell-date {
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 4px 3px;
      font: inherit;
      font-size: 0.74rem;
      width: 100%;
      background: #fff;          /* empty cells stay white */
      color: var(--text);
      cursor: pointer;
      text-align: center;
    }
    input.cell-date:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25); }

    /* A date that has been filled in and is not late reads blue, so a glance
       down a column shows which dates are actually set.  Applies on every
       sheet — Mech and Base VMC alike. */
    input.cell-date.has-date {
      background: var(--cell-blue);
      border-color: var(--cell-blue-border);
      color: var(--cell-blue-text);
      font-weight: 600;
    }
    input.cell-date.overdue { border-color: #fca5a5; background: #fef2f2; color: #b91c1c; font-weight: 700; }
    input.cell-date.due-soon { border-color: #fed7aa; background: #fff7ed; color: #b45309; font-weight: 700; }

    input.cell-check { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }

    tr.row-overdue td { background: #fff5f5; }
    tr.row-overdue td.sno { color: var(--danger); }

    .st-done          { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
    .st-not-done      { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
    .st-under-process { background: #fef3c7; color: #92400e; border-color: #fde68a; }
    /* N/A — deliberately neutral, so it reads as "excluded", not "pending". */
    .st-na            { background: #f1f5f9; color: #64748b; border-color: #cbd5e1; }

    /* ---------- Split station rows (status band + date band) --------------
       Every station occupies two table rows.  The frozen left-hand columns
       (handle / S.NO / station / due) span both with rowspan=2 so the station
       reads as one tall cell, while each stage column is divided into a status
       cell on top and its completion date underneath. */

    tr.row-main > td { border-bottom: 1px solid #eef1f5; }

    /* The spanned cells must keep the *outer* border, not the inner one. */
    tr.row-main > td.span2 {
      border-bottom: 2px solid var(--border);
      vertical-align: middle;
    }

    tr.row-dates > td {
      background: #fafbfd;
      border-bottom: 2px solid var(--border);
      padding: 2px 3px;
    }

    /* Station reads as the row's title. */
    table.sheet td.col-station input.cell-text {
      font-size: 0.9rem;
      font-weight: 600;
      text-align: left;
      padding: 6px 7px;
      min-height: 34px;
    }

    .date-band {
      font-size: 0.68rem;
      color: #64748b;
      line-height: 1.35;
      white-space: nowrap;
      display: block;
      padding: 3px 2px;
      border-radius: 4px;
      min-height: 20px;
    }
    .date-band.filled {
      color: #15803d;
      font-weight: 700;
      background: #f0fdf4;
    }
    .date-band.empty::before {
      content: "—";
      color: #cbd5e1;
    }
    /* Editable variant for master users — click the date to override it. */
    input.date-band-input {
      width: 100%;
      border: 1px solid transparent;
      background: transparent;
      font: inherit;
      font-size: 0.68rem;
      font-weight: 700;
      color: #15803d;
      text-align: center;
      border-radius: 4px;
      padding: 2px 1px;
      cursor: pointer;
    }
    input.date-band-input:hover { border-color: #bbf7d0; background: #f0fdf4; }
    input.date-band-input:focus {
      outline: none;
      border-color: var(--primary);
      background: #fff;
    }

    /* Sub-header row naming the two bands. */
    table.sheet thead tr.head-sub th {
      font-size: 0.6rem;
      font-weight: 600;
      text-transform: none;
      letter-spacing: 0;
      color: #94a3b8;
      background: #f1f5f9;
      padding: 2px 4px;
      top: 30px;
    }

    .row-del, .row-cmt {
      border: none;
      background: transparent;
      cursor: pointer;
      font-size: 0.95rem;
      line-height: 1;
      padding: 4px 5px;
      border-radius: 6px;
    }
    .row-del { color: var(--danger); }
    .row-del:hover { background: rgba(220, 38, 38, 0.1); }
    .row-cmt { color: var(--muted); position: relative; }
    .row-cmt:hover { background: rgba(37, 99, 235, 0.1); color: var(--primary); }
    .row-cmt .cmt-count {
      position: absolute;
      top: -2px; right: -2px;
      background: var(--primary);
      color: #fff;
      font-size: 0.58rem;
      font-weight: 700;
      border-radius: 999px;
      padding: 0 4px;
      min-width: 13px;
      line-height: 13px;
    }

    /* Subheading row */
    tr.subheading-row td {
      background: #f1f5f9;
      border-top: 2px solid #cbd5e1;
      border-bottom: 2px solid #cbd5e1;
      padding: 0;
    }
    tr.subheading-row td.sh-label { text-align: center; padding: 0 8px; }
    input.subheading-input {
      width: 100%;
      border: none;
      background: transparent;
      padding: 8px 4px;
      font: inherit;
      font-size: 0.82rem;
      font-weight: 700;
      color: #334155;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      text-align: center;
    }
    input.subheading-input:focus { outline: none; background: #e2e8f0; border-radius: 4px; }
    input.subheading-input::placeholder { color: #94a3b8; font-weight: 600; text-transform: none; letter-spacing: 0; }

    .sheet-toolbar {
      display: flex;
      gap: 8px;
      margin: 14px 0 0;
      flex-wrap: wrap;
      align-items: center;
    }
    .sheet-filters {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
      margin-bottom: 12px;
    }

    .sheet-empty { padding: 30px 16px; text-align: center; color: var(--muted); font-size: 0.9rem; }
    .progress-note { margin-left: auto; font-size: 0.82rem; color: var(--muted); }

    /* ---------- Side panel (comments / activity) ---------- */
    .side-panel {
      position: fixed;
      top: 0; right: 0; bottom: 0;
      width: min(400px, 100%);
      background: var(--card);
      border-left: 1px solid var(--border);
      box-shadow: var(--shadow-lg);
      z-index: 70;
      display: flex;
      flex-direction: column;
      transform: translateX(100%);
      transition: transform 0.22s ease;
    }
    .side-panel.open { transform: translateX(0); }
    .panel-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 14px 16px;
      border-bottom: 1px solid var(--border);
    }
    .panel-head h3 { margin: 0; font-size: 0.98rem; }
    .panel-head .sub { font-size: 0.76rem; color: var(--muted); }
    .panel-content { flex: 1; overflow-y: auto; padding: 14px 16px; }
    .panel-foot { border-top: 1px solid var(--border); padding: 12px 16px; }
    .panel-foot textarea {
      width: 100%;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 8px 10px;
      font: inherit;
      font-size: 0.86rem;
      resize: vertical;
      min-height: 62px;
    }
    .panel-foot textarea:focus { outline: none; border-color: var(--primary); }

    .comment {
      border-bottom: 1px solid var(--border);
      padding: 10px 0;
    }
    .comment:last-child { border-bottom: none; }
    .comment .c-head { display: flex; justify-content: space-between; gap: 8px; font-size: 0.76rem; color: var(--muted); }
    .comment .c-who { font-weight: 700; color: var(--text); }
    .comment .c-body { font-size: 0.87rem; margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
    .mention { color: var(--primary); font-weight: 700; }

    .activity-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.84rem; }
    .activity-item:last-child { border-bottom: none; }
    .activity-item .a-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); margin-top: 7px; flex-shrink: 0; }
    .activity-item .a-time { color: var(--muted); font-size: 0.73rem; }

    /* ---------- Modal ---------- */
    .modal-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.45);
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
      z-index: 80;
    }
    .modal {
      background: var(--card);
      border-radius: 14px;
      box-shadow: var(--shadow-lg);
      width: min(760px, 100%);
      max-height: 86vh;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    .modal-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 16px 20px;
      border-bottom: 1px solid var(--border);
    }
    .modal-head h3 { margin: 0; font-size: 1.05rem; }
    .modal-body { padding: 18px 20px; overflow-y: auto; }
    .modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

    /* Column manager */
    .col-row {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px;
      border: 1px solid var(--border);
      border-radius: 8px;
      margin-bottom: 8px;
      background: #fff;
    }
    .col-row input[type="text"] {
      flex: 1;
      min-width: 120px;
      padding: 7px 9px;
      border: 1px solid var(--border);
      border-radius: 6px;
      font: inherit;
      font-size: 0.86rem;
    }
    .col-row select {
      padding: 7px 8px;
      border: 1px solid var(--border);
      border-radius: 6px;
      font: inherit;
      font-size: 0.82rem;
      background: #fff;
    }
    .col-row .ord-btn {
      border: 1px solid var(--border);
      background: #f8fafc;
      border-radius: 6px;
      cursor: pointer;
      padding: 4px 7px;
      font-size: 0.8rem;
      line-height: 1;
    }
    .col-row .ord-btn:disabled { opacity: 0.35; cursor: default; }

    /* Charts */
    .chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
    .chart-box { min-height: 260px; }
    .chart-box h4 { margin: 0 0 10px; font-size: 0.88rem; color: var(--muted); }
    .chart-fallback { color: var(--muted); font-size: 0.86rem; text-align: center; padding: 40px 10px; }

    /* Gantt (Phase 6.2) */
    .gantt { overflow-x: auto; }
    .gantt-inner { min-width: 640px; }
    .gantt-axis { display: flex; border-bottom: 1px solid var(--border); margin-left: 170px; position: relative; height: 22px; }
    .gantt-tick { position: absolute; top: 0; font-size: 0.68rem; color: var(--muted); border-left: 1px solid var(--border); padding-left: 4px; height: 100%; }
    .gantt-row { display: flex; align-items: center; height: 30px; border-bottom: 1px solid #f1f5f9; }
    .gantt-label {
      width: 170px;
      flex-shrink: 0;
      font-size: 0.78rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      padding-right: 10px;
    }
    .gantt-track { position: relative; flex: 1; height: 100%; }
    .gantt-bar {
      position: absolute;
      top: 7px;
      height: 15px;
      border-radius: 4px;
      background: var(--primary);
      color: #fff;
      font-size: 0.64rem;
      line-height: 15px;
      padding: 0 5px;
      overflow: hidden;
      white-space: nowrap;
      min-width: 8px;
    }
    .gantt-bar.g-done { background: var(--done); }
    .gantt-bar.g-progress { background: var(--under); }
    .gantt-bar.g-not { background: #94a3b8; }
    .gantt-bar.g-overdue { background: var(--notdone); }
    .gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(37,99,235,.55); }

    /* ---------- Toast ---------- */
    .toast-stack {
      position: fixed;
      left: 50%;
      bottom: 26px;
      transform: translateX(-50%);
      z-index: 100;
      display: flex;
      flex-direction: column;
      gap: 8px;
      align-items: center;
    }
    .toast {
      background: #1e293b;
      color: #fff;
      border-radius: 10px;
      padding: 11px 14px;
      font-size: 0.86rem;
      box-shadow: var(--shadow-lg);
      display: flex;
      align-items: center;
      gap: 14px;
      animation: toast-in 0.18s ease;
    }
    @keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
    .toast button {
      background: transparent;
      border: none;
      color: #93c5fd;
      font: inherit;
      font-weight: 700;
      cursor: pointer;
      padding: 0;
    }
    .toast button:hover { text-decoration: underline; }
    .toast .t-close { color: #94a3b8; font-weight: 400; }

    .save-state {
      font-size: 0.76rem;
      color: var(--muted);
      opacity: 0;
      transition: opacity 0.2s;
    }
    .save-state.show { opacity: 1; }

    /* ---------- Print (Phase 6.3) ---------- */
    .print-header { display: none; }

    @media print {
      @page { size: landscape; margin: 10mm; }
      body { background: #fff; }
      .app-header, .view-bar, .sheet-toolbar, .sheet-filters, .side-panel, .modal-backdrop,
      .toast-stack, #list-view, #back-btn, .notif-panel, .col-handle, .col-cmt, .col-del,
      .detail-sub, .target-field { display: none !important; }
      .print-header { display: block !important; margin-bottom: 12px; }
      .print-header h2 { margin: 0 0 4px; font-size: 15pt; }
      .print-header p { margin: 0; font-size: 9pt; color: #444; }
      .container.wide { padding: 0; }
      /* The on-screen scroll box must not clip the printed sheet. */
      .sheet-wrap {
        overflow: visible;
        border: none;
        box-shadow: none;
        max-height: none;
        min-height: 0;
      }
      table.sheet { min-width: 0 !important; font-size: 7.5pt; width: 100%; }
      table.sheet th, table.sheet td { padding: 3px 2px; }
      select.status-select, input.cell-text, input.cell-date, input.cell-number {
        border: none !important;
        background: transparent !important;
        -webkit-appearance: none;
        appearance: none;
        font-size: 7.5pt;
        text-align: center;
      }
      .st-done, .st-not-done, .st-under-process,
      tr.subheading-row td, table.sheet thead th {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
      }
      table.sheet thead th { position: static; }
      table.sheet .col-sno, table.sheet .col-station { position: static; box-shadow: none; }
    }

    @media (max-width: 900px) {
      table.sheet { min-width: 900px; }
    }
    @media (max-width: 600px) {
      .container { padding: 16px 12px 56px; }
      .container.wide { padding: 16px 12px 56px; }
      .search-box input { min-width: 150px; }
      .brand p { display: none; }
    }
