/* ============================================================================
 * maint-redesign.css — MAINT-REDESIGN-20261026
 *
 * Modern, clean restyle of the Maintenance section ONLY: the hub overlay
 * (Today / Requests / Equipment / Supplies / Manage), Report Issue, Create
 * Work Order, request detail, asset detail, stats, the standalone equipment
 * register, and the photo lightbox.
 *
 * Method (same pattern as mgmt-theme.css for Shop Management): the light
 * design tokens are pinned on the maintenance overlay roots, so Maintenance
 * renders in the Shop Management light language — clean light surfaces,
 * near-black text, gold #C9A53F accent — regardless of the app's dark/light
 * theme. Component rules below modernize chrome, tabs, cards, rows, forms
 * and badges on top of those tokens. Every rule is scoped to the roots
 * below; nothing outside Maintenance can change. No ids, markup structure,
 * data flow or behavior is touched by this file.
 *
 * Contrast: every text color used here is >= 4.5:1 on its surface
 * (verified in the sim, see REPORT.md).
 * ========================================================================== */

#maintenanceOverlay,
#reportIssueOverlay,
#workOrderCreateOverlay,
#maintenanceDetailOverlay,
#assetDetailOverlay,
#maintenanceStatsOverlay,
#maintenanceAssetsOverlay,
#assetAssignModal,
#assetsImportOverlay,
#maintTodayOverlay,
#maintManageOverlay {
  /* --- pinned light tokens (mirror of the staff.css :root light set) --- */
  --bg: #eef0f3; --surface: #ffffff; --surface-2: #f6f7f9;
  --border: #dfe3e8; --border-strong: #c9d1d9;
  --text: #1d2733; --muted: #5d6b78; --faint: #626d76;
  --gold: #c9a53f; --gold-strong: #a8862a; --gold-tint: #faf3dd;
  --blue: #1f6fd6; --blue-bg: #e9f2fd;
  --green: #1f8a4c; --green-dark: #17703c; --green-bg: #e9f6ec;
  --amber: #b97a12; --amber-bg: #fdf3e3;
  --red: #d64545; --red-bg: #fdeeee;
  --shadow-card: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --shadow-lift: 0 4px 12px rgba(16,24,40,.10), 0 1px 3px rgba(16,24,40,.08);
  --steel: #eef0f3; --panel: #ffffff; --panel2: #f6f7f9; --line: #dfe3e8;
  --paper: #1d2733; --ink: #171a1f; --ink-soft: #5d6b78;
  --yellow: #c9a53f; --orange: #ff6b35; --pink: #ff1053;
  --card-paper: #ffffff;
  --on-accent: #171204;
  --link-blue: #1f6fd6; --yellow-text: #a8862a;
  --dash-panel-bg: #eef0f3; --dash-panel-border: #c8d0da; --dash-accent: #c9a53f;
  --orange-text: #a03d16; --overdue-count-text: #b71c1c;
  --muted2: #626d76;
  --tint-rgb: 0,0,0;
  --shadow-color: rgba(16,24,40,0.12);
  --line-subtle: #e4e7ec;
  --tag-bg: #eaf3fb; --tag-border: #b8d7ef;
  --brass: #c9a53f; --brass-hi: #c9a53f; --brass-deep: #a8862a; --brass-dim: #a8862a;
  --brass-grad: #c9a53f; --brass-ink: #171204; --brass-line-hi: #c9d1d9;
  color-scheme: light;
  font-family: 'Inter', system-ui, sans-serif;

  /* --- modal chrome ------------------------------------------------------ */
  .modal-box {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(16,24,40,.18), 0 2px 6px rgba(16,24,40,.10);
    color: var(--text);
  }
  /* The hub shell is the gray "page"; panes and moved-in boxes are cards. */
  .modal-box.parts-dash {
    background: var(--bg);
    border-color: var(--dash-panel-border);
  }
  .maint-hub-pane > .modal-box,
  #maintReportPanel > .modal-box {
    border: none;
    border-radius: 14px;
    box-shadow: var(--shadow-card);
    width: auto !important;
    max-width: none;
  }
  .modal-box::-webkit-scrollbar { width: 10px; }
  .modal-box::-webkit-scrollbar-thumb { background: #c9d1d9; border-radius: 5px; border: 2px solid var(--panel); }
  .modal-box::-webkit-scrollbar-track { background: transparent; }

  h1 { color: var(--text); letter-spacing: .01em; text-transform: none; font-weight: 800; }
  h2 { color: var(--text); }

  /* --- header ------------------------------------------------------------ */
  .parts-dash-header {
    border-bottom: 2px solid var(--gold);
    padding-bottom: 12px;
    margin-bottom: 14px;
  }
  .parts-dash-header h1 { font-size: calc(20px * var(--font-scale, 1)); }

  /* --- buttons ----------------------------------------------------------- */
  .btn {
    background: #ffffff;
    border: 1px solid var(--border-strong);
    color: var(--text);
    border-radius: 9px;
    box-shadow: 0 1px 1px rgba(16,24,40,.04);
  }
  .btn:hover { border-color: var(--gold); color: var(--text); }
  .btn-primary {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--on-accent);
    box-shadow: 0 1px 2px rgba(16,24,40,.12);
  }
  .btn-primary:hover { background: var(--gold-strong); border-color: var(--gold-strong); color: #ffffff; }
  .btn-danger { background: #ffffff; color: #b23333; border-color: #d64545; }
  .btn-danger:hover { background: var(--red-bg); border-color: #b23333; color: #b23333; }
  :focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }

  /* --- hub tab bar: segmented pills -------------------------------------- */
  #maintHubTabs {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    flex-wrap: wrap;
    box-shadow: var(--shadow-card);
    margin: 2px 0 14px;
  }
  #maintHubTabs .parts-tab {
    border: none;
    border-radius: 9px;
    padding: 8px 14px;
    color: var(--muted);
    font-weight: 700;
  }
  #maintHubTabs .parts-tab:hover { color: var(--text); background: var(--surface-2); }
  #maintHubTabs .parts-tab.is-active { background: var(--gold); color: var(--on-accent); }

  /* Secondary tab rows (Requests/Report, Active/Completed): clean underline */
  #maintMainTabs, #maintTabs {
    border-bottom: 1px solid var(--border);
    gap: 2px;
  }
  #maintMainTabs .parts-tab, #maintTabs .parts-tab {
    color: var(--muted);
    border-bottom: 2px solid transparent;
    border-radius: 8px 8px 0 0;
  }
  #maintMainTabs .parts-tab:hover, #maintTabs .parts-tab:hover { color: var(--text); }
  #maintMainTabs .parts-tab.is-active, #maintTabs .parts-tab.is-active {
    color: var(--text);
    border-bottom-color: var(--gold);
  }

  /* List / Calendar segmented toggle (was purple) */
  #maintViewTabs .mgmt-viewtab {
    background: #ffffff;
    border: 1px solid var(--border-strong);
    color: var(--muted);
    border-radius: 9px;
    font-weight: 700;
  }
  #maintViewTabs .mgmt-viewtab:hover { color: var(--text); border-color: var(--gold); }
  #maintViewTabs .mgmt-viewtab.is-on {
    background: #14161a;
    border-color: #14161a;
    color: #ffffff;
  }

  /* Manage sub-tabs (Daily checks / History) */
  .maint-tab.is-on { background: var(--gold); border-color: var(--gold); color: var(--on-accent); }

  /* --- forms -------------------------------------------------------------- */
  .field label { color: var(--muted); font-weight: 700; }
  .field input, .field select, .field textarea,
  input[type="text"], input[type="number"], input[type="datetime-local"],
  select, textarea {
    background: #ffffff;
    border: 1px solid var(--border-strong);
    color: var(--text);
    border-radius: 9px;
  }
  .field input:focus, .field select:focus, .field textarea:focus,
  input:focus, select:focus, textarea:focus {
    border-color: var(--gold);
    outline: 3px solid rgba(201,165,63,.25);
    outline-offset: 0;
  }
  input::placeholder, textarea::placeholder { color: var(--faint); }

  /* --- request / asset / work cards --------------------------------------- */
  .maint-card {
    background: #ffffff;
    border-color: var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    padding: 13px 16px 13px 14px;
    color: var(--text);
  }
  .maint-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lift); }
  .maint-card.is-overdue { background: #fff7f7; }
  .maint-card-title { color: var(--text); font-weight: 700; }
  .maint-card-sub { color: var(--muted); }
  .maint-card-flag {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--muted);
    font-weight: 700;
  }
  .maint-card-flag.flag-hot { background: var(--red-bg); border-color: #eec5c5; color: #b23333; }
  .maint-card-flag.flag-warn { background: var(--amber-bg); border-color: #ecd9a8; color: #8a5e0b; }
  .maint-card-flag.flag-wo { background: #f0eafd; border-color: #d9ccf5; color: #5b3ba8; }
  .maint-card-flag.flag-ok { background: var(--green-bg); border-color: #bfe3cb; color: #17703c; }

  /* Legacy card shapes still used by My Reports / older lists */
  .maint2-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    color: var(--text);
  }
  .maint2-title { color: var(--text); }
  .maint2-meta, .maint2-who, .maint2-when { color: var(--muted); }
  .maint2-prio.prio-critical { background: var(--red-bg); color: #b23333; }
  .maint2-prio.prio-high { background: #fdeeda; color: #9a4a12; }
  .maint2-prio.prio-medium { background: var(--amber-bg); color: #8a5e0b; }
  .maint2-prio.prio-low { background: #eef1f4; color: #4a5a6a; }
  .maint2-status.st-open { border-color: var(--amber); color: #8a5e0b; }
  .maint2-status.st-in_progress { border-color: var(--blue); color: #175cb6; }
  .maint2-status.st-on_hold { border-color: var(--border-strong); color: var(--muted); }
  .maint2-status.st-completed { border-color: var(--green); color: #17703c; }
  .maint2-due.overdue { color: #b23333; }
  .maint2-empty-title { color: var(--text); }

  /* Standalone equipment register rows */
  .maint-v2-row {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    color: var(--text);
  }
  .maint-v2-row:hover { background: var(--surface-2); }
  .maint-v2-title { color: var(--text); }
  .maint-v2-sub { color: var(--muted); }
  .maint-v2-badge { background: var(--surface-2); color: var(--muted); }
  .maint-v2-badge.crit, .maint-v2-badge.overdue { background: var(--red-bg); color: #b23333; }
  .maint-v2-badge.high { background: var(--amber-bg); color: #8a5e0b; }
  .maint-v2-badge.completed { background: var(--green-bg); color: #17703c; }
  .maint-v2-time { color: var(--muted); }
  .maint-row:hover { border-color: var(--gold); }

  /* --- Today -------------------------------------------------------------- */
  .maint-tick {
    background: #ffffff;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    color: var(--text);
    box-shadow: var(--shadow-card);
  }
  .maint-tick:hover { border-color: var(--gold); }
  .maint-tick.is-done { border-color: var(--green); background: var(--green-bg); }
  .maint-overdue-title { color: #b23333; }
  .maint-overdue-banner {
    background: var(--red-bg);
    border-color: #e5b4b4;
    border-left-color: var(--red);
    border-radius: 12px;
  }

  /* --- calendar + agenda (maintenance copies only) ------------------------ */
  .mgmt-cal-cell { background: #ffffff; border-color: var(--border); border-radius: 8px; }
  .mgmt-cal-cell.is-today { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
  .mgmt-cal-cell.drop-hover { background: var(--gold-tint); border-color: var(--gold); }
  .mgmt-cal-dow { color: var(--muted); }
  .mgmt-cal-daynum { color: var(--muted); }
  .mgmt-cal-item { background: var(--surface-2); color: var(--text); }
  .mgmt-cal-item.is-overdue { background: var(--red-bg); }
  .mgmt-cal-more { color: var(--muted); }
  .mgmt-cal-nodue { border-color: var(--border); }
  .mgmt-cal-nodue-head { color: var(--muted); }
  .mgmt-cal-title { color: var(--text); }
  .maint-agenda-day { color: var(--muted); }
  .maint-agenda-item {
    background: #ffffff;
    border-color: var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    color: var(--text);
  }
  .maint-agenda-item.is-overdue { border-color: #e5b4b4; }

  /* --- supplies ------------------------------------------------------------- */
  .sup-cat-head { color: var(--muted); }
  .sup-item, .sup-req {
    background: #ffffff;
    border-color: var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    color: var(--text);
  }
  .sup-is-low { border-color: var(--amber); background: #fffbf1; }
  .sup-item-name { color: var(--text); }
  .sup-item-meta { color: var(--muted); }
  .sup-low-badge { color: #8a5e0b; }
  .sup-custom-badge { color: var(--gold-strong); }
  .sup-status { color: var(--muted); }
  .sup-onhand { color: var(--text); }
  .sup-unit { color: var(--muted); }
  .sup-edit { background: var(--surface-2); border-color: var(--border-strong); }

  /* --- request detail -------------------------------------------------------- */
  .mdet-status-btn { border-radius: 10px; }
  .mdet-photo { border-radius: 10px; border: 1px solid var(--border); }
  .empty-hint { color: var(--muted); }

  /* --- asset detail ------------------------------------------------------------ */
  .ad-h { color: var(--muted); }
  .ad-photo, .ad-thumb { border-color: var(--border); border-radius: 12px; }
  .ad-nophoto { border-color: var(--border-strong); color: var(--muted); }
  .ad-sched {
    background: #ffffff;
    border-color: var(--border);
    border-left-color: var(--green);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    color: var(--text);
  }
  .ad-sched.is-over { border-left-color: var(--red); background: #fff7f7; }
  .ad-sched.is-soon { border-left-color: var(--gold); }
  .ad-sched .sched-over { color: #b23333; }
  .ad-sched .sched-soon { color: #8a5e0b; }
  .ad-sched .sched-ok { color: #17703c; }
  .ad-sched .sched-sub { color: var(--muted); }
  .ad-hist {
    background: #ffffff;
    border-color: var(--border);
    border-radius: 10px;
    color: var(--text);
  }
  .ad-hist-when, .ad-hist-by { color: var(--muted); }
  .ad-hist-kind { background: var(--surface-2); color: var(--muted); }

  /* --- stats ------------------------------------------------------------------- */
  .maint-stats-tiles .side-stat {
    background: #ffffff !important;
    border-color: var(--border) !important;
    border-radius: 12px !important;
    box-shadow: var(--shadow-card);
    color: var(--text);
  }
  .maint-stats-tiles .side-stat.tone-red { color: #b23333; border-color: #e5b4b4 !important; }

  /* --- report issue -------------------------------------------------------------- */
  .ri-section-label { color: var(--muted); font-weight: 700; }
  .priority-pick-btn {
    background: #ffffff;
    border: 1px solid var(--border-strong);
    color: var(--text);
    border-radius: 12px;
  }
  .priority-pick-btn:hover { border-color: var(--gold); }
  .priority-pick-btn.pri-critical.selected { border-color: var(--red); background: var(--red-bg); color: #b23333; }
  .priority-pick-btn.pri-high.selected { border-color: #e07b39; background: #fdeeda; color: #9a4a12; }
  .priority-pick-btn.pri-medium.selected { border-color: var(--gold); background: var(--amber-bg); color: #8a5e0b; }
  .priority-pick-btn.pri-low.selected { border-color: var(--border-strong); background: #eef1f4; color: #4a5a6a; }
  .ri-photo-tap {
    border: 1px dashed var(--border-strong);
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--muted);
  }
  .ri-photo-tap:hover { border-color: var(--gold); color: var(--text); }

}

/* Photo lightbox: keep the dark stage (photos read best on it), soften edges */
#maintPhotoLightbox img { border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.5); }

/* Phone: tighter chrome, same language */
@media (max-width: 820px) {
  #maintenanceOverlay .modal-box,
  #reportIssueOverlay .modal-box,
  #workOrderCreateOverlay .modal-box,
  #maintenanceDetailOverlay .modal-box,
  #assetDetailOverlay .modal-box,
  #maintenanceStatsOverlay .modal-box,
  #maintenanceAssetsOverlay .modal-box {
    border-radius: 14px;
    padding: 16px;
  }
  #maintenanceOverlay .maint-hub-pane > .modal-box,
  #maintenanceOverlay #maintReportPanel > .modal-box { padding: 14px; }
  /* Phones keep the current live hub layout — a sticky 4-across grid with
   * Manage wrapping to row 2 — instead of the desktop flex pills: at a 30%
   * flex basis the four main tabs' nowrap labels overflowed the bar instead
   * of wrapping (measured in sim: bar scrollWidth 420 vs clientWidth 366). */
  #maintenanceOverlay #maintHubTabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
  }
  #maintenanceOverlay #maintHubTabs .parts-tab {
    flex: none;
    min-height: 50px;
    text-align: center;
    /* The live phone metrics (staff.css) — the desktop pill padding/font
     * would overflow the 1fr tracks at 412px. */
    padding: 6px 2px;
    font-size: max(12.5px, calc(12.5px * var(--font-scale, 1)));
  }
  #maintenanceOverlay .maint-card { min-height: 88px; }
}

/* ============================================================================
 * POLISH PASS — MAINT-POLISH-20261027 (launch elevation, presentation only)
 *
 * A refinement layer on top of MAINT-REDESIGN-20261026, same language
 * (light pinned surfaces, white cards, #1D2733 ink, gold #C9A53F accent):
 *   - one consistent radius system (cards 14px, panes 16px, controls 10px,
 *     pills fully round) and softer, deeper pane shadows;
 *   - the hub tab bar becomes a true segmented control (recessed surface-2
 *     track, transparent inactive tabs, gold active tab with a soft lift);
 *   - the request/work cards get their slim 3px priority accent bar back
 *     (the base card language; the redesign's border-color shorthand had
 *     flattened it) with tighter type hierarchy and uppercase micro-flags;
 *   - Today: pill-shaped progress track with a green gradient fill, and the
 *     overdue banner flattened into a single panel (inner cards lose their
 *     own box so it no longer reads as a box inside a box);
 *   - supplies category heads, empty states, detail/stats/calendar radii
 *     aligned to the same system; soft 150ms transitions on interactive
 *     chrome (cards, tabs, buttons, ticks).
 * No ids, markup, data flow or behavior is touched, and no text color
 * changes — so the redesign's >= 4.5:1 contrast measurements carry over.
 * ========================================================================== */

#maintenanceOverlay,
#reportIssueOverlay,
#workOrderCreateOverlay,
#maintenanceDetailOverlay,
#assetDetailOverlay,
#maintenanceStatsOverlay,
#maintenanceAssetsOverlay,
#assetAssignModal,
#assetsImportOverlay,
#maintTodayOverlay,
#maintManageOverlay {

  /* --- rhythm: header breathes once, then even 16px section gaps -------- */
  .parts-dash-header { padding-bottom: 14px; margin-bottom: 12px; }
  #maintMainTabs, #maintTabs { margin-bottom: 12px; }
  #maintMainTabs .parts-tab.is-active, #maintTabs .parts-tab.is-active { font-weight: 700; }

  /* --- hub tabs: recessed segmented track -------------------------------- */
  #maintHubTabs {
    background: var(--surface-2);
    box-shadow: inset 0 1px 3px rgba(16,24,40,.05);
    margin-bottom: 16px;
  }
  #maintHubTabs .parts-tab {
    background: transparent;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
  }
  #maintHubTabs .parts-tab.is-active {
    box-shadow: 0 1px 4px rgba(168,134,42,.40), 0 1px 2px rgba(16,24,40,.12);
  }

  /* --- controls: one radius, soft motion ---------------------------------- */
  .btn { border-radius: 10px; transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease; }
  .btn-primary { box-shadow: 0 1px 2px rgba(168,134,42,.35), 0 1px 3px rgba(16,24,40,.10); }
  .field input, .field select, .field textarea,
  input[type="text"], input[type="number"], input[type="datetime-local"],
  select, textarea { border-radius: 10px; }
  #maintViewTabs .mgmt-viewtab { border-radius: 10px; transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
  .mdet-status-btn { border-radius: 12px; }

  /* --- panes: rounder, airier shadow --------------------------------------- */
  .maint-hub-pane > .modal-box,
  #maintReportPanel > .modal-box {
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(16,24,40,.05), 0 6px 18px rgba(16,24,40,.05);
  }

  /* --- cards: 14px system, slim priority accent, tighter hierarchy -------- */
  .maint-card {
    border-radius: 14px;
    border-left: 3px solid var(--accent);
    padding: 14px 16px 14px 13px;
    transition: box-shadow .16s ease, border-color .16s ease;
  }
  .maint-card-title { font-weight: 800; letter-spacing: -0.01em; }
  .maint-card-flag {
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: calc(10px * var(--font-scale, 1));
    padding: 3px 8px;
  }
  .maint2-card, .maint-v2-row, .maint-agenda-item { border-radius: 14px; }

  /* --- Today: pill progress, flattened overdue panel, rounder ticks ------- */
  #maintTodayProgress > div:last-child { border-radius: 999px !important; }
  #maintTodayProgress > div:last-child > div {
    border-radius: 999px !important;
    background: linear-gradient(90deg, var(--green-dark), var(--green)) !important;
  }
  .maint-overdue-banner { border-radius: 14px; padding: 8px; }
  .maint-overdue-banner .maint-card {
    background: transparent;
    border-color: transparent;
    /* The banner carries its own 4px red left bar; the card's accent would
     * double it, so it is blanked here (width kept, layout unchanged). */
    border-left: 3px solid transparent;
    box-shadow: none;
    margin-bottom: 4px;
  }
  .maint-overdue-banner .maint-card:last-child { margin-bottom: 0; }
  .maint-tick { border-radius: 14px; transition: border-color .15s ease, background-color .15s ease; }

  /* --- supplies: label-style category heads, rounder rows ------------------ */
  .sup-cat-head {
    font-size: calc(11.5px * var(--font-scale, 1));
    letter-spacing: .07em;
    margin: 18px 2px 8px;
  }
  .sup-item, .sup-req { border-radius: 14px; }

  /* --- empty states: one soft dashed panel --------------------------------- */
  .empty-hint {
    background: var(--surface-2);
    border: 1px dashed var(--border-strong);
    border-radius: 12px;
    padding: 16px 14px;
    text-align: center;
  }

  /* --- detail / stats / calendar alignment --------------------------------- */
  .ad-h { letter-spacing: .06em; margin-bottom: 10px; }
  .ad-sched { border-radius: 14px; }
  .ad-hist { border-radius: 12px; }
  .mdet-photo { border-radius: 12px; }
  .maint-stats-tiles .side-stat { border-radius: 14px !important; }
  .mgmt-cal-cell { border-radius: 10px; }
  .priority-pick-btn, .ri-photo-tap { border-radius: 14px; }
}

/* Phone: hub tabs become crisp white tiles on the recessed track */
@media (max-width: 820px) {
  #maintenanceOverlay #maintHubTabs .parts-tab {
    background: #ffffff;
    border: 1px solid var(--border);
  }
  #maintenanceOverlay #maintHubTabs .parts-tab.is-active {
    background: var(--gold);
    border-color: var(--gold);
  }
}
