/* u7 (1 Nov): Dealplex Partner web — rider v3 tokens (rider_ui_v3_design_system.md §2) adapted for desktop. */
:root {
  --primary: #1A914B; --primary-hover: #157A3F; --primary-soft: #E8F4ED; --primary-tint: rgba(26, 145, 75, .08);
  --heading: #224E34; --deep: #015B26; --neon: #25F47B;
  --text: #111827; --text-2: #4A5565; --text-3: #5F6B7A;
  --stroke: #E3E8EE; --divider: #F0F2F5; --card: #FFFFFF; --bg: #F7FAF8;
  --danger: #B42318; --danger-soft: #FEF3F2; --danger-line: #E33939;
  --warn: #8A5A00; --warn-soft: #FFFBEB; --warn-line: #FEF3C7;
  --info-soft: #EFF6FF; --info-line: #BFDBFE; --info: #1E40AF;
  --r-btn: 12px; --r-card: 16px; --r-sm: 8px;
  --shadow-card: 0 0 2px rgba(23, 26, 31, .2), 0 0 1px rgba(23, 26, 31, .15);
  --font: Inter, "Segoe UI", Roboto, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --focus: 0 0 0 3px #fff, 0 0 0 6px var(--primary);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.rw { margin: 0; font: 400 15px/1.5 var(--font); color: var(--text); background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
body.rw-public { background: linear-gradient(180deg, #C6FFE0 0, #FFFFFF 498px) no-repeat, #fff; }
a { color: var(--deep); text-underline-offset: 2px; }
a:hover { color: var(--primary); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
[hidden] { display: none !important; }
.rw-skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 10; border-radius: 8px; }
.rw-skip:focus { left: 8px; }

/* header */
.rw-header { background: #fff; border-bottom: 1px solid var(--stroke); position: sticky; top: 0; z-index: 5; }
.rw-header-in { max-width: 1280px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; min-height: 60px; }
.rw-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--heading); font-size: 17px; }
.rw-brand strong { color: var(--primary); }
.rw-logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800;
  background: linear-gradient(135deg, #52AF78, #013014); }
.rw-who { margin-left: auto; font-size: 14px; color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rw-signout { flex: none; }

/* frame: sidebar on desktop, scrollable tab row on phones */
.rw-frame { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 1fr; }
.rw-app .rw-frame { grid-template-columns: 1fr; }
.rw-nav { border-bottom: 1px solid var(--stroke); background: #fff; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rw-nav ul { list-style: none; margin: 0; padding: 0 8px; display: flex; gap: 4px; }
.rw-nav a { display: flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 12px; white-space: nowrap; text-decoration: none;
  color: #4A5568; font-weight: 500; border-bottom: 3px solid transparent; }
.rw-nav a[aria-current="page"] { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.rw-badge { background: var(--danger-line); color: #fff; border-radius: 999px; font-size: 12px; font-weight: 700; padding: 1px 7px; min-width: 20px; text-align: center; }
.rw-main { padding: 16px; min-width: 0; outline: none; }
.rw-public .rw-main { max-width: 760px; width: 100%; margin: 0 auto; padding-top: 24px; }
@media (min-width: 900px) {
  .rw-app .rw-frame { grid-template-columns: 240px minmax(0, 1fr); gap: 0; }
  .rw-nav { border-bottom: 0; border-right: 1px solid var(--stroke); background: transparent; overflow: visible; }
  .rw-nav ul { flex-direction: column; padding: 16px 12px; position: sticky; top: 61px; }
  .rw-nav a { border-bottom: 0; border-radius: 14px; padding: 0 14px; }
  .rw-nav a[aria-current="page"] { background: #EFF6FF; }
  .rw-nav a:hover { background: var(--primary-tint); }
  .rw-main { padding: 24px 32px 40px; max-width: 1040px; }
}

/* type */
.rw-title { font-size: 22px; line-height: 30px; font-weight: 700; color: var(--heading); margin: 8px 0 16px; }
.rw-h2 { font-size: 17px; line-height: 24px; font-weight: 600; color: var(--heading); margin: 0 0 8px; padding: 0; }
.rw-h3 { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.rw-muted, .rw-hint { color: var(--text-2); font-size: 14px; margin: 4px 0 12px; }
.rw-hint { margin: 4px 0 0; }
.rw-lead { font-size: 16px; color: var(--text-2); margin: 0 0 16px; }
.rw-opt { font-weight: 400; color: var(--text-3); }
.rw-sep { margin: 20px 0 0; text-align: center; color: var(--text-2); }
.rw-loading { color: var(--text-2); }
.rw-footer { text-align: center; color: var(--text-3); font-size: 13px; padding: 16px; border-top: 1px solid var(--stroke); background: #fff; }
.rw-footer p { margin: 0; }

/* cards & layout */
.rw-card { background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow-card); padding: 16px; margin: 0 0 16px; }
.rw-narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
.rw-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .rw-grid-2 { grid-template-columns: 1fr 1fr; } .rw-grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 640px) and (max-width: 1099px) { .rw-grid-3 { grid-template-columns: 1fr 1fr; } }
.rw-grid > .rw-card { margin: 0; }
.rw-stat { font-size: 24px; line-height: 32px; font-weight: 700; color: var(--deep); }
.rw-stat-label { font-size: 13px; color: var(--text-2); text-transform: uppercase; letter-spacing: .3px; font-weight: 500; }
.rw-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.rw-spread { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.rw-app-note { background: var(--primary-soft); border: 1px solid #CFE8D9; color: var(--heading); border-radius: 12px; padding: 10px 14px; font-size: 14px; margin: 0 0 8px; }
.rw-list { list-style: none; margin: 0; padding: 0; }
.rw-list > li { border-top: 1px solid var(--divider); padding: 12px 0; }
.rw-list > li:first-child { border-top: 0; }
.rw-dl { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 6px 12px; margin: 0; }
.rw-dl dt { color: var(--text-2); font-size: 14px; }
.rw-dl dd { margin: 0; overflow-wrap: anywhere; }
.rw-table-wrap { overflow-x: auto; }
.rw-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rw-table th, .rw-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--divider); }
.rw-table th { color: var(--text-2); font-weight: 600; font-size: 13px; }
.rw-num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* pills & notices */
.rw-pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; background: var(--divider); color: var(--text-2); }
.rw-pill-ok { background: var(--primary-soft); color: var(--deep); }
.rw-pill-warn { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-line); }
.rw-pill-bad { background: var(--danger-soft); color: var(--danger); }
.rw-pill-info { background: var(--info-soft); color: var(--info); }
.rw-notice { border-radius: 12px; padding: 12px 14px; margin: 0 0 16px; border: 1px solid var(--stroke); background: #fff; font-size: 14px; }
.rw-notice-info { background: var(--info-soft); border-color: var(--info-line); color: #1E3A8A; }
.rw-notice-warn { background: var(--warn-soft); border-color: var(--warn-line); color: #6B4500; }
.rw-notice-bad { background: var(--danger-soft); border-color: #FECDCA; color: var(--danger); }
.rw-notice-ok { background: var(--primary-soft); border-color: #CFE8D9; color: var(--heading); }
.rw-notice p { margin: 4px 0 0; }
.rw-flash:empty { display: none; }
.rw-flash { margin: 0 0 16px; }
.rw-state { text-align: center; padding: 28px 16px; }
.rw-state h2 { margin-bottom: 6px; }

/* forms */
.rw-form { display: block; }
.rw-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.rw-field { margin: 0 0 14px; }
.rw-field label, .rw-group legend { display: block; font-weight: 600; font-size: 14px; margin: 0 0 6px; color: var(--text); }
.rw-group { border: 0; padding: 0; margin: 0 0 14px; }
input, select, textarea { font: inherit; font-size: 16px; color: var(--text); }
.rw-field input:not([type=checkbox]):not([type=radio]):not([type=file]), .rw-field select, .rw-field textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #C9D1DA; border-radius: var(--r-btn); background: #fff; }
.rw-field textarea { min-height: 110px; resize: vertical; }
.rw-field input:focus-visible, .rw-field select:focus-visible, .rw-field textarea:focus-visible { border-color: var(--primary); }
.rw-field input[aria-invalid="true"], .rw-field select[aria-invalid="true"], .rw-field textarea[aria-invalid="true"] { border-color: var(--danger-line); }
.rw-prefix { display: flex; align-items: stretch; }
.rw-prefix span { display: grid; place-items: center; padding: 0 12px; border: 1px solid #C9D1DA; border-right: 0; border-radius: var(--r-btn) 0 0 var(--r-btn); background: var(--divider); color: var(--text-2); }
.rw-prefix input { border-radius: 0 var(--r-btn) var(--r-btn) 0 !important; }
.rw-code { letter-spacing: 8px; font-size: 22px !important; font-weight: 600; max-width: 240px; }
.rw-err { color: var(--danger); font-size: 13px; margin: 4px 0 0; }
.rw-err:empty { display: none; }
.rw-choices { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.rw-choice { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border: 1px solid var(--stroke); border-radius: var(--r-btn); background: #fff; cursor: pointer; font-weight: 500; }
.rw-choice:has(input:checked) { border-color: var(--primary); background: var(--primary-tint); }
.rw-choice input { width: 20px; height: 20px; accent-color: var(--primary); flex: none; }
.rw-file input[type=file] { width: 100%; min-height: 48px; padding: 10px; border: 1px dashed #AEB8C4; border-radius: var(--r-btn); background: #fff; font-size: 14px; }
.rw-doclist { display: grid; gap: 12px; }
.rw-doc { border: 1px solid var(--stroke); border-radius: var(--r-card); padding: 12px; background: #fff; }
.rw-doc-grid { display: grid; gap: 0 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .rw-doc-grid { grid-template-columns: 1fr 1fr; } .rw-doc-grid .rw-wide { grid-column: 1 / -1; } }
.rw-details { margin-top: 16px; border-top: 1px solid var(--divider); padding-top: 12px; }
.rw-details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--deep); font-weight: 600; }
.rw-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.rw-actions .rw-btn { min-width: 140px; }

/* buttons */
.rw-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: var(--r-btn);
  font: 600 15px/1 var(--font); border: 1px solid transparent; cursor: pointer; text-decoration: none; }
.rw-btn-primary { background: var(--primary); color: #fff; }
.rw-btn-primary:hover { background: var(--primary-hover); color: #fff; }
.rw-btn-secondary { background: #fff; color: var(--primary); border-color: var(--primary); }
.rw-btn-secondary:hover { background: var(--primary-tint); }
.rw-btn-ghost { background: transparent; color: var(--text-2); border-color: var(--stroke); min-height: 40px; }
.rw-btn-danger { background: #fff; color: var(--danger); border-color: #F3B4AE; }
.rw-btn-link { background: none; border: 0; color: var(--deep); text-decoration: underline; padding: 0 4px; min-height: 44px; }
.rw-btn-sm { min-height: 40px; padding: 0 12px; font-size: 14px; }
.rw-btn[disabled], .rw-btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.rw-form > .rw-btn-primary, .rw-form > .rw-btn-secondary { width: 100%; }
@media (min-width: 640px) { .rw-form > .rw-btn-primary, .rw-form > .rw-btn-secondary { width: auto; min-width: 200px; } }

/* steps */
.rw-steps { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; counter-reset: s; }
.rw-steps li { counter-increment: s; font-size: 13px; color: var(--text-2); padding-top: 8px; border-top: 4px solid var(--stroke); }
.rw-steps li::before { content: counter(s) ". "; font-weight: 700; }
.rw-steps li[aria-current="step"] { color: var(--primary); border-top-color: var(--primary); font-weight: 600; }
.rw-steps li.done { border-top-color: #8BCBA5; }
@media (max-width: 420px) { .rw-steps li { font-size: 12px; } }

/* progress */
.rw-progress { margin: 12px 0; }
.rw-progress-bar { height: 8px; border-radius: 8px; background: var(--stroke); overflow: hidden; position: relative; }
.rw-progress-bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p, 0%); background: #06B217; transition: width .2s; }
.rw-progress-txt { display: block; font-size: 13px; color: var(--text-2); margin-top: 4px; }

/* threads */
.rw-thread { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.rw-msg { max-width: 85%; padding: 10px 12px; border-radius: 14px; background: var(--divider); }
.rw-msg-you { margin-left: auto; background: var(--primary-soft); }
.rw-msg-meta { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.rw-msg-status { max-width: 100%; text-align: center; background: none; color: var(--text-3); font-size: 13px; }
.rw-unread { font-weight: 600; }
.rw-unread::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-right: 8px; vertical-align: middle; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.rw-mt { margin-top: 16px !important; } .rw-mt12 { margin-top: 12px !important; } .rw-mb { margin-bottom: 16px !important; } .rw-mb12 { margin-bottom: 12px !important; }
.rw-m0 { margin: 0 !important; } .rw-my4 { margin: 4px 0 !important; } .rw-self-end { align-self: flex-end; } .rw-block { display: block; } .rw-upper { text-transform: uppercase; }
.rw-brand { white-space: nowrap; }
@media (max-width: 479px) { .rw-who { display: none; } .rw-signout { margin-left: auto; } }
