:root {
  color-scheme: light;
  --bg: #f3f5f9;
  --panel: #fff;
  --ink: #20303f;
  --muted: #53647a;
  --line: #cbd4df;
  --blue: #1f6feb;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font:
    16px/1.6 system-ui,
    sans-serif;
  background: var(--bg);
  color: var(--ink);
}
a {
  color: #1555b3;
}
header {
  padding: 20px 32px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  text-decoration: none;
  color: var(--ink);
  font-size: 23px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  display: block;
  width: 184px;
  height: 28px;
  overflow: hidden;
  position: relative;
}
.brand-logo img {
  display: block;
  position: absolute;
  top: -23px;
  left: -10px;
}
header span,
.muted {
  color: var(--muted);
}
.shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  max-width: 1600px;
  margin: auto;
}
aside {
  padding: 24px;
  background: var(--panel);
}
nav {
  display: grid;
  gap: 8px;
  margin: 20px 0;
}
nav a {
  padding: 8px 10px;
  text-decoration: none;
  color: var(--ink);
  border-radius: 6px;
}
nav a[aria-current="page"] {
  background: #e8effc;
  color: #164f9f;
}
nav h3 {
  font-size: 14px;
  margin: 18px 0 0;
}
main {
  padding: 28px;
  min-width: 0;
}
h1 {
  font-size: 29px;
  margin: 0 0 24px;
}
h2 {
  font-size: 21px;
  margin: 0 0 12px;
}
.panel {
  background: var(--panel);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 18px 0;
}
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
  gap: 18px;
}
.plan-grid .panel {
  min-width: 0;
  margin: 0;
}
p {
  overflow-wrap: anywhere;
}
form {
  display: grid;
  gap: 16px;
  max-width: 680px;
}
label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}
input,
select,
textarea,
button,
.button {
  font: inherit;
  min-height: 44px;
  border-radius: 5px;
}
input,
select,
textarea {
  padding: 9px 12px;
  border: 1px solid #7a8ca0;
  background: white;
  color: var(--ink);
  width: 100%;
}
textarea {
  min-height: 100px;
  resize: vertical;
}
.check {
  display: flex;
  align-items: flex-start;
  font-weight: 400;
}
.check input {
  width: 20px;
  min-height: 24px;
  flex-shrink: 0;
}
button,
.button {
  background: var(--blue);
  color: white;
  border: 0;
  padding: 10px 16px;
  text-decoration: none;
  cursor: pointer;
  width: fit-content;
}
button:hover,
.button:hover {
  background: #185bc7;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #114998;
  outline-offset: 3px;
}
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.badge {
  display: inline-block;
  background: #e4efff;
  color: #164f9f;
  padding: 5px 10px;
  border-radius: 20px;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 20px;
}
.summary-grid dt {
  color: var(--muted);
  font-size: 14px;
}
.summary-grid dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}
.notice {
  background: #edf4ff;
  border-radius: 6px;
  padding: 16px;
}
.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.feature-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.feature-list li span {
  min-width: 0;
}
.feature-list li strong {
  flex-shrink: 0;
}
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 18px;
}
.plan-grid .panel {
  margin: 0;
}
.member-count {
  font-size: 36px;
  font-weight: 700;
  margin: 8px 0;
}
.sync-state {
  font-weight: 600;
}
.table-wrap {
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 20px 0;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
  max-width: 350px;
}
th {
  background: #edf1f7;
}
footer {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.error {
  background: #fff0ef;
  border-left: 4px solid #b42318;
  padding: 20px;
}
code {
  overflow-wrap: anywhere;
}
@media (max-width: 800px) {
  .shell {
    grid-template-columns: 1fr;
  }
  aside {
    border-bottom: 1px solid var(--line);
  }
  nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  nav h3 {
    grid-column: 1/-1;
  }
  main {
    padding: 18px;
  }
  header {
    padding: 16px;
  }
  .panel {
    padding: 18px;
  }
  h1 {
    font-size: 25px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  a,
  button {
    transition: background 0.15s;
  }
}

.plan-comparison {
  min-width: 540px;
}
.plan-comparison tbody th {
  width: 34%;
  font-weight: 600;
}
.plan-comparison .badge {
  display: table;
  margin-top: 6px;
  font-size: 12px;
}

/* Shared navigation and workspace layout */
aside { background: #10213b; color: #eff5ff; }
aside .muted { color: #b7c8df; }
aside .account-identity { overflow-wrap: anywhere; }
aside a, nav a { color: #e1edff; }
nav a:hover { background: #203b60; }
nav a[aria-current="page"] { background: #234e8d; color: #fff; }
nav h3 { color: #b7c8df; }
main { background: #f7f9fc; }
.panel { box-shadow: 0 1px 2px #142b4710; }
.workspace-form { max-width: none; }
.editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
}
.editor-grid fieldset {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.editor-grid legend { font-weight: 700; padding: 0 6px; }
.setting-row {
  grid-template-columns: minmax(0, 1fr) minmax(135px, 1fr);
  align-items: center;
}
.plan-version {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.plan-version h3, .plan-version p { margin: 0 0 8px; }
.workspace-form details .editor-grid, .workspace-form details .plan-grid { margin-top: 12px; }
summary { cursor: pointer; font-weight: 600; }
.empty-state { text-align: center; padding-block: 52px; }
.table-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}
.table-filter label { flex: 1 1 220px; }
@media (max-width: 420px) {
  .setting-row { grid-template-columns: 1fr; }
}
.gift-review { padding: 14px 16px; border-radius: 8px; background: #eaf2ff; }
.gift-review h3, .gift-review p { margin: 0; }
.sign-in { text-align: center; padding-block: 42px; }
.language-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid #38536f;
}
.language-menu a {
  padding: 4px 5px;
  border-radius: 4px;
  font-size: .875rem;
}
.language-menu a:hover,
.language-menu a[aria-current="true"] { background: #e8effc; color: #163d76; }
.language-menu a[aria-current="true"] { font-weight: 700; }

.panel-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.panel-heading h2 { margin: 0; }
.plan-levels { display: flex; flex-wrap: wrap; gap: 8px; }
.plan-levels a { color: var(--ink); border: 1px solid var(--line); }
.plan-levels a:hover { background: #e8effc; color: var(--ink); }
.selected-version, .row-action-form, .record-details { margin-top: 14px; }
.record-details dt { font-weight: 600; }
.record-details dd { margin: 0 0 8px; }


.owner-plan-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
@media (min-width: 1150px) {
  .owner-plan-layout:has(.checkout-review) {
    grid-template-columns: minmax(0, 2fr) minmax(250px, 1fr);
  }
}
.owner-plan-layout > .panel { min-width: 0; margin: 0; }
.owner-plan-table { padding: 16px; }
.owner-plan-table .plan-comparison tbody th { width: 29%; }
.owner-plan-table .plan-comparison td { width: 23.67%; }
.selected-plan-column {
  background: #e8f1ff;
  box-shadow: inset 2px 0 #1f6feb, inset -2px 0 #1f6feb;
}
thead .selected-plan-column { box-shadow: inset 0 2px #1f6feb, inset 2px 0 #1f6feb, inset -2px 0 #1f6feb; }
.plan-actions .selected-plan-column { box-shadow: inset 0 -2px #1f6feb, inset 2px 0 #1f6feb, inset -2px 0 #1f6feb; }
.plan-choice {
  background: white;
  color: #1555b3;
  border: 1px solid #1f6feb;
}
.plan-choice:hover { background: #edf4ff; }
.plan-notes { color: var(--muted); font-size: 0.875rem; margin-top: 12px; }
.plan-notes summary { cursor: pointer; }
.checkout-summary { margin: 16px 0 24px; }
.checkout-summary div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.checkout-summary dt { color: var(--muted); }
.checkout-summary dd { font-weight: 700; text-align: right; margin: 0; overflow-wrap: anywhere; }
.checkout-review { scroll-margin-top: 16px; }
.checkout-review:target { border-color: #1f6feb; }
.checkout-review button { width: 100%; }

.admin-build-details { margin-top: 16px; font-size: 0.875rem; }
.admin-build-details summary { cursor: pointer; }
.admin-build-details dd { margin: 0 0 8px; overflow-wrap: anywhere; }

.billing-cycle { display: inline-flex; gap: 4px; margin-bottom: 16px; padding: 4px; border: 1px solid #c5d2e3; border-radius: 10px; }
.billing-cycle a { padding: 8px 16px; border-radius: 7px; color: #154c9d; text-decoration: none; font-weight: 700; }
.billing-cycle a:hover { background: #e8f0ff; text-decoration: underline; }
.billing-cycle a[aria-current] { background: #175bcc; color: white; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 12px; }
.plan-card { display: flex; flex-direction: column; align-items: start; border: 1px solid #c5d2e3; border-radius: 12px; padding: 16px; min-width: 0; }
.plan-card-selected { outline: 2px solid #175bcc; outline-offset: -2px; background: #f4f8ff; }
.plan-card h2 { font-size: 1.1rem; margin-top: 0; }
.plan-card-price { font-size: 1.2rem; font-weight: 750; margin: 0; }
.annual-saving { color: #174c98; font-weight: 650; }
.plan-card-action { margin-top: auto; padding-top: 10px; }

.promotion-banner { padding: 22px 26px; margin-bottom: 22px; color: #fff; border-radius: 14px; background: linear-gradient(115deg,#154cce,#6942d8); }
.promotion-banner h2 { color: #fff; margin: 12px 0 8px; }
.promotion-banner p { color: #fff; margin: 8px 0 0; }
.promotion-label { display: inline-block; padding: 5px 12px; border-radius: 8px; background: #fff; color: #1746a2; font-weight: 700; }
.plan-card-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; flex-wrap:wrap; }
.plan-original { color:#64748b; margin-bottom:0; }
.plan-original s { text-decoration-thickness:2px; }
.promotion-terms { margin-top:18px; color:#475569; }
.promotion-terms a { display:inline-block; margin-left:8px; }
@media(max-width:600px) { .promotion-banner{padding:18px}.promotion-banner h2{font-size:22px} }

.tax-address { margin: 14px 0; }
.tax-address summary { cursor: pointer; font-weight: 600; }
@media (max-width: 700px) {
  .owner-plan-table { display: contents; }
  .owner-plan-table > .billing-cycle { order: 0; }
  .owner-plan-table > .plan-cards { order: 1; }
  .owner-plan-layout > .checkout-review { order: 2; padding: 16px; }
  .owner-plan-table > .plan-notes { order: 3; margin: 0; padding: 14px; background: white; border-radius: 12px; }
  .owner-plan-table > .promotion-terms { order: 4; }
}

button:disabled, button:disabled:hover { background: #e2e8f0; color: #64748b; border-color: #cbd5e1; cursor: not-allowed; box-shadow: none; }

main .currency-switch { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
main .currency-switch a { display: inline-block; width: auto; color: #1e3a5f; background: #fff; border: 1px solid #94a3b8; border-radius: .5rem; padding: .6rem 1rem; text-decoration: none; }
main .currency-switch a[aria-current="page"] { color: #fff; background: #1d4ed8; border-color: #1d4ed8; }
main .currency-switch a:hover { border-color: #1d4ed8; text-decoration: underline; }

.company-search { position: relative; min-width: 240px; max-width: 100%; }
.company-search > button { position: absolute; right: 1px; top: 25px; background: #f1f5f9; color: #1e3a5f; }
.company-search input[type="search"] { padding-right: 48px; }
.company-search [role="listbox"] { position: absolute; top: 100%; left: 0; width: min(480px,80vw); max-height: 300px; overflow-y: auto; background: white; border: 1px solid #94a3b8; box-shadow: 0 8px 20px #0f172a26; z-index: 5; }
.company-search [role="listbox"] button { display: block; width: 100%; text-align: left; background: white; color: #1e3a5f; border-radius: 0; }
.company-search [role="listbox"] button:hover, .company-search [role="listbox"] button:focus { background: #dbeafe; }

.owner-plan-layout > * { min-width: 0; }
main .currency-switch { display: inline-flex; flex-wrap: nowrap; gap: 4px; padding: 4px; border: 1px solid #c5d2e3; border-radius: 10px; }
main .currency-switch a { min-width: 72px; text-align: center; margin: 0; padding: 8px 16px; border: 0; border-radius: 7px; font-weight: 700; color: #154c9d; }
main .currency-switch a[aria-current="page"] { background: #175bcc; color: white; }

@media (max-width: 700px) { .owner-plan-layout { grid-template-columns: minmax(0, 1fr); } .checkout-summary dt, .checkout-summary dd { min-width: 0; overflow-wrap: anywhere; } }

/* Keep checkout recovery, status checks and cancellation visually distinct. */
.payment-action-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; margin-top: 20px; }
.payment-action-row form, .payment-cancel-area form { margin: 0; min-width: 0; }
.payment-action-row button { max-width: 100%; white-space: normal; }
.payment-status-button { background: white; color: var(--ink); border: 1px solid #7a8ca0; }
.payment-status-button:hover { background: #eef3f9; }
.payment-cancel-area { border-top: 1px solid #d3dce7; margin-top: 24px; padding-top: 16px; }
.payment-cancel-button { background: transparent; color: var(--blue); padding: 8px 0; text-align: left; }
.payment-cancel-button:hover { background: transparent; text-decoration: underline; }
.payment-cancel-area p { margin: 8px 0 0; color: #52657b; }
@media (max-width: 600px) {
 .payment-action-row { flex-direction: column; align-items: stretch; }
 .payment-action-row form, .payment-action-row button { width: 100%; }
 .payment-cancel-area button { max-width: 100%; white-space: normal; }
}

.payment-cancel-area .check { gap: 8px; margin: 0 0 12px; }
.payment-cancel-area .check input { margin: 0; }

.contract-cancel-button { padding: 10px 16px; border: 1px solid #b42318; color: #b42318; border-radius: 5px; }
.contract-cancel-button:hover { background: #fff1f0; text-decoration: none; }
#deferred-contract .payment-cancel-area h3 { margin: 0 0 8px; }
#deferred-contract .payment-cancel-area form { margin-top: 16px; }


.plan-card-price .badge { font-size: .8rem; vertical-align: middle; }
.reservation-badge { background: #ffedc9; color: #763c00; }
.current-plan-badge { background: #dff5e5; color: #165b2b; }
.payment-cancel-area > summary { cursor: pointer; font-weight: 650; }

/* Owner reservation actions share JPad's primary/secondary hierarchy. */
.payment-status-button { background: #eef4ff; color: #2459c4; border: 1px solid #c4d4f6; border-radius: 10px; font-weight: 650; }
.payment-status-button:hover { background: #e2ecff; }
.reservation-actions { align-items: center; }
.reservation-actions > .button { border-radius: 10px; }
.reservation-actions > .payment-cancel-area { margin: 0; padding: 0; border: 0; }
.reservation-actions > details > summary { color: #b42318; font-weight: 600; }
.reservation-actions > details[open] { flex-basis: 100%; }
.reserved-plan-name { font-size: 1.15rem; }
@media (max-width: 600px) {
 .reservation-actions { flex-direction: row; }
 .reservation-actions > form, .reservation-actions > form > button { width: auto; }
}

.company-history-result > summary { overflow-wrap: anywhere; }
.company-history-result > summary > span {
  display: inline-block;
  margin-inline-start: 12px;
  color: var(--muted);
  font-size: .875rem;
  font-weight: normal;
}
[data-company-records] { margin-top: 14px; }
[data-history-tabs] button[aria-pressed="false"] { background: #eef4ff; color: #2459c4; }
[data-company-records] [hidden] { display: none; }

.operations-dashboard { margin-bottom: 18px; }
.operations-dashboard .metric-value { font-size: 1.55rem; font-weight: 700; overflow-wrap: anywhere; }
