:root {
  --pev-ink: #142033;
  --pev-muted: #657188;
  --pev-line: #dfe6f0;
  --pev-soft: #f4f7fb;
  --pev-blue: #2457e6;
  --pev-blue-dark: #173aa9;
  --pev-violet: #6847dc;
  --pev-green: #087c62;
  --pev-red: #c83d4d;
  --pev-radius: 18px;
  --pev-shadow: 0 16px 45px rgb(32 58 105 / 10%);
}
.pev-visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; }

* { box-sizing: border-box; }
html { background: #eef3f9; }
body.ptools-expected-page {
  margin: 0;
  background:
    radial-gradient(circle at 12% -5%, rgb(125 157 255 / 20%), transparent 28rem),
    #f7f9fc;
  color: var(--pev-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.pev-shell-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgb(208 219 234 / 90%);
  background: rgb(255 255 255 / 92%);
  padding: 8px max(16px, env(safe-area-inset-left));
  backdrop-filter: blur(16px);
}
body.admin-bar .pev-shell-header { top: 46px; }
.pev-shell-header a { color: #31405b; font-weight: 750; text-decoration: none; }
.pev-shell-header > div { display: flex; gap: 8px; }
.pev-shell-header > div a { min-height: 44px; border-radius: 10px; padding: 10px 12px; }
.pev-brand { display: inline-flex; min-height: 44px; align-items: center; color: var(--pev-blue) !important; font-size: 20px; font-weight: 900 !important; letter-spacing: -.04em; }
.pev-header-link { min-height: 44px; border: 0; border-radius: 10px; background: transparent; padding: 10px 12px; color: #31405b; font-weight: 750; }
.pev-account-name { display: inline-flex; align-items: center; color: var(--pev-muted); font-size: 13px; font-weight: 700; }

.pev-personal-home { display: grid; gap: 16px; }
.pev-personal-welcome, .pev-home-section, .pev-store-tools { border: 1px solid var(--pev-line); border-radius: var(--pev-radius); background: #fff; box-shadow: var(--pev-shadow); }
.pev-personal-welcome { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px; }
.pev-personal-welcome h1 { margin: 0; font-size: clamp(26px, 5vw, 38px); letter-spacing: -.04em; }
.pev-personal-welcome p:not(.pev-eyebrow), .pev-home-section .pev-section-head p, .pev-store-tools p { margin: 6px 0 0; color: var(--pev-muted); }
.pev-home-section { padding: 17px; }
.pev-home-section .pev-section-head { margin-bottom: 10px; }
.pev-home-section h2, .pev-store-tools h2 { margin: 0; font-size: 18px; }
.pev-home-list { display: grid; gap: 8px; }
.pev-personal-session { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; overflow: hidden; border: 1px solid var(--pev-line); border-radius: 12px; background: var(--pev-soft); }
.pev-personal-session-open { display: grid; min-height: 62px; gap: 2px; border: 0; background: transparent; padding: 10px 12px; text-align: left; }
.pev-personal-session-open strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pev-personal-session-open span, .pev-personal-session-open small { color: var(--pev-muted); }
.pev-personal-session-delete { min-width: 82px; border: 0; border-left: 1px solid var(--pev-line); background: #fff; color: var(--pev-red); font-size: 12px; font-weight: 800; }
.pev-history-search { border: 1px solid var(--pev-line); border-radius: var(--pev-radius); background: #fff; padding: 16px; }
.pev-history-search > div:first-child { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.pev-history-search label { display: grid; gap: 5px; color: var(--pev-muted); font-size: 12px; font-weight: 750; }
.pev-history-search input, .pev-history-search select { width: 100%; min-height: 44px; border: 1px solid var(--pev-line); border-radius: 9px; background: #fff; padding: 8px; }
.pev-history-search > button, .pev-store-tools > button { min-height: 44px; margin: 10px 7px 0 0; border: 0; border-radius: 10px; background: var(--pev-blue); padding: 9px 14px; color: #fff; font-weight: 800; }
.pev-store-tools { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px; }
.pev-personal-stores { display: grid; width: 100%; flex: 1 0 100%; gap: 7px; }
.pev-store-tools:has(.pev-personal-stores) { flex-wrap: wrap; }
.pev-personal-store { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border-top: 1px solid var(--pev-line); padding-top: 9px; }
.pev-personal-store span { display: block; color: var(--pev-muted); font-size: 12px; }
.pev-personal-store button { min-height: 44px; border: 1px solid var(--pev-line); border-radius: 9px; background: #fff; padding: 8px 12px; font-weight: 750; }
.pev-guide-steps { display: grid; gap: 10px; margin: 5px 0 0; padding: 0; list-style: none; }
.pev-guide-steps li { display: grid; grid-template-columns: 88px 1fr; min-height: 48px; align-items: center; border-radius: 11px; background: var(--pev-soft); padding: 8px 11px; }
.pev-guide-steps span { color: var(--pev-muted); font-size: 13px; line-height: 1.5; }

.pev-main {
  width: min(100% - 28px, 940px);
  margin: 0 auto;
  padding: 26px 0 30px;
}
.pev-main.is-live-input { padding-bottom: calc(130px + env(safe-area-inset-bottom)); }
.pev-eyebrow { margin: 0 0 5px; color: var(--pev-blue); font-size: 11px; font-weight: 900; letter-spacing: .14em; }
.pev-hero { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.pev-hero h1 { max-width: 650px; margin: 0; font-size: clamp(25px, 4vw, 40px); letter-spacing: -.04em; line-height: 1.18; }
.pev-hero p:not(.pev-eyebrow) { margin: 9px 0 0; color: var(--pev-muted); line-height: 1.7; }
.pev-new-session, .pev-empty button, .pev-primary-link {
  display: inline-flex;
  min-height: 48px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 13px;
  background: var(--pev-blue);
  padding: 11px 17px;
  color: #fff;
  font-weight: 850;
  text-decoration: none;
  box-shadow: 0 9px 20px rgb(36 87 230 / 20%);
}

.pev-sync {
  display: grid;
  grid-template-columns: 9px auto 1fr;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  border: 1px solid #cce4dc;
  border-radius: 13px;
  background: #f2fbf8;
  margin-bottom: 16px;
  padding: 8px 13px;
  color: #235b4c;
  font-size: 12px;
}

.pev-preview-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid #b9d0f7;
  border-radius: 14px;
  background: #eef5ff;
  color: #183b70;
  font-size: 14px;
}

.pev-preview-notice strong {
  flex: 0 0 auto;
}
.pev-sync > span { width: 8px; height: 8px; border-radius: 50%; background: #1ca982; box-shadow: 0 0 0 4px rgb(28 169 130 / 12%); }
.pev-sync small { color: #5e7f76; text-align: right; }
.pev-sync.is-pending { border-color: #f2d7a2; background: #fffaf0; color: #7d5412; }
.pev-sync.is-pending > span { background: #e5a11d; box-shadow: 0 0 0 4px rgb(229 161 29 / 13%); }
.pev-sync.is-error { border-color: #f1c5ca; background: #fff5f6; color: #932b39; }
.pev-sync.is-error > span { background: #d74758; box-shadow: 0 0 0 4px rgb(215 71 88 / 13%); }

.pev-session-switcher, .pev-chart-card, .pev-history-card, .pev-finish-card, .pev-empty, .pev-login-card {
  border: 1px solid var(--pev-line);
  border-radius: var(--pev-radius);
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 8px 25px rgb(28 49 84 / 5%);
}
.pev-session-switcher { margin-bottom: 18px; padding: 16px; }
.pev-session-switcher > summary, .pev-chart-card > summary { list-style: none; cursor: pointer; }
.pev-session-switcher > summary::-webkit-details-marker, .pev-chart-card > summary::-webkit-details-marker { display: none; }
.pev-session-switcher > summary { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 14px; }
.pev-session-switcher > summary h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.pev-session-switcher > summary > span { display: block; max-width: 52%; overflow: hidden; color: var(--pev-muted); font-size: 11px; font-weight: 750; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.pev-session-switcher > summary > span::after, .pev-disclosure-label::after { display: inline-block; margin-left: 7px; content: "⌄"; transition: transform .18s ease; }
.pev-session-switcher[open] > summary > span::after, .pev-chart-card[open] .pev-disclosure-label::after { transform: rotate(180deg); }
.pev-session-picker-body { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: end; gap: 12px; margin-top: 11px; }
.pev-session-picker-body > label { display: grid; gap: 4px; color: var(--pev-muted); font-size: 11px; font-weight: 700; }
.pev-session-picker-body input { min-height: 42px; border: 1px solid #ccd6e4; border-radius: 10px; background: #fff; padding: 7px 10px; color: var(--pev-ink); }
.pev-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.pev-section-head h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.pev-section-head label { display: grid; gap: 4px; color: var(--pev-muted); font-size: 11px; font-weight: 700; }
.pev-section-head input { min-height: 42px; border: 1px solid #ccd6e4; border-radius: 10px; background: #fff; padding: 7px 10px; color: var(--pev-ink); }
.pev-session-list { display: flex; gap: 9px; overflow-x: auto; margin: 0; padding: 2px 2px 8px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.pev-session-button {
  min-width: 190px;
  min-height: 70px;
  scroll-snap-align: start;
  border: 1px solid #dbe3ef;
  border-radius: 13px;
  background: #f8fafc;
  padding: 10px 12px;
  color: #293852;
  text-align: left;
}
.pev-session-button strong, .pev-session-button span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pev-session-button span { margin-top: 4px; color: var(--pev-muted); font-size: 12px; }
.pev-session-button.is-current { border-color: #88a6ff; background: #edf2ff; box-shadow: 0 0 0 2px rgb(36 87 230 / 9%); }
.pev-session-button.is-complete span::after { content: " · 完了"; color: var(--pev-green); font-weight: 800; }
.pev-session-button.is-conflict { border-color: #e5a9b2; background: #fff5f6; }
.pev-session-button.is-conflict span { color: #a02d40; font-weight: 800; }

.pev-empty { padding: 38px 20px; text-align: center; }
.pev-empty > div { display: grid; width: 58px; height: 58px; place-items: center; border-radius: 19px; background: #e9efff; margin: 0 auto 14px; color: var(--pev-blue); font-size: 32px; }
.pev-empty h2 { margin: 0; font-size: 20px; }
.pev-empty p { max-width: 500px; margin: 8px auto 18px; color: var(--pev-muted); line-height: 1.7; }

.pev-workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.pev-workspace > * { min-width: 0; }
.pev-current-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; padding: 4px 2px; }
.pev-current-head > div:first-child { min-width: 0; }
.pev-current-actions { display: flex; flex: 0 0 auto; gap: 7px; }
.pev-new-session-inline { display: none; }
.pev-main.is-session-active .pev-hero { position: relative; height: 0; overflow: visible; margin: 0; }
.pev-main.is-session-active .pev-hero > div { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; }
.pev-main.is-session-active .pev-new-session-hero { display: none; }
.pev-main.is-session-active .pev-sync { grid-template-columns: 9px minmax(0, 1fr); min-height: 32px; margin-bottom: 8px; padding: 4px 10px; }
.pev-main.is-session-active .pev-sync small { display: none; }
.pev-main.is-session-active .pev-sync.is-pending,
.pev-main.is-session-active .pev-sync.is-error { grid-template-columns: 9px minmax(0, 1fr); }
.pev-main.is-session-active .pev-sync.is-pending small,
.pev-main.is-session-active .pev-sync.is-error small { display: block; grid-column: 2; text-align: left; }
.pev-main.is-session-active .pev-session-switcher { margin-bottom: 8px; padding: 4px 10px; }
.pev-main.is-session-active .pev-session-switcher > summary > div { display: none; }
.pev-main.is-session-active .pev-session-switcher > summary > span { max-width: 100%; flex: 1; font-size: 12px; text-align: left; }
.pev-main.is-session-active .pev-workspace { gap: 10px; }
.pev-main.is-session-active .pev-new-session-inline { display: inline-grid; place-items: center; color: var(--pev-blue); font-size: 20px; }
.pev-current-head h2 { margin: 3px 0 5px; font-size: clamp(20px, 4vw, 28px); letter-spacing: -.035em; }
.pev-current-head p { margin: 0; color: var(--pev-muted); font-size: 12px; line-height: 1.55; }
.pev-current-head > div > p:first-child { color: var(--pev-blue); font-weight: 850; }
.pev-current-head button, .pev-section-head > button {
  min-height: 44px;
  border: 1px solid #ccd7e6;
  border-radius: 11px;
  background: #fff;
  padding: 8px 12px;
  color: #384863;
  font-weight: 800;
}

.pev-setup-callout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 52px;
  align-items: center;
  gap: 10px;
  border: 1px solid #efcf92;
  border-radius: 13px;
  background: #fff9ed;
  padding: 7px 9px 7px 12px;
  color: #70480c;
}
.pev-setup-callout strong, .pev-setup-callout small { display: block; }
.pev-setup-callout strong { font-size: 13px; }
.pev-setup-callout small { margin-top: 2px; color: #8a682f; font-size: 10px; line-height: 1.35; }
.pev-setup-callout button { min-height: 44px; border: 0; border-radius: 10px; background: #9a650e; padding: 7px 11px; color: #fff; font-size: 11px; font-weight: 850; white-space: nowrap; }

.pev-conflict-recovery {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 10px; border: 1px solid #edb7be; border-radius: 13px; background: #fff4f5; padding: 9px 10px 9px 12px; color: #812837;
}
.pev-conflict-recovery strong, .pev-conflict-recovery small { display: block; }
.pev-conflict-recovery strong { font-size: 13px; line-height: 1.35; }
.pev-conflict-recovery small { margin-top: 3px; color: #8f5660; font-size: 10px; line-height: 1.4; }
.pev-conflict-recovery button { min-height: 44px; border: 0; border-radius: 10px; background: #a52f42; padding: 7px 11px; color: #fff; font-size: 11px; font-weight: 850; line-height: 1.35; }
.pev-conflict-recovery p { grid-column: 1 / -1; min-height: 0; margin: 0; color: #9b263a; font-size: 11px; line-height: 1.45; }
.pev-recovery-success { display: grid; gap: 2px; border: 1px solid #a9d9c9; border-radius: 13px; background: #effaf6; padding: 9px 12px; color: #17614e; }
.pev-recovery-success strong, .pev-recovery-success small { display: block; }
.pev-recovery-success strong { font-size: 13px; }
.pev-recovery-success small { color: #4b786d; font-size: 10px; line-height: 1.4; }

.pev-score-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.pev-score { min-width: 0; border: 1px solid var(--pev-line); border-radius: 16px; background: #fff; padding: 15px; box-shadow: 0 7px 20px rgb(33 51 82 / 5%); }
.pev-score > span, .pev-score small { display: block; color: var(--pev-muted); font-size: 11px; }
.pev-score > span b { color: inherit; font-size: .9em; font-weight: 850; }
.pev-score-primary [data-pev-unmeasured] { display: inline-flex; align-items: center; min-height: 17px; margin-left: 3px; border: 1px solid rgb(255 255 255 / 35%); border-radius: 999px; background: rgb(255 255 255 / 15%); padding: 1px 5px; color: #fff; font-size: 8px; line-height: 1; vertical-align: 1px; }
.pev-score strong { display: block; overflow: hidden; margin: 5px 0 4px; font-size: clamp(21px, 3vw, 30px); letter-spacing: -.04em; text-overflow: ellipsis; white-space: nowrap; }
.pev-score-primary { border-color: transparent; background: linear-gradient(135deg, #244fd1, #7151dc); color: #fff; box-shadow: 0 14px 30px rgb(54 66 192 / 23%); }
.pev-score-primary > span, .pev-score-primary small { color: rgb(255 255 255 / 77%); }
.pev-score-primary strong.is-negative { color: #ffd9de; }
.pev-score-primary strong.is-pending { font-size: clamp(17px, 2.5vw, 24px); }

.pev-insight { display: grid; grid-template-columns: 36px 1fr; gap: 11px; border: 1px solid #cbd9f8; border-radius: 15px; background: #f0f5ff; padding: 13px 15px; color: #263b70; }
.pev-insight-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: #fff; color: var(--pev-blue); font-weight: 900; box-shadow: 0 3px 10px rgb(36 87 230 / 12%); }
.pev-insight p { margin: 3px 0 0; color: #59709f; font-size: 12px; line-height: 1.55; }
.pev-insight.is-positive { border-color: #b7e1d3; background: #effaf6; color: #145f4c; }
.pev-insight.is-negative { border-color: #f0c7cc; background: #fff5f6; color: #8f2f3c; }

.pev-chart-card, .pev-history-card { padding: 17px; }
.pev-chart-card > summary { min-height: 44px; }
.pev-disclosure-label { color: var(--pev-blue); font-size: 11px; font-weight: 850; white-space: nowrap; }
.pev-chart-legend { display: flex; gap: 13px; color: var(--pev-muted); font-size: 11px; }
.pev-chart-card > .pev-chart-legend { justify-content: end; margin-top: 8px; }
.pev-chart-legend span::before { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #98a7bd; margin-right: 5px; content: ""; }
.pev-chart-legend span:last-child::before { background: var(--pev-blue); }
.pev-chart { min-height: 178px; margin-top: 14px; overflow: hidden; border-radius: 13px; background: linear-gradient(#f8faff, #fff); }
.pev-chart svg { display: block; width: 100%; height: 178px; }
.pev-chart-empty { display: grid; min-height: 178px; place-items: center; color: #8793a6; font-size: 13px; }

.pev-history { display: grid; gap: 6px; margin-top: 9px; }
.pev-history.is-expanded { max-height: min(58vh, 560px); overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; }
.pev-history-row { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 8px; border: 1px solid #e4e9f1; border-radius: 10px; padding: 7px 9px; }
.pev-history-row > span:first-child { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; background: #edf2ff; color: var(--pev-blue); font-size: 10px; font-weight: 900; }
.pev-history-row.is-held > span:first-child { background: #eaf8f3; color: var(--pev-green); }
.pev-history-row.is-held-balance > span:first-child { background: #e6f8f1; color: #16755b; }
.pev-history-row.is-boundary > span:first-child { background: #fff3e8; color: #9a571e; }
.pev-history-row.is-cash-invest { border-color: #f0d4b5; background: #fffaf3; }
.pev-history-row.is-cash-invest > span:first-child { background: #fff0df; color: #a15312; }
.pev-history-row strong { display: block; font-size: 13px; line-height: 1.25; }
.pev-history-row small { display: block; overflow: hidden; margin-top: 2px; color: var(--pev-muted); font-size: 10px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.pev-history-row small em { color: var(--pev-green); font-style: normal; font-weight: 850; }
.pev-history-row small em.is-negative { color: var(--pev-red); }
.pev-history-row small em.is-pending { color: #9a650e; }
.pev-history-empty { padding: 15px 10px; color: var(--pev-muted); text-align: center; }
.pev-history-actions { display: flex; align-items: center; gap: 7px; }
.pev-history-card .pev-section-head h2 small { margin-left: 5px; color: var(--pev-muted); font-size: .67em; font-weight: 750; white-space: nowrap; }
.pev-history-actions button { min-height: 44px; border: 1px solid #d6deea; border-radius: 10px; background: #fff; padding: 7px 10px; color: #44536b; font-size: 11px; font-weight: 800; }

.pev-dialog-card > label, .pev-two-columns label, .pev-dialog details > label { display: grid; gap: 6px; color: #41506a; font-size: 12px; font-weight: 750; }
.pev-dialog-card input, .pev-dialog-card select {
  width: 100%; min-height: 46px; border: 1px solid #cbd5e2; border-radius: 11px; background: #fff; padding: 9px 11px; color: var(--pev-ink); font-size: 16px;
}

.pev-finish-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px; }
.pev-finish-card p { margin: 4px 0 0; color: var(--pev-muted); font-size: 12px; line-height: 1.55; }
.pev-finish-card > div:last-child { display: flex; flex: 0 0 auto; gap: 8px; }
.pev-finish-card button { min-height: 44px; border: 1px solid #cbd5e2; border-radius: 11px; background: #fff; padding: 8px 13px; color: #37465f; font-weight: 850; }
.pev-finish-card button:last-child { border-color: var(--pev-blue); background: var(--pev-blue); color: #fff; }

.pev-entry-dock {
  position: fixed;
  z-index: 35;
  right: 0;
  bottom: 0;
  left: 0;
  border-top: 1px solid #d5deeb;
  background: rgb(255 255 255 / 96%);
  padding: 8px max(14px, env(safe-area-inset-right)) calc(9px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  box-shadow: 0 -15px 45px rgb(23 43 78 / 12%);
  backdrop-filter: blur(18px);
}
.pev-entry-dock > * { width: min(100%, 910px); margin-right: auto; margin-left: auto; }
.pev-entry-dock form { display: grid; grid-template-columns: minmax(260px, .58fr) minmax(340px, 1fr); align-items: end; gap: 10px; }
.pev-entry-toolbar { display: block; }
.pev-entry-toolbar fieldset { min-width: 0; margin: 0; border: 0; padding: 0; }
.pev-entry-toolbar legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.pev-mode-switch { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #cbd6e4; border-radius: 11px; background: #eef2f7; padding: 3px; }
.pev-mode-switch button { display: grid; min-width: 0; min-height: 44px; align-content: center; gap: 1px; border: 0; border-radius: 8px; background: transparent; color: #56637a; font-size: 12px; font-weight: 850; }
.pev-mode-switch button span, .pev-mode-switch button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pev-mode-switch button small { color: inherit; font-size: 8px; font-weight: 750; opacity: .78; }
.pev-mode-switch button[aria-pressed="true"] { background: #fff; color: var(--pev-blue); box-shadow: 0 3px 10px rgb(21 45 86 / 12%); }
.pev-boundary { min-height: 58px; border: 1px solid #f0d0ab; border-radius: 12px; background: #fff8ee; padding: 8px 10px; color: #8c531d; font-size: 11px; font-weight: 900; }
.pev-boundary span, .pev-boundary small { display: block; }
.pev-boundary small { margin-top: 2px; font-size: 9px; font-weight: 800; line-height: 1; }
.pev-entry-main { display: grid; grid-template-columns: minmax(180px, 1fr) 90px minmax(118px, .42fr); align-items: end; gap: 8px; }
.pev-spin-input { position: relative; }
.pev-spin-input label { display: block; margin-bottom: 5px; color: #43516a; font-size: 11px; font-weight: 850; }
.pev-spin-input input { width: 100%; min-height: 58px; border: 2px solid #b9c8db; border-radius: 13px; background: #fff; padding: 8px 14px; color: #14233b; font-size: 25px; font-weight: 900; outline: 0; }
.pev-spin-input input:focus { border-color: var(--pev-blue); box-shadow: 0 0 0 4px rgb(36 87 230 / 11%); }
.pev-record-button { min-height: 58px; border: 0; border-radius: 13px; background: linear-gradient(135deg, #2259ec, #5e48d5); color: #fff; font-weight: 900; box-shadow: 0 9px 22px rgb(45 72 206 / 24%); }
.pev-record-button[data-action="cash-invest"] { background: linear-gradient(135deg, #ee8415, #e45b20); box-shadow: 0 9px 22px rgb(211 101 25 / 24%); }
.pev-record-button:disabled { background: #9aa7b8; box-shadow: none; cursor: not-allowed; opacity: .82; }
.pev-record-button span, .pev-record-button small { display: block; }
.pev-record-button small { margin-top: 2px; color: rgb(255 255 255 / 72%); font-size: 10px; font-weight: 650; }

.pev-dialog { width: min(92vw, 560px); max-height: min(90vh, 760px); border: 0; border-radius: 20px; padding: 0; color: var(--pev-ink); box-shadow: 0 30px 90px rgb(11 24 49 / 32%); }
.pev-dialog::backdrop { background: rgb(11 24 47 / 62%); backdrop-filter: blur(5px); }
.pev-dialog-card { display: grid; gap: 14px; margin: 0; padding: 20px; }
.pev-dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.pev-dialog-head h2 { margin: 0; font-size: 23px; }
.pev-dialog-head button { display: grid; min-width: 44px; min-height: 44px; place-items: center; border: 0; border-radius: 12px; background: #eef2f7; color: #42516a; font-size: 22px; }
.pev-two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pev-border-preview { border: 1px solid #cddcfb; border-radius: 13px; background: #f2f6ff; padding: 12px; color: #344b80; font-size: 12px; line-height: 1.65; }
.pev-border-preview strong { color: #173eaa; }
.pev-dialog details { border: 1px solid #dde4ee; border-radius: 12px; padding: 11px; }
.pev-dialog summary { min-height: 28px; color: #41516b; font-size: 12px; font-weight: 850; cursor: pointer; }
.pev-dialog details > div, .pev-dialog details > label { margin-top: 11px; }
.pev-dialog-submit { min-height: 50px; border: 0; border-radius: 12px; background: var(--pev-blue); color: #fff; font-weight: 900; }
.pev-settings-dialog { width: min(94vw, 620px); }
.pev-settings-lead, .pev-quick-start-copy { margin: 0; color: var(--pev-muted); font-size: 12px; line-height: 1.65; }
.pev-settings-dialog [data-pev-settings-help] { margin: 0; color: var(--pev-muted); font-size: 11px; line-height: 1.55; }
.pev-settings-dialog [data-pev-settings-cash-state], .pev-settings-dialog [data-pev-settings-held-state] { color: #9a650e; font-size: 10px; font-weight: 850; }
.pev-create-settings > label:first-of-type { margin-top: 11px; }
.pev-quick-start-fields { grid-template-columns: 1fr 1fr; align-items: end; }
.pev-dialog-status { min-height: 18px; margin: 0; color: var(--pev-red); font-size: 12px; }
.pev-held-dialog-copy { margin: 0; color: var(--pev-muted); font-size: 12px; line-height: 1.65; }
.pev-held-entry-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 0; border: 1px solid #d7e0ec; border-radius: 12px; background: #f3f6fa; padding: 4px; }
.pev-held-entry-mode legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.pev-held-entry-mode label { display: flex; min-height: 42px; align-items: center; justify-content: center; gap: 6px; border-radius: 9px; color: #58677e; font-size: 12px; font-weight: 850; }
.pev-held-entry-mode label:has(input:checked) { background: #fff; color: var(--pev-blue); box-shadow: 0 3px 10px rgb(31 55 94 / 10%); }
.pev-held-entry-mode input { width: auto; min-height: 0; margin: 0; }
.pev-held-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.pev-held-quick button { min-height: 44px; border: 1px solid #bfd0f4; border-radius: 11px; background: #f2f6ff; color: #244fae; font-weight: 900; }
.pev-held-dialog label > small { color: var(--pev-muted); font-size: 11px; font-weight: 650; }
.pev-held-parts { gap: 9px; }
.pev-held-current { display: block; margin-top: -5px; color: var(--pev-muted); font-size: 11px; font-weight: 700; }
.pev-disclaimer { margin: 22px auto 0; color: #7a8496; font-size: 11px; line-height: 1.65; text-align: center; }
.pev-login-card { max-width: 600px; margin: 12vh auto; padding: 30px; }
.pev-login-card h1 { margin: 0; font-size: 30px; }
.pev-login-card p:not(.pev-eyebrow) { color: var(--pev-muted); line-height: 1.75; }

.pev-mobile-nav { display: none; }
:focus-visible { outline: 3px solid rgb(36 87 230 / 32%); outline-offset: 2px; }

@media (max-width: 760px) {
  .pev-main { width: min(100% - 20px, 940px); padding-top: 18px; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .pev-main.is-live-input { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
  .pev-hero { align-items: start; }
  .pev-hero p:not(.pev-eyebrow) { font-size: 13px; }
  .pev-new-session { min-width: 48px; overflow: hidden; padding: 11px 13px; font-size: 0; }
  .pev-new-session::before { content: "+"; font-size: 24px; }
  .pev-score-grid { grid-template-columns: 1fr 1fr; }
  .pev-score { min-height: 105px; padding: 13px; }
  .pev-session-picker-body { grid-template-columns: 1fr; align-items: stretch; }
  .pev-finish-card { align-items: stretch; flex-direction: column; }
  .pev-finish-card > div:last-child { display: grid; grid-template-columns: 1fr 1fr; }
  .pev-entry-dock { bottom: calc(61px + env(safe-area-inset-bottom)); padding: 7px 10px; }
  .pev-entry-dock form { grid-template-columns: 120px 82px minmax(68px, 1fr) 44px; align-items: stretch; gap: 5px; }
  .pev-entry-toolbar, .pev-entry-main { display: contents; }
  .pev-entry-toolbar fieldset { grid-column: 1; grid-row: 1; }
  .pev-mode-switch { height: 54px; padding: 2px; }
  .pev-mode-switch button { min-height: 48px; padding: 0 3px; font-size: 10px; }
  .pev-mode-switch button small { font-size: 9px; }
  .pev-record-button { grid-column: 2; grid-row: 1; }
  .pev-spin-input { grid-column: 3; grid-row: 1; }
  .pev-boundary { grid-column: 4; grid-row: 1; min-height: 54px; padding: 4px; font-size: 9px; }
  .pev-spin-input label { position: absolute; z-index: 1; top: 4px; left: 12px; margin: 0; font-size: 9px; pointer-events: none; }
  .pev-spin-input input { height: 54px; min-height: 54px; padding-top: 15px; font-size: 22px; }
  .pev-record-button { height: 54px; min-height: 54px; padding: 4px; line-height: 1.15; }
  .pev-record-button small { font-size: 8px; white-space: nowrap; }
  .pev-mobile-nav {
    position: fixed; z-index: 40; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(3, 1fr); min-height: calc(61px + env(safe-area-inset-bottom)); border-top: 1px solid #d5deea; background: rgb(255 255 255 / 97%); padding: 5px 8px env(safe-area-inset-bottom); box-shadow: 0 -8px 25px rgb(20 40 75 / 10%); backdrop-filter: blur(16px);
  }
  .pev-mobile-nav a { display: grid; min-height: 50px; place-items: center; gap: 1px; border-radius: 11px; color: #66738a; font-size: 10px; font-weight: 800; text-decoration: none; }
  .pev-mobile-nav a span { font-size: 19px; line-height: 1; }
  .pev-mobile-nav a.is-current { background: #edf2ff; color: var(--pev-blue); }
  body.is-checker-only .pev-main:not(.is-live-input) { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .pev-personal-welcome { align-items: center; padding: 17px; }
  .pev-personal-welcome .pev-new-session { align-self: center; width: 50px; min-width: 50px; min-height: 50px; }
  .pev-history-search > div:first-child { grid-template-columns: 1fr 1fr; }
  .pev-history-search label:nth-child(3), .pev-history-search label:nth-child(4), .pev-history-search label:nth-child(5) { grid-column: 1 / -1; }

  body.pev-session-running .pev-shell-header { min-height: 52px; padding-top: 4px; padding-bottom: 4px; }
  .pev-main.is-session-active { padding-top: 8px; }
  .pev-main.is-session-active .pev-workspace { gap: 8px; }
  .pev-main.is-session-active .pev-current-head { min-height: 52px; align-items: center; gap: 8px; padding: 0 2px; }
  .pev-main.is-session-active .pev-current-head h2 { overflow: hidden; margin: 1px 0; font-size: 17px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
  .pev-main.is-session-active .pev-current-head p { overflow: hidden; max-width: 235px; font-size: 10px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
  .pev-main.is-session-active .pev-current-actions button { min-width: 44px; min-height: 44px; padding: 5px 8px; }
  .pev-main.is-session-active .pev-score-grid { grid-template-columns: minmax(0, 1.25fr) repeat(3, minmax(0, 1fr)); gap: 4px; }
  .pev-main.is-session-active .pev-score { min-height: 72px; border-radius: 12px; padding: 8px 6px; }
  .pev-main.is-session-active .pev-score > span { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
  .pev-main.is-session-active .pev-score strong { margin: 4px 0 0; font-size: clamp(15px, 4.2vw, 19px); }
  .pev-main.is-session-active .pev-score small { display: none; }
  .pev-main.is-session-active .pev-history-card { border-radius: 12px; padding: 9px; }
  .pev-main.is-session-active .pev-history-card .pev-section-head { min-height: 44px; }
  .pev-main.is-session-active .pev-history-card .pev-eyebrow { display: none; }
  .pev-main.is-session-active .pev-history { gap: 4px; margin-top: 5px; }
  .pev-main.is-session-active .pev-history-row { min-height: 44px; gap: 7px; padding: 5px 7px; }
  .pev-main.is-session-active .pev-history-row > span:first-child { width: 28px; height: 28px; }
  .pev-main.is-session-active .pev-history-row strong { font-size: 12px; }
  .pev-main.is-session-active .pev-history-row small { font-size: 9px; }
}

@media (max-width: 480px) {
  .pev-shell-header { min-height: 54px; }
  .pev-shell-header > div a:first-child { display: none; }
  .pev-hero h1 { font-size: 25px; }
  .pev-session-switcher, .pev-chart-card, .pev-history-card { border-radius: 15px; padding: 13px; }
  .pev-section-head { align-items: end; }
  .pev-section-head h2 { font-size: 16px; }
  .pev-session-button { min-width: 168px; }
  .pev-current-head { align-items: center; }
  .pev-current-head h2 { font-size: 21px; }
  .pev-score strong { font-size: 23px; }
  .pev-history-card .pev-eyebrow { display: none; }
  .pev-history-actions button { min-height: 44px; padding: 6px 9px; }
  .pev-spin-input input::placeholder { font-size: 16px; }
  .pev-two-columns { grid-template-columns: 1fr; }
  .pev-quick-start-fields { grid-template-columns: 1fr 1fr; }
  .pev-quick-start-fields label:first-child { grid-column: 1 / -1; }
  .pev-quick-start-fields .pev-quick-store { grid-column: 1 / -1; }
  .pev-held-parts { grid-template-columns: 1fr 1fr; }
  .pev-dialog-card { padding: 17px; }
  body.is-checker-only .pev-shell-header { gap: 6px; }
  body.is-checker-only .pev-shell-header > div { gap: 2px; }
  body.is-checker-only .pev-shell-header > div a:first-child { display: inline-flex; }
  body.is-checker-only .pev-account-name { display: none; }
  body.is-checker-only .pev-shell-header a, body.is-checker-only .pev-header-link { padding: 8px; font-size: 12px; }
  body.is-checker-only .pev-brand { max-width: 138px; font-size: 17px; }
  .pev-personal-session { grid-template-columns: minmax(0, 1fr); }
  .pev-personal-session-delete { min-height: 44px; border-top: 1px solid var(--pev-line); border-left: 0; }
  .pev-store-tools { align-items: stretch; flex-direction: column; flex-wrap: nowrap !important; }
  .pev-store-tools > button { width: 100%; margin: 0; }
}

@media (max-width: 600px) {
  body.admin-bar .pev-shell-header { top: 0; }
}

@media (min-width: 783px) {
  body.admin-bar .pev-shell-header { top: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
