.pec {
    --pec-blue: #21334d;
    --pec-accent: #147bc1;
    --pec-border: #d9dee5;
    --pec-muted: #687383;
    --pec-row: #f6f7f9;
    position: relative;
    margin: 0 0 34px;
    border: 1px solid var(--pec-border);
    background: #fff;
    color: #172033;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

.pec button { font: inherit; }
.pec [hidden] { display: none !important; }

.pec__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 64px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--pec-border);
}

.pec__period,
.pec__actions,
.pec__currency-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pec__period-btn,
.pec__small-button,
.pec__reset-button {
    border: 1px solid #cbd2db;
    border-radius: 4px;
    background: #fff;
    color: #334155;
    cursor: pointer;
}

.pec__period-btn {
    min-height: 38px;
    padding: 7px 14px;
}

.pec__period-btn:hover,
.pec__small-button:hover,
.pec__reset-button:hover { border-color: var(--pec-accent); color: var(--pec-accent); }
.pec__period-btn.is-active { border-color: var(--pec-blue); background: var(--pec-blue); color: #fff; }

.pec__timezone-picker { position: relative; }
.pec__timezone-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 7px 10px;
    border: 0;
    background: transparent;
    color: var(--pec-muted);
    white-space: nowrap;
    cursor: pointer;
}
.pec__timezone-button:hover { color: var(--pec-accent); }
.pec__timezone-panel {
    position: absolute;
    z-index: 60;
    top: calc(100% + 10px);
    right: 0;
    width: 310px;
    max-height: 430px;
    overflow-y: auto;
    padding: 7px 0;
    border: 1px solid var(--pec-border);
    border-radius: 5px;
    background: #fff;
    box-shadow: 0 14px 40px rgba(18, 35, 58, .2);
}
.pec__timezone-option {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 10px 18px;
    border: 0;
    background: transparent;
    color: #172033;
    text-align: left;
    cursor: pointer;
}
.pec__timezone-option span { margin-top: 3px; color: #8a94a3; }
.pec__timezone-option:hover,
.pec__timezone-option.is-active { background: #f0f2f5; }

.pec__filter-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-width: 132px;
    min-height: 46px;
    padding: 10px 16px;
    border: 0;
    border-radius: 5px;
    background: var(--pec-accent);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(20, 123, 193, .24);
}

.pec__filter-button:hover { background: #0e6dac; }
.pec__filter-button:focus-visible,
.pec button:focus-visible { outline: 3px solid rgba(20, 123, 193, .3); outline-offset: 2px; }

.pec__filter-count {
    min-width: 20px;
    padding: 1px 5px;
    border-radius: 10px;
    background: #fff;
    color: var(--pec-accent);
    font-size: 12px;
}

.pec__filter-panel {
    position: absolute;
    z-index: 50;
    top: 62px;
    right: 12px;
    width: min(520px, calc(100% - 24px));
    padding: 18px;
    border: 1px solid var(--pec-border);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 14px 40px rgba(18, 35, 58, .2);
}

.pec__filter-head,
.pec__filter-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pec__filter-title { font-size: 18px; }
.pec__filter-close { border: 0; background: transparent; color: #596579; font-size: 30px; line-height: 1; cursor: pointer; }
.pec__fieldset { margin: 16px 0 0; padding: 0; border: 0; }
.pec__fieldset legend { margin-bottom: 9px; color: #26364c; font-weight: 700; }
.pec__importance-options { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.pec__currency-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px 12px; margin-top: 12px; }
.pec__choice { display: inline-flex; align-items: center; gap: 7px; min-height: 28px; cursor: pointer; }
.pec__choice input { width: 17px; height: 17px; margin: 0; accent-color: var(--pec-accent); }
.pec__impact-dot { width: 10px; height: 10px; border-radius: 50%; background: #cbd0d6; }
.pec__impact-dot--low { background: #e8c226; }
.pec__impact-dot--medium { background: #ee8e24; }
.pec__impact-dot--high { background: #db3e42; }
.pec__small-button { padding: 5px 10px; font-size: 12px; }
.pec__filter-footer { margin-top: 20px; padding-top: 14px; border-top: 1px solid #e6e9ed; }
.pec__reset-button,
.pec__apply-button { min-height: 39px; padding: 8px 18px; }
.pec__apply-button { border: 1px solid var(--pec-accent); border-radius: 4px; background: var(--pec-accent); color: #fff; cursor: pointer; }

.pec__status { min-height: 0; padding: 0 14px; color: var(--pec-muted); }
.pec__status:not(:empty) { padding-top: 12px; padding-bottom: 12px; }
.pec__status--error { background: #fff2f2; color: #9c2525; }
.pec__status--stale { background: #fff9e8; color: #795b08; }
.pec__table-wrap { max-height: var(--pec-table-height, 650px); overflow: auto; }
.pec__table { width: 100%; margin: 0; border: 0; border-collapse: collapse; table-layout: fixed; }
.pec__table th { position: sticky; z-index: 3; top: 0; padding: 11px 10px; border: 0; border-bottom: 1px solid var(--pec-border); background: #fff; color: #455166; text-align: left; font-weight: 700; }
.pec__table td { padding: 11px 10px; border: 0; border-bottom: 1px solid #e7eaee; vertical-align: middle; }
.pec__table tbody tr:nth-child(even):not(.pec__day-row) { background: var(--pec-row); }
.pec__event-row { cursor: pointer; }
.pec__event-row:hover td { background: #eaf3fa; }
.pec__event-row:focus { outline: 2px solid var(--pec-accent); outline-offset: -2px; }
.pec__day-row td { padding: 9px 12px; background: #e9edf2; color: #27384f; font-weight: 700; }
.pec__col-time { width: 82px; }
.pec__col-currency { width: 100px; }
.pec__col-value { width: 120px; text-align: right !important; }
.pec__time { color: #4d5a6b; font-variant-numeric: tabular-nums; }
.pec__currency-cell { font-weight: 700; white-space: nowrap; }
.pec__flag { display: inline-block; width: 24px; height: 16px; border: 1px solid rgba(15, 23, 42, .16); border-radius: 2px; object-fit: cover; vertical-align: middle; }
.pec__currency-code { margin-left: 7px; vertical-align: middle; }
.pec__choice .pec__flag { width: 21px; height: 14px; }
.pec__sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.pec__event { display: flex; align-items: flex-start; gap: 9px; line-height: 1.35; }
.pec__event .pec__impact-dot { flex: 0 0 auto; margin-top: 4px; }
.pec__value { text-align: right; font-variant-numeric: tabular-nums; }
.pec__value--positive { color: #16814b; font-weight: 700; }
.pec__value--negative { color: #c23438; font-weight: 700; }
.pec__empty { padding: 42px 16px; color: var(--pec-muted); text-align: center; }
.pec__footer { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; color: #7b8492; font-size: 12px; }
.pec__footer a { color: #64748b; }

.pec__detail { min-height: 420px; background: #fff; }
.pec__detail-back {
    width: 100%;
    padding: 14px 18px;
    border: 0;
    border-bottom: 1px solid var(--pec-border);
    background: #fff;
    color: #337ab7;
    text-align: left;
    font-weight: 700;
    cursor: pointer;
}
.pec__detail-status { padding: 22px 18px; color: var(--pec-muted); }
.pec__detail-content { padding: 14px 20px 28px; }
.pec__detail-content h2 { margin: 0 0 10px; color: #111827; font-size: 22px; line-height: 1.3; }
.pec__detail-country { display: flex; align-items: center; gap: 9px; margin-bottom: 20px; font-weight: 700; }
.pec__detail-metadata { border-top: 1px solid #e5e7eb; }
.pec__detail-line { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid #e5e7eb; }
.pec__detail-metrics { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 20px; margin: 26px 0 0; padding: 20px 0 22px; border-bottom: 1px solid #e5e7eb; }
.pec__detail-metric { display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; }
.pec__detail-metric strong { color: #111827; font-size: 25px; font-weight: 500; }
.pec__detail-metric span { color: #7b8492; }
.pec__detail-metric--positive strong { color: #16814b; }
.pec__detail-metric--negative strong { color: #c23438; }
.pec__detail-description { margin: 0; padding-top: 28px; color: #182033; font-size: 16px; line-height: 1.6; }

@media (max-width: 900px) {
    .pec__toolbar { align-items: stretch; flex-direction: column; }
    .pec__actions { justify-content: space-between; }
    .pec__timezone-panel { right: auto; left: 0; }
    .pec__table-wrap { overflow: auto; }
    .pec__table { min-width: 760px; }
    .pec__currency-options { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 560px) {
    .pec { margin-left: -10px; margin-right: -10px; }
    .pec__period { display: grid; grid-template-columns: repeat(3, 1fr); }
    .pec__period-btn { padding: 7px 6px; }
    .pec__timezone { font-size: 12px; }
    .pec__filter-button { min-width: 118px; }
    .pec__filter-panel { position: fixed; inset: 10px; width: auto; max-height: calc(100vh - 20px); overflow: auto; }
    .pec__currency-options { grid-template-columns: repeat(2, 1fr); }
    .pec__currency-actions { flex-wrap: wrap; }
    .pec__footer { flex-direction: column; }
    .pec__detail-content { padding-left: 14px; padding-right: 14px; }
    .pec__detail-line { grid-template-columns: 105px 1fr; }
    .pec__detail-metrics { grid-template-columns: repeat(2, 1fr); }
    .pec__detail-metric strong { font-size: 20px; }
}

/* Dark gold theme based on the Pelliron transaction table palette. */
.pec {
    --pec-accent: #c79a42;
    --pec-border: #292e30;
    --pec-muted: #969b9d;
    --pec-row: #0d1113;
    border-color: var(--pec-border);
    border-radius: 18px;
    background: #080c0e;
    color: #d7d9da;
    box-shadow: 0 22px 60px rgba(0, 0, 0, .34);
}

.pec__toolbar {
    min-height: 78px;
    padding: 14px 18px;
    border-color: var(--pec-border);
    border-radius: 18px 18px 0 0;
    background: #0a0e10;
}

.pec__period-btn,
.pec__small-button,
.pec__reset-button {
    border-color: #292e30;
    background: #0d1113;
    color: #969b9d;
}

.pec__period-btn { min-height: 42px; padding: 8px 17px; border-radius: 7px; }
.pec__period-btn:hover,
.pec__small-button:hover,
.pec__reset-button:hover { border-color: #c79a42; color: #c79a42; }
.pec__period-btn.is-active { border-color: #c79a42; background: #c79a42; color: #080c0e; }

.pec__timezone-button { color: #969b9d; }
.pec__timezone-button:hover { color: #c79a42; }
.pec__timezone-panel,
.pec__filter-panel {
    border-color: #292e30;
    background: #0a0e10;
    box-shadow: 0 18px 46px rgba(0, 0, 0, .55);
}
.pec__timezone-option { color: #d7d9da; }
.pec__timezone-option span { color: #969b9d; }
.pec__timezone-option:hover,
.pec__timezone-option.is-active { background: #14191b; }
.pec__timezone-option.is-active strong { color: #c79a42; }

.pec__filter-button {
    border: 1px solid #c79a42;
    border-radius: 7px;
    background: #c79a42;
    color: #080c0e;
    box-shadow: none;
}
.pec__filter-button:hover { background: #d7d9da; border-color: #d7d9da; }
.pec__filter-button:focus-visible,
.pec button:focus-visible { outline-color: #c79a42; }
.pec__filter-count { background: #080c0e; color: #c79a42; }
.pec__filter-title,
.pec__fieldset legend { color: #d7d9da; }
.pec__filter-close { color: #969b9d; }
.pec__filter-close:hover { color: #c79a42; }
.pec__choice input { accent-color: #c79a42; }
.pec__impact-dot { background: #747a7c; }
.pec__impact-dot--low { background: #c79a42; }
.pec__impact-dot--medium { background: #a9782e; }
.pec__impact-dot--high { background: #cf7469; }
.pec__filter-footer { border-color: #292e30; }
.pec__apply-button { border-color: #c79a42; background: #c79a42; color: #080c0e; }
.pec__apply-button:hover { border-color: #d7d9da; background: #d7d9da; }

.pec__status--error { background: #1b1111; color: #cf7469; }
.pec__status--stale { background: #18140c; color: #c79a42; }
.pec__table-wrap { background: #080c0e; scrollbar-color: #969b9d #14191b; }
.pec__table th {
    padding-top: 15px;
    padding-bottom: 15px;
    border-color: #747a7c;
    background: #080c0e;
    color: #c79a42;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.pec__table td { padding-top: 14px; padding-bottom: 14px; border-color: #1b2022; }
.pec__table tbody tr { background: #080c0e; }
.pec__table tbody tr:nth-child(even):not(.pec__day-row) { background: #0d1113; }
.pec__event-row:hover td { background: #151a1c; }
.pec__event-row:focus { outline-color: #c79a42; }
.pec__day-row td {
    border-color: #292e30;
    background: #14191b;
    color: #d7d9da;
    font-size: 13px;
    letter-spacing: .025em;
}
.pec__time { color: #969b9d; }
.pec__currency-cell { color: #d7d9da; }
.pec__flag { border-color: #747a7c; }
.pec__value--positive { color: #c79a42; }
.pec__value--negative { color: #cf7469; }
.pec__empty { color: #969b9d; }
.pec__footer { border-top: 1px solid #1b2022; color: #747a7c; }
.pec__footer a { color: #c79a42; }

.pec__detail { border-radius: 18px; background: #080c0e; }
.pec__detail-back { border-color: #292e30; background: #0a0e10; color: #c79a42; }
.pec__detail-back:hover { background: #14191b; }
.pec__detail-content h2 { color: #d7d9da; }
.pec__detail-country { color: #969b9d; }
.pec__detail-metadata,
.pec__detail-line,
.pec__detail-metrics { border-color: #292e30; }
.pec__detail-line strong { color: #c79a42; }
.pec__detail-metric strong { color: #d7d9da; }
.pec__detail-metric span { color: #969b9d; }
.pec__detail-metric--positive strong { color: #c79a42; }
.pec__detail-metric--negative strong { color: #cf7469; }
.pec__detail-description { color: #d7d9da; }

/* Industrial glass theme inspired by the dark metal reference. */
.pec {
    --pec-accent: #d6aa72;
    --pec-border: #343a3f;
    --pec-muted: #98999c;
    --pec-row: #0d1217;
    border: 1px solid #343a3f;
    border-radius: 16px;
    background:
        radial-gradient(circle at 88% 0%, rgba(214, 170, 114, .07), transparent 25%),
        linear-gradient(145deg, #11161c 0%, #090d12 44%, #05080c 100%);
    color: #ececea;
    font-family: "Segoe UI", Arial, sans-serif;
    box-shadow: 0 28px 80px rgba(0, 0, 0, .48), inset 0 1px 0 rgba(236, 236, 234, .025);
}

.pec__toolbar {
    min-height: 82px;
    padding: 16px 20px;
    border-bottom: 1px solid #343a3f;
    border-radius: 16px 16px 0 0;
    background: rgba(7, 10, 14, .48);
}
.pec__period { gap: 10px; }
.pec__period-btn,
.pec__small-button,
.pec__reset-button {
    border: 1px solid #343a3f;
    border-radius: 9px;
    background: linear-gradient(145deg, rgba(21, 27, 33, .88), rgba(8, 12, 16, .88));
    color: #98999c;
    box-shadow: inset 0 1px 0 rgba(236, 236, 234, .025);
}
.pec__period-btn { min-height: 44px; padding: 9px 18px; }
.pec__period-btn:hover,
.pec__small-button:hover,
.pec__reset-button:hover { border-color: #8d694d; color: #d6aa72; }
.pec__period-btn.is-active {
    border-color: #d6aa72;
    background: linear-gradient(135deg, #e0b77e, #b09451);
    color: #090d12;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(236, 236, 234, .28);
}

.pec__timezone-button { color: #98999c; }
.pec__timezone-button:hover { color: #d6aa72; }
.pec__timezone-panel,
.pec__filter-panel {
    border: 1px solid #343a3f;
    border-radius: 12px;
    background:
        radial-gradient(circle at 100% 0%, rgba(214, 170, 114, .07), transparent 34%),
        linear-gradient(145deg, #12171d, #070a0e);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .62), inset 0 1px 0 rgba(236, 236, 234, .035);
}
.pec__timezone-option { color: #ececea; }
.pec__timezone-option span { color: #98999c; }
.pec__timezone-option:hover { background: rgba(214, 170, 114, .07); }
.pec__timezone-option.is-active { background: rgba(214, 170, 114, .11); }
.pec__timezone-option.is-active strong { color: #d6aa72; }

.pec__filter-button {
    min-height: 48px;
    border: 1px solid #d6aa72;
    border-radius: 9px;
    background: linear-gradient(135deg, #e0b77e, #967a48);
    color: #090d12;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(236, 236, 234, .3);
}
.pec__filter-button:hover {
    border-color: #e8c696;
    background: linear-gradient(135deg, #e8c696, #927747);
}
.pec__filter-count { background: #090d12; color: #d6aa72; }
.pec__filter-title { color: #ececea; font-weight: 600; }
.pec__fieldset legend { color: #d6aa72; }
.pec__filter-close { color: #98999c; }
.pec__filter-close:hover { color: #ececea; }
.pec__choice input { accent-color: #d6aa72; }
.pec__impact-dot { background: #777a7d; box-shadow: 0 0 0 2px rgba(119, 122, 125, .1); }
.pec__impact-dot--low { background: #d6aa72; box-shadow: 0 0 0 2px rgba(214, 170, 114, .12); }
.pec__impact-dot--medium { background: #bd8758; box-shadow: 0 0 0 2px rgba(189, 135, 88, .12); }
.pec__impact-dot--high { background: #c67868; box-shadow: 0 0 0 2px rgba(198, 120, 104, .12); }
.pec__filter-footer { border-color: #343a3f; }
.pec__apply-button {
    border-color: #d6aa72;
    border-radius: 9px;
    background: linear-gradient(135deg, #e0b77e, #bd8758);
    color: #090d12;
}
.pec__apply-button:hover { border-color: #e8c696; background: #e8c696; }

.pec__status--error { background: rgba(198, 120, 104, .1); color: #c67868; }
.pec__status--stale { background: rgba(214, 170, 114, .08); color: #d6aa72; }
.pec__table-wrap { background: transparent; scrollbar-color: #777a7d #11161c; }
.pec__table th {
    padding: 16px 12px;
    border-bottom: 1px solid #777a7d;
    background: rgba(6, 9, 12, .96);
    color: #d6aa72;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .1em;
}
.pec__table td { padding: 15px 12px; border-bottom: 1px solid #20262b; }
.pec__table tbody tr { background: rgba(6, 9, 12, .34); }
.pec__table tbody tr:nth-child(even):not(.pec__day-row) { background: rgba(17, 22, 28, .46); }
.pec__event-row:hover td { background: rgba(214, 170, 114, .075); }
.pec__event-row:focus { outline-color: #d6aa72; }
.pec__day-row td {
    border-color: #343a3f;
    background: linear-gradient(90deg, rgba(39, 46, 52, .85), rgba(18, 23, 29, .75));
    color: #ececea;
    font-weight: 600;
}
.pec__time { color: #98999c; }
.pec__currency-cell { color: #ececea; }
.pec__flag { border-color: #777a7d; border-radius: 3px; box-shadow: 0 3px 10px rgba(0, 0, 0, .34); }
.pec__event { color: #d5d5d3; }
.pec__value { color: #c6c7c6; }
.pec__value--positive { color: #d6aa72; }
.pec__value--negative { color: #c67868; }
.pec__empty { color: #98999c; }
.pec__footer { border-color: #20262b; color: #777a7d; }
.pec__footer a { color: #d6aa72; }

.pec__detail {
    border-radius: 16px;
    background:
        radial-gradient(circle at 90% 0%, rgba(214, 170, 114, .07), transparent 25%),
        linear-gradient(145deg, #11161c, #05080c);
}
.pec__detail-back { border-color: #343a3f; background: rgba(7, 10, 14, .52); color: #d6aa72; }
.pec__detail-back:hover { background: rgba(214, 170, 114, .07); }
.pec__detail-content h2 { color: #ececea; font-weight: 600; }
.pec__detail-country { color: #98999c; }
.pec__detail-metadata,
.pec__detail-line,
.pec__detail-metrics { border-color: #343a3f; }
.pec__detail-line strong { color: #d6aa72; }
.pec__detail-metric strong { color: #ececea; }
.pec__detail-metric span { color: #98999c; }
.pec__detail-metric--positive strong { color: #d6aa72; }
.pec__detail-metric--negative strong { color: #c67868; }
.pec__detail-description { color: #d5d5d3; }
