@import "/mk3/assets/palette.css";

:root {
  --god-font: 'Rubik', 'PingFang HK', 'PingFang TC', 'Noto Sans HK', 'Microsoft JhengHei', system-ui, sans-serif;
  --god-line: #e5eaf2;
  --god-muted: #65738a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--god-font);
  color: var(--text, #18263e);
  background: #f6f8fc;
  line-height: 1.55;
}
.mk-nav a { text-decoration: none; }

.god-hero {
  padding: 58px 24px 62px;
  color: #fff;
  background:
    radial-gradient(circle at 88% -20%, rgba(251,171,24,.25), transparent 34%),
    linear-gradient(135deg, var(--navy, #172f5f), var(--navy-dark, #0e1d3c));
}
.god-hero-inner { max-width: 1120px; margin: 0 auto; }
.eyebrow, .section-kicker {
  margin: 0 0 9px;
  color: var(--orange, #fbab18);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.god-hero h1 { margin: 0; font-size: clamp(30px, 5vw, 48px); line-height: 1.1; }
.god-hero h1 span { color: var(--orange, #fbab18); }
.hero-copy { max-width: 650px; margin: 15px 0 0; color: rgba(255,255,255,.84); font-size: 15px; }

.god-main { max-width: 1120px; margin: 0 auto; padding: 38px 24px 64px; }
.god-section {
  margin: 0 0 28px;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--god-line);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(15,36,86,.06);
}
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.god-section-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.section-heading h2 { margin: 0; color: var(--navy, #172f5f); font-size: 24px; }
.section-intro { margin: 6px 0 0; color: var(--god-muted); font-size: 14px; }
.inline-state { padding: 24px 0; color: var(--god-muted); font-size: 14px; }
.god-state {
  padding: 65px 24px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--god-line);
  border-radius: 18px;
}
.god-state[hidden], [hidden] { display: none !important; }
.god-state h2, .empty-state h3 { margin: 8px 0; color: var(--navy, #172f5f); }
.god-state p, .empty-state p { margin: 0 auto 20px; max-width: 500px; color: var(--god-muted); font-size: 14px; }
.god-state-icon { font-size: 40px; }
.god-spinner {
  width: 34px; height: 34px; margin: 0 auto 16px;
  border: 3px solid #dbe4f3; border-top-color: var(--orange, #fbab18);
  border-radius: 50%; animation: god-spin .8s linear infinite;
}
@keyframes god-spin { to { transform: rotate(360deg); } }

.god-button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 42px;
  padding: 10px 18px; border: 1px solid transparent; border-radius: 9px;
  font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; text-decoration: none;
  transition: opacity .18s, background .18s, border-color .18s;
}
.god-button:disabled { cursor: not-allowed; opacity: .5; }
.god-button.primary { color: #14223d; background: var(--orange, #fbab18); }
.god-button.primary:hover:not(:disabled) { background: #f6a20a; }
.god-button.secondary { color: var(--navy, #172f5f); background: #fff; border-color: #cfd8e8; }
.god-button.secondary:hover:not(:disabled) { border-color: var(--navy, #172f5f); background: #f3f6fb; }
.god-button.small { min-height: 36px; padding: 7px 12px; font-size: 12px; }

.god-alert { margin: 0 0 18px; padding: 12px 14px; border-radius: 10px; font-size: 14px; }
.god-alert.error { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.god-alert.error { color: #9c2636; background: #fff0f2; border: 1px solid #f0bdc6; }
.god-alert.success { color: #176947; background: #edf9f2; border: 1px solid #b8e2c7; }
.god-alert a { color: inherit; font-weight: 800; }
.god-inline-retry { flex: none; padding: 5px 9px; color: inherit; background: transparent; border: 1px solid currentColor; border-radius: 6px; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }

.wallet-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.wallet-card { min-height: 138px; padding: 20px; border: 1px solid var(--god-line); border-top: 4px solid var(--navy, #172f5f); border-radius: 13px; }
.wallet-card.available { border-top-color: #2455a6; }
.wallet-card.held { border-top-color: #d99409; }
.wallet-card.funding { border-top-color: #637a9d; }
.wallet-label { display: block; color: var(--god-muted); font-size: 13px; font-weight: 700; }
.wallet-value { display: block; margin: 10px 0 4px; color: var(--navy, #172f5f); font-size: 30px; line-height: 1.1; }
.wallet-note { display: block; color: var(--god-muted); font-size: 12px; }
.wallet-lower-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(240px, 1fr); gap: 24px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--god-line); }
.god-other-records { margin-top: 16px; border: 1px solid var(--god-line); border-radius: 12px; }
.god-other-records summary { padding: 11px 14px; color: var(--god-muted); font-size: 13px; font-weight: 800; cursor: pointer; }
.god-other-records .wallet-card { margin: 0 14px 14px; }
.wallet-lower-grid h3 { margin: 0 0 10px; color: var(--navy, #172f5f); font-size: 15px; }
.wallet-disclaimer { margin: 0; color: var(--god-muted); font-size: 13px; line-height: 1.7; }
.transaction-list { display: grid; gap: 8px; }
.transaction-item { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #edf0f5; font-size: 13px; }
.transaction-item:last-child { border-bottom: 0; }
.transaction-label { color: #36455c; }
.transaction-meta { color: var(--god-muted); font-size: 12px; }
.transaction-amount { color: var(--navy, #172f5f); font-weight: 800; white-space: nowrap; }
.empty-transaction { color: var(--god-muted); font-size: 13px; }

.filter-control { display: flex; align-items: center; gap: 9px; color: var(--god-muted); font-size: 13px; font-weight: 700; }
select, input {
  width: 100%; min-height: 44px; padding: 10px 12px;
  color: #1c2b43; background: #fff; border: 1px solid #cfd8e8; border-radius: 8px;
  font: inherit; font-size: 14px;
}
select:focus, input:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(251,171,24,.45); outline-offset: 2px; }
.filter-control select { min-width: 112px; width: auto; }
.offer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 15px; }
.offer-card { display: flex; flex-direction: column; gap: 11px; padding: 18px; border: 1px solid var(--god-line); border-radius: 13px; background: #fff; }
.offer-card.selected { border-color: var(--orange, #fbab18); box-shadow: 0 0 0 2px rgba(251,171,24,.18); }
.offer-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.offer-kind { color: var(--navy, #172f5f); font-size: 12px; font-weight: 800; }
.offer-card h3 { margin: 0; color: var(--navy, #172f5f); font-size: 17px; line-height: 1.35; }
.offer-source { color: var(--god-muted); font-size: 13px; }
.offer-cost { color: var(--navy, #172f5f); font-size: 16px; font-weight: 800; }
.offer-terms { min-height: 58px; margin: 0; padding-top: 10px; border-top: 1px solid #edf0f5; color: #435269; font-size: 13px; white-space: pre-line; }
.offer-capacity { color: var(--god-muted); font-size: 12px; }
.offer-select { align-self: flex-start; }
.offer-select[aria-pressed="true"] { background: var(--navy, #172f5f); color: #fff; border-color: var(--navy, #172f5f); }
.empty-state { padding: 30px 12px; text-align: center; border: 1px dashed #cfd8e8; border-radius: 12px; }
.empty-state h3 { font-size: 17px; }

.reserve-form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.form-field { display: flex; flex-direction: column; gap: 7px; }
.form-field label { color: #263650; font-size: 13px; font-weight: 800; }
.form-field label span { color: #b42f42; }
.form-field.full, .full { grid-column: 1 / -1; }
.field-hint { margin: 0; color: var(--god-muted); font-size: 12px; }
.terms-callout { padding: 16px; background: #fff8e8; border: 1px solid #f0d28b; border-radius: 10px; }
.terms-callout h3 { margin: 0 0 6px; color: #805a08; font-size: 14px; }
.terms-callout p { margin: 0; color: #5e4b1b; font-size: 13px; white-space: pre-line; }
.quote-box { padding: 16px; background: #f3f6fb; border: 1px solid #d9e2f0; border-radius: 10px; }
.quote-box h3 { margin: 0 0 8px; color: var(--navy, #172f5f); font-size: 15px; }
.quote-line { display: flex; justify-content: space-between; gap: 15px; padding: 4px 0; color: #42516a; font-size: 13px; }
.quote-line strong { color: var(--navy, #172f5f); }
.quote-reason { margin: 9px 0 0; color: #9c2636; font-size: 13px; font-weight: 700; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }

.history-list { display: grid; gap: 14px; }
.history-card { min-width: 0; padding: 19px; border: 1px solid var(--god-line); border-radius: 13px; }
.history-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.history-head h3 { margin: 0; color: var(--navy, #172f5f); font-size: 17px; }
.status-badge { display: inline-flex; padding: 4px 9px; border-radius: 999px; color: #40516b; background: #edf1f7; font-size: 12px; font-weight: 800; white-space: nowrap; }
.status-pending { color: #805a08; background: #fff4d5; }
.status-confirmed, .status-attended { color: #176947; background: #e5f7ec; }
.status-rejected, .status-cancelled, .status-expired { color: #9c2636; background: #fff0f2; }
.history-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; color: var(--god-muted); font-size: 13px; }
.history-meta strong { display: block; color: #2e405c; font-size: 12px; }
.history-code { max-width: 100%; margin: 0 0 14px; padding: 10px 12px; color: var(--navy, #172f5f); background: #f3f6fb; border-radius: 8px; font-size: 13px; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.history-code strong { letter-spacing: .08em; overflow-wrap: anywhere; word-break: break-all; }
.history-terms { margin: 0 0 15px; padding: 10px 12px; color: #4c5c73; border-left: 3px solid var(--orange, #fbab18); font-size: 13px; white-space: pre-line; }
.history-actions { display: flex; flex-wrap: wrap; gap: 9px; }

.detail-dialog { width: min(540px, calc(100% - 30px)); padding: 0; border: 0; border-radius: 14px; box-shadow: 0 20px 60px rgba(15,36,86,.25); }
.detail-dialog::backdrop { background: rgba(15,23,42,.5); }
.detail-dialog-inner { padding: 24px; }
.detail-dialog h2 { margin: 0 0 12px; color: var(--navy, #172f5f); font-size: 20px; }
.detail-dialog-body { color: #46556c; font-size: 14px; }
.detail-dialog-close { float: right; border: 0; background: transparent; color: var(--god-muted); font-size: 24px; cursor: pointer; }

.mk-footer { padding: 36px 24px; }

@media (max-width: 720px) {
  .god-hero { padding: 42px 18px 46px; }
  .god-main { padding: 24px 14px 46px; }
  .god-section { padding: 20px 16px; border-radius: 14px; }
  .section-heading { flex-direction: column; }
  .wallet-grid, .wallet-lower-grid, .reserve-form { grid-template-columns: 1fr; }
  .wallet-lower-grid { gap: 20px; }
  .form-field.full, .full { grid-column: auto; }
  .history-meta { grid-template-columns: 1fr 1fr; }
  .form-actions { justify-content: stretch; }
  .form-actions .god-button { flex: 1; }
  .god-alert.error { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}