:root {
  color-scheme: light;
  font: 16px/1.56 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft JhengHei", sans-serif;
  --canvas: #f3f5f4; --paper: #fff; --ink: #172b23; --muted: #607168; --line: #dfe7e1;
  --green: #08734d; --green-dark: #065d3f; --mint: #e8f4ed; --gold: #f3d596; --night: #102f26;
  --danger: #a2353d; --danger-bg: #fff0ef; --radius: 15px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
h1, h2, h3, p { margin: 0; }
a { color: var(--green); }
button, input, select, textarea { font: inherit; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 43px; border: 1px solid var(--line); border-radius: 9px; padding: .5rem .9rem; background: var(--paper); color: var(--ink); font-weight: 650; font-size: .91rem; text-decoration: none; cursor: pointer; }
button:hover, .button:hover { background: #f5f8f6; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary, .button.primary { border-color: var(--green); background: var(--green); color: #fff; }
button.primary:not(:disabled):hover, .button.primary:hover { background: var(--green-dark); }
button.danger { color: var(--danger); background: var(--danger-bg); border-color: #f2d7d5; }
:focus-visible { outline: 3px solid #329d73; outline-offset: 3px; }
[hidden] { display: none !important; }
.topbar { min-height: 69px; padding: .6rem max(1rem, calc((100vw - 1100px)/2)); background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.brand { display: flex; align-items: center; gap: .7rem; color: var(--ink); text-decoration: none; font-size: 1.08rem; font-weight: 800; white-space: nowrap; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: #173e30; color: var(--gold); font-size: 1.38rem; }
.brand small { color: var(--muted); margin-left: .3rem; font-size: .78rem; font-weight: 650; }
.session { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.session .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.session button { min-height: 36px; padding: .4rem .65rem; white-space: nowrap; }
.shell { width: min(calc(100% - 2rem), 1100px); margin: 26px auto 45px; }
.loading, .empty { padding: 2rem 1rem; text-align: center; color: var(--muted); }
.hero { position: relative; isolation: isolate; overflow: hidden; min-height: 172px; padding: 29px 32px; border-radius: 17px; background: radial-gradient(ellipse at 75% 50%, #225342 0%, #14382b 42%, #102f26 90%); color: #fff; display: flex; justify-content: space-between; align-items: center; gap: 1.1rem; }
.hero::before, .hero::after { content: ""; position: absolute; z-index: -1; right: 106px; width: 250px; height: 250px; transform: rotate(45deg); border: 1px solid #f3d59643; border-radius: 28px; }
.hero::after { right: 112px; width: 238px; height: 238px; border-color: #f3d59629; }
.eyebrow { color: var(--gold); font-size: .82rem; font-weight: 700; letter-spacing: .12em; }
.hero h1 { margin: .13rem 0 .35rem; font-size: clamp(1.75rem, 3.5vw, 2.55rem); line-height: 1.24; }
.hero p:not(.eyebrow) { color: #d9eadf; font-size: .91rem; }
.hero .button, .hero button { background: #f6e5ba; border-color: #f6e5ba; color: #1c3a2e; flex-shrink: 0; }
.hero .button:hover, .hero button:hover { background: #faedce; }
.compact-hero { min-height: 105px; padding: 18px 23px; }
.compact-hero h1 { margin: .18rem 0 0; font-size: clamp(1.65rem, 3vw, 2.2rem); }
.schedule-strip { display: grid; grid-template-columns: minmax(220px, auto) 1fr; gap: 1rem; margin-top: .72rem; padding: .72rem .92rem; border: 1px solid #d5e7d9; border-radius: 12px; background: #edf6ef; }
.schedule-date { display: grid; align-content: center; border-right: 1px solid #cddfd1; padding-right: .95rem; }
.schedule-date span { color: var(--muted); font-size: .78rem; }
.schedule-date strong { color: var(--green-dark); font-variant-numeric: tabular-nums; font-size: 1.02rem; }
.schedule-rules { align-self: center; color: #465e51; font-size: .83rem; }
.schedule-rules strong { color: var(--green-dark); }
.summary { margin: 1rem 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .85rem; }
.metric { padding: .8rem 1.05rem; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.metric span { display: block; color: var(--muted); font-size: .83rem; }
.metric strong { margin-top: .1rem; display: block; font-size: 1.42rem; font-variant-numeric: tabular-nums; line-height: 1.3; }
.workspace { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.tabs { padding: .65rem .75rem; display: flex; flex-wrap: wrap; gap: .38rem; border-bottom: 1px solid var(--line); }
.tabs button { border-color: transparent; background: transparent; color: var(--muted); white-space: nowrap; }
.tabs button[aria-pressed="true"] { background: var(--mint); color: var(--green-dark); }
.section { padding: 1.2rem; }
.section + .section { border-top: 1px solid var(--line); }
.section-head, .row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .65rem; }
.section-head { margin-bottom: 1rem; }
.section-head h2, .section h2 { font-size: 1.22rem; }
.section h3 { font-size: 1.02rem; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; }
.filters #auction-search { width: 235px; }
label.field { display: grid; gap: .3rem; color: var(--ink); font-size: .88rem; font-weight: 650; }
input:not([type="checkbox"]), select, textarea { min-height: 43px; width: 100%; min-width: 0; padding: .49rem .65rem; border: 1px solid #cfdad2; background: #fff; color: var(--ink); border-radius: 8px; font-weight: 400; }
textarea { resize: vertical; min-height: 72px; }
input::placeholder, textarea::placeholder { color: #74827a; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.auction { border: 1px solid var(--line); border-radius: 13px; padding: .8rem .85rem; display: grid; grid-template-rows: auto 1fr auto; gap: .44rem; min-width: 0; }
.auction h3 { font-size: 1.08rem; overflow-wrap: anywhere; }
.auction .auction-id { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .78rem; }
.auction-meta { color: var(--muted); font-size: .84rem; }
.auction-identity { display: flex; gap: .6rem; align-items: center; min-width: 0; }
.auction-thumb { display: block; width: 57px; height: 57px; border: 1px solid var(--line); border-radius: 9px; object-fit: cover; flex: 0 0 auto; background: #f2f6f3; }
.auction-image { display: block; width: 100%; max-height: min(44vh, 440px); border-radius: 10px; border: 1px solid var(--line); object-fit: contain; background: #f2f6f3; }
.auction-price { display: flex; align-items: baseline; gap: .22rem .48rem; flex-wrap: wrap; overflow-wrap: anywhere; }
.auction-price strong { font-size: 1.26rem; font-variant-numeric: tabular-nums; }
.auction-actions { border-top: 1px solid var(--line); padding-top: .55rem; margin-top: .12rem; display: flex; justify-content: space-between; align-items: center; gap: .4rem; }
.auction-actions button { flex: 0 0 auto; }
.auction-deadline { display: flex; flex-wrap: wrap; align-items: baseline; gap: .16rem .42rem; font-size: .88rem; }
.auction-deadline strong { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: .42rem; }
.auction-deadline time { font-variant-numeric: tabular-nums; font-weight: 700; }
.deadline-label, .deadline-original { color: var(--muted); font-size: .82rem; }
.deadline-original { flex-basis: 100%; }
.extended .deadline-label, .extended time { color: #775010; }
.detail-deadline { padding: .58rem .73rem; border-radius: 8px; background: var(--mint); }
.detail-deadline.extended { background: #fbf0d7; }
.badge { border-radius: 6px; padding: .18rem .43rem; background: #edf0ee; color: #495750; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.badge.open, .badge.complete, .badge.approved { background: var(--mint); color: var(--green-dark); }
.badge.pending { background: #fbf0d7; color: #76520d; }
.badge.failed, .badge.cancelled, .badge.rejected { background: var(--danger-bg); color: var(--danger); }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.numbers { font-variant-numeric: tabular-nums; }
.auth-layout { min-height: calc(100vh - 146px); display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; gap: 0; margin: 0 auto; max-width: 870px; }
.auth-layout > .hero { display: grid; justify-content: start; align-content: center; border-radius: 17px 0 0 17px; margin: 0; }
.auth-layout > .hero::before, .auth-layout > .hero::after { right: -65px; top: 17%; }
.auth-card { display: grid; align-content: center; border: 1px solid var(--line); border-left: 0; padding: 1.75rem; border-radius: 0 17px 17px 0; background: var(--paper); }
.auth-card h2 { font-size: 1.4rem; margin-bottom: .45rem; }
.form-stack, .stack { display: grid; gap: .7rem; }
.auth-card form { margin: .8rem 0; }
.auth-secondary { display: grid; gap: .5rem; border-top: 1px solid var(--line); padding-top: .9rem; margin-top: .45rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.form-grid .span { grid-column: 1/-1; }
.action-row { display: flex; gap: .55rem; flex-wrap: wrap; }
.inline-note, .error-note { padding: .65rem .8rem; border-radius: 8px; background: var(--mint); color: var(--green-dark); font-size: .87rem; }
.error-note { background: var(--danger-bg); color: var(--danger); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { border-bottom: 1px solid var(--line); padding: .55rem .5rem; text-align: left; }
th { background: #f2f6f3; color: var(--muted); white-space: nowrap; }
td { overflow-wrap: anywhere; }
td:last-child:not(:first-child) { white-space: nowrap; }
td.actions { white-space: normal !important; }
td.actions button { min-height: 36px; padding: .32rem .49rem; }
.picker { display: grid; gap: .5rem; border: 1px solid var(--line); padding: .7rem; border-radius: 10px; }
.picker-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 280px; overflow-y: auto; gap: .35rem; }
.picker-choice { display: flex; gap: .55rem; align-items: flex-start; padding: .45rem; background: #f6f8f6; border-radius: 7px; overflow-wrap: anywhere; }
.picker-choice input { width: 18px; height: 18px; margin-top: .23rem; accent-color: var(--green); flex-shrink: 0; }
.picker-choice strong, .picker-choice small { display: block; }
.picker-choice small { color: var(--muted); }
.result-cards { margin-top: .75rem; }
dialog { width: min(calc(100% - 1.15rem), 690px); max-height: min(92vh, 990px); margin: auto; border: 1px solid var(--line); border-radius: 16px; padding: 0; color: var(--ink); box-shadow: 0 14px 80px #051b1247; }
dialog::backdrop { background: #0b261db3; }
.dialog-head { position: sticky; top: 0; z-index: 1; padding: 1rem 1.15rem; background: #f4f8f5; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: .7rem; }
.dialog-head h2 { font-size: 1.25rem; overflow-wrap: anywhere; }
.dialog-head button { min-height: 35px; padding: .22rem .6rem; flex-shrink: 0; }
.dialog-body { padding: 1.05rem 1.15rem; }
.dialog-block { padding-top: .74rem; border-top: 1px solid var(--line); }
.item-desc { white-space: pre-wrap; overflow-wrap: anywhere; }
.attachment { border: 1px solid var(--line); border-radius: 10px; padding: .75rem; display: grid; gap: .48rem; min-width: 0; }
.attachment-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.file-button:focus-within { outline: 3px solid #329d73; outline-offset: 2px; }
.paste-target { border-style: dashed; color: var(--green-dark); }
.attachment-preview { width: 100%; max-height: min(28vh, 260px); object-fit: contain; border-radius: 8px; background: #f3f6f3; }
.attachment-status:empty { display: none; }
.attachment-suggestion { justify-self: start; text-align: left; overflow-wrap: anywhere; }
.toast-region { position: fixed; z-index: 5; right: 16px; bottom: 16px; width: min(375px, calc(100% - 32px)); display: grid; gap: .4rem; pointer-events: none; }
.toast { padding: .65rem .8rem; border: 1px solid #2f6754; border-radius: 10px; background: #173e30; color: white; box-shadow: 0 8px 25px #0c241f26; }
.toast.error { background: #872c34; border-color: #9b444a; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
@media (max-width: 670px) {
  .topbar { min-height: 60px; gap: .4rem; }
  .brand small { display: none; }
  .session .who { max-width: 105px; font-size: .83rem; }
  .shell { width: min(calc(100% - 1.1rem), 1100px); margin-top: 12px; }
  .hero { min-height: 140px; padding: 1.05rem; align-items: flex-start; flex-direction: column; }
  .hero::before, .hero::after { right: -90px; }
  .compact-hero { min-height: 0; padding: .82rem; flex-direction: row; align-items: center; gap: .45rem; }
  .compact-hero button { padding: .34rem .55rem; min-height: 39px; font-size: .8rem; }
  .schedule-strip { grid-template-columns: 1fr; gap: .4rem; padding: .55rem .66rem; }
  .schedule-date { border-right: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: .16rem .44rem; }
  .schedule-rules { font-size: .79rem; }
  .summary { gap: .36rem; margin: .65rem 0; }
  .metric { padding: .53rem .48rem; }
  .metric strong { font-size: 1.21rem; }
  .metric span { font-size: .73rem; }
  .section { padding: .8rem; }
  .cards { grid-template-columns: 1fr; }
  .filters { width: 100%; }
  .filters > * { flex: 1 1 120px; }
  .filters #auction-search { width: auto; }
  .tabs { gap: .15rem; padding: .4rem; }
  .tabs button { min-height: 39px; padding: .37rem .48rem; font-size: .8rem; }
  .auth-layout { min-height: auto; grid-template-columns: 1fr; }
  .auth-layout > .hero { border-radius: 14px 14px 0 0; min-height: 128px; }
  .auth-card { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px; padding: 1.12rem; }
  .form-grid { grid-template-columns: 1fr; }
  .picker-list { grid-template-columns: 1fr; }
}
