/* Account history belongs only to the modern presentation. */
body#coop-modern .modern-account-history .header-row { justify-content: flex-start; }
body#coop-modern .modern-account-history .header-title { flex: none; text-align: left; }
.history-intro { margin: 12px 0 18px; max-width: 760px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.history-tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); }
.history-tabs button { border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); padding: 12px 4px; cursor: pointer; font-size: 14px; }
.history-tabs button[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
body#coop-modern .history-content { padding: 24px; flex: none; overflow: visible; }
.history-period-form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.history-period-form label, .history-result-filters label { display: flex; flex-direction: column; gap: 6px; font-size: 11px; color: var(--muted); min-width: 0; }
.history-period-form label:first-child { min-width: 190px; }
.history-period-form input, .history-period-form select, .history-result-filters select { border: 1px solid #d9dbdf; border-radius: 5px; min-height: 42px; padding: 9px 12px; background: #fff; color: var(--ink); font-size: 13px; max-width: 100%; min-width: 0; }
.history-period-form input { width: 165px; }
body#coop-modern .history-load { min-height: 42px; margin-left: auto; padding: 10px 24px; font-size: 13px; border: 1px solid var(--accent); border-radius: 5px; cursor: pointer; }
.history-message { margin: 20px 0; padding: 22px; border-radius: 8px; border: 1px solid var(--line); background: var(--canvas); font-size: 14px; line-height: 1.6; }
.history-message p { margin: 0; }
.history-message button { margin-top: 14px; }
.history-message[data-error="true"] { border-color: #e9c9c3; background: #fff8f5; }
.history-account-line { color: var(--muted); font-size: 12px; margin: 20px 0 12px; }
.history-balances { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.history-balance { border: 1px solid var(--line); border-radius: 8px; padding: 18px; background: #fff; min-width: 0; }
.history-balance small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 8px; }
.history-balance strong { display: block; font-family: 'Manrope', Arial, sans-serif; font-size: clamp(17px, 2vw, 25px); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.6px; overflow-wrap: anywhere; }
.history-balance-in strong { color: #28734a; }
.history-balance-out strong { color: #844938; }
.history-balance-end { background: #f8faf8; border-color: #cfdbd1; }
.history-balance-note { grid-column: 1/-1; margin: 0; color: var(--muted); font-size: 11px; }
.history-results-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 20px 0 14px; }
.history-results-heading h2 { margin: 0; font-family: 'Manrope', Arial, sans-serif; font-size: 19px; font-weight: 600; letter-spacing: -.4px; }
.history-result-filters { display: flex; gap: 12px; min-width: 0; }
.history-result-filters select { min-width: 150px; max-width: 280px; font-size: 12px; }
.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-operation { display: grid; grid-template-columns: 42px 170px minmax(0, 1fr) minmax(110px, auto); align-items: start; gap: 16px; border: 1px solid var(--line); border-radius: 8px; padding: 18px; background: #fff; }
.history-operation-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--canvas); color: var(--muted); font-size: 22px; }
.history-operation-in .history-operation-mark { color: #28734a; background: #eef6ef; }
.history-operation-out .history-operation-mark { color: #844938; background: #faf1ed; }
.history-operation-date time { display: block; font-size: 12px; color: var(--ink); }
.history-operation-date small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.history-operation-description { min-width: 0; }
.history-operation-description h3 { font-size: 13px; line-height: 1.5; font-weight: 600; margin: 0 0 6px; overflow-wrap: anywhere; }
.history-operation-description p { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.history-operation-amount { text-align: right; min-width: 0; }
.history-operation-amount strong { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.history-operation-in .history-operation-amount strong { color: #28734a; }
.history-operation-amount small { display: block; font-size: 10px; color: var(--muted); margin-top: 4px; }
.history-order { border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.history-order summary { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: start; gap: 14px; padding: 19px; cursor: pointer; list-style: none; }
.history-order summary::-webkit-details-marker { display: none; }
.history-order summary::before { content: '›'; font-size: 25px; line-height: 26px; color: var(--muted); transition: transform .15s; }
.history-order[open] summary::before { transform: rotate(90deg); }
.history-order-heading { min-width: 0; }
.history-order-title { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.history-order-title strong { font-family: 'Manrope', Arial, sans-serif; font-size: 16px; font-weight: 600; }
.history-order-heading p { font-size: 12px; color: var(--muted); line-height: 1.6; margin: 6px 0 0; }
.history-order-state { display: inline-block; font-size: 10px; border-radius: 4px; padding: 4px 8px; background: var(--canvas); color: #5a5f65; max-width: 100%; overflow-wrap: anywhere; }
.history-order-state-completed { color: #28734a; background: #eef6ef; }
.history-order-state-pending { color: #825c13; background: #fff6df; }
.history-order-amount { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; min-width: 0; }
.history-order-details { border-top: 1px solid var(--line); padding: 18px 20px; }
.history-order-meta { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 7px 16px; font-size: 12px; margin: 0 0 20px; }
.history-order-meta dt { color: var(--muted); }
.history-order-meta dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; white-space: pre-wrap; }
.history-order-items { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
.history-order-items th { color: var(--muted); font-size: 10px; font-weight: 400; text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.history-order-items th:first-child { width: 52%; }
.history-order-items td { padding: 12px 6px; border-bottom: 1px solid #f0f0f2; overflow-wrap: anywhere; vertical-align: top; }
.history-order-items tr:last-child td { border-bottom: 0; }
.history-order-items td:not(:first-child), .history-order-items th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.history-order-total { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 15px; margin-top: 10px; font-size: 13px; }
.history-empty { text-align: center; padding: 40px 20px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: 13px; }
.history-empty p { margin: 0 0 12px; }
.history-empty button { border: 0; background: none; color: var(--accent); cursor: pointer; text-decoration: underline; }
.history-pages { display: flex; justify-content: center; align-items: center; gap: 20px; margin: 24px 0 8px; font-size: 12px; color: var(--muted); }
.history-pages button { border: 1px solid var(--line); border-radius: 5px; min-height: 40px; padding: 9px 18px; background: #fff; color: var(--ink); cursor: pointer; font-size: 12px; }
.history-pages button:disabled { opacity: .45; cursor: default; }
body#coop-modern .modern-history-profile-button { display: flex; align-items: center; justify-content: flex-start; text-align: left; gap: 8px; }
.modern-history-profile-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; flex-shrink: 0; }
.modern-account-history [hidden] { display: none !important; }
.history-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 900px) {
  .history-results-heading { flex-direction: column; align-items: stretch; }
  .history-result-filters label { flex: 1; }
  .history-result-filters select { width: 100%; max-width: none; min-width: 0; }
  .history-operation { grid-template-columns: 36px 125px minmax(0, 1fr) auto; gap: 10px; padding: 16px; }
  .history-operation-amount strong { font-size: 13px; }
}
@media (max-width: 600px) {
  body#coop-modern .history-content { padding: 16px 12px 88px; }
  body#coop-modern .modern-account-history .app-header { padding-left: 16px; padding-right: 16px; }
  body#coop-modern .modern-account-history .header-title { font-size: 25px; letter-spacing: -.7px; }
  .history-intro { font-size: 12px; margin-bottom: 12px; }
  .history-period-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 13px; gap: 10px; }
  .history-period-form label:first-child { grid-column: 1/-1; min-width: 0; }
  .history-period-form input, .history-period-form select { width: 100%; font-size: 12px; padding: 8px; }
  body#coop-modern .history-load { grid-column: 1/-1; width: 100%; margin: 2px 0 0; }
  .history-balances { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .history-balance { padding: 13px; }
  .history-balance strong { font-size: clamp(15px, 4.2vw, 19px); letter-spacing: -.7px; }
  .history-balance small { font-size: 10px; }
  .history-results-heading h2 { font-size: 17px; }
  .history-result-filters { gap: 8px; flex-wrap: wrap; }
  .history-result-filters label { flex: 1 1 120px; }
  .history-operation { grid-template-columns: 32px minmax(0, 1fr); padding: 14px 12px; gap: 8px 10px; }
  .history-operation-mark { width: 30px; height: 30px; font-size: 19px; grid-column: 1; grid-row: 1; }
  .history-operation-date { grid-column: 2; grid-row: 1; }
  .history-operation-date time { font-size: 11px; }
  .history-operation-description { grid-column: 2/-1; grid-row: 2; }
  .history-operation-description h3 { font-size: 12px; margin-bottom: 4px; }
  .history-operation-description p { font-size: 11px; }
  .history-operation-amount { grid-column: 2; grid-row: 3; }
  .history-operation-amount strong { font-size: 12px; }
  .history-order summary { padding: 15px 12px; gap: 8px; grid-template-columns: 16px minmax(0, 1fr); }
  .history-order-amount { grid-column: 2; text-align: right; }
  .history-order-title strong { font-size: 14px; }
  .history-order-title { gap: 6px; }
  .history-order-heading p { font-size: 11px; }
  .history-order-amount { font-size: 13px; }
  .history-order-details { padding: 16px 12px; }
  .history-order-meta { grid-template-columns: 1fr; gap: 4px; }
  .history-order-meta dd { margin-bottom: 7px; }
  .history-order-items thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .history-order-items tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); padding: 10px 0; gap: 8px; }
  .history-order-items tbody tr:last-child { border-bottom: 0; }
  .history-order-items td { padding: 0; border: 0; min-width: 0; }
  .history-order-items td:first-child { grid-column: 1/-1; margin-bottom: 4px; }
  .history-order-items td:not(:first-child) { text-align: left; font-size: 11px; }
  .history-order-items td:not(:first-child)::before { content: attr(data-label); display: block; color: var(--muted); font-size: 9px; margin-bottom: 3px; }
  .history-pages { gap: 12px; }
  .history-pages button { padding: 9px 14px; }
}
@media (max-width: 360px) {
  body#coop-modern .modern-account-history .header-title { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .history-order summary::before { transition: none; }
}
