/* The card checker, order status and invoice share the portal's paper and ink. */
body .workspace-shell, body .workspace-shell[data-service], body .account-placeholder,
body .app-window, body .lookup-layout .window {
  --ink:var(--portal-ink); --muted:var(--subtle); --panel:var(--panel-paper); --panel-solid:var(--panel-paper);
  --small-shadow:none;--blue:var(--accent);--blue-deep:var(--accent);
  background:var(--paper);color:var(--portal-ink);font-family:var(--sans)
}
:root {--portal-ink:#222f44}
:root[data-theme="dark"] {--portal-ink:#f4eddf}
body .workspace-shell .main,body .app-window .main {background:var(--paper);color:var(--portal-ink)}
body .window-titlebar,body .account-placeholder,body .lookup-layout .window,
body .code-entry :is(.panel,.status-card),body:not(.lookup-mode) .code-entry :is(#redeem-panel,#result-panel) {
  background:var(--panel-paper);border:1px solid var(--line);border-radius:7px;box-shadow:none
}
body .main .service-icon,body:not(.lookup-mode) .code-entry :is(.service-icon,.hero-mark),body .workspace-shell[data-service] .service-icon {
  background:var(--wash);border:1px solid var(--line);color:var(--accent);border-radius:50%;box-shadow:none
}
body .main.code-entry .hero h1,body:not(.lookup-mode) .code-entry .hero h1,body .intro h1,body .account-placeholder h1 {font-family:var(--serif);color:var(--portal-ink);letter-spacing:.005em}
body .main.code-entry .hero p,body:not(.lookup-mode) .code-entry .hero p,body .code-entry :is(.panel-subtitle,.field-label span,.form-note,.footer-note,.footer-note a),
body:not(.lookup-mode) .code-entry #redeem-panel .panel-subtitle,body .lookup-layout .toolbar h2 {color:var(--subtle)}
body .code-entry :is(.panel-header,.code-help,.status-icon,.empty-icon),body .lookup-layout :is(.toolbar,#cardInfo) {
  border-color:var(--line);background:var(--wash);color:var(--portal-ink);box-shadow:none
}
body .code-entry :is(.panel-title,.field-label,.status-card-value,.code-help summary,.result-heading h3),
body:not(.lookup-mode) .code-entry #redeem-panel .panel-title,body .code-entry .task-empty h3 {color:var(--portal-ink)}
body .code-entry :is(.code-help p,.inline-guide-steps,.task-empty p,.task-empty li),
body .lookup-layout :is(#progressSteps li,#failureCode){color:var(--subtle)}
body .code-entry a,body .lookup-layout a,body .account-placeholder > p a {color:var(--accent)}
body .code-entry .input-shell,body:not(.lookup-mode) .code-entry .input-shell:has(#cardKey),body .lookup-layout input {
  border-color:var(--line);background:var(--paper);color:var(--portal-ink);box-shadow:none;border-radius:5px
}
body .code-entry .input-shell:focus-within,body:not(.lookup-mode) .code-entry .input-shell:has(#cardKey:focus),body .lookup-layout input:focus {
  border-color:var(--accent);outline:2px solid var(--ring);outline-offset:2px
}
body .code-entry .input-shell input {color:var(--portal-ink)}
body .code-entry .input-shell input::placeholder,body .lookup-layout input::placeholder {color:var(--subtle)}
body .code-entry :is(.panel-action,.input-action),body .lookup-layout .invoice-buttons button {background:var(--wash);border-color:var(--line);color:var(--portal-ink);border-radius:4px;box-shadow:none}
body .code-entry .primary-btn,body:not(.lookup-mode) .code-entry #submitButton,
body .workspace-shell.lookup-mode #lookupReceipt,body .lookup-layout :is(#lookupReceipt,.invoice-buttons a) {
  color:var(--button-ink);background:var(--button);border-color:var(--button);border-radius:5px;box-shadow:none
}
body:not(.lookup-mode) .code-entry #submitButton:not(:disabled):hover,body .workspace-shell.lookup-mode #lookupReceipt:hover {background:var(--button);filter:brightness(1.09)}
body:not(.lookup-mode) .code-entry #submitButton:disabled,body .code-entry .primary-btn:disabled {color:var(--subtle);background:var(--wash);border-color:var(--line)}
body:not(.lookup-mode) .code-entry #lookupReceipt {color:var(--accent);background:none}
body .code-entry .task-empty {border-color:var(--line);background:var(--panel-paper)}
body .lookup-layout #progressSteps [data-state="current"],body .code-entry #progressSteps [data-state="current"] {color:var(--accent)}
body .lookup-layout :is(#resultAccount,#resultAccountEmail),body .code-entry :is(#resultAccount,#resultAccountEmail) {color:var(--success);background:var(--panel-paper);border-color:var(--line)}
body .code-entry .form-message.show,body .lookup-layout #failure h4 {color:var(--error)}
body .code-entry .form-message.success {color:var(--success)}
body .lookup-layout #resultDetail,body .lookup-layout .hint {color:var(--subtle)}
body .lookup-layout .toolbar {min-height:44px}body .lookup-layout .toolbar h2 {font:600 16px/1.4 var(--serif);text-align:left}
body .lookup-layout .lights,body .traffic-lights,body > .wallpaper {display:none}
body .app-window {border:0;box-shadow:none;backdrop-filter:none}
body .app-window .window-titlebar {border-radius:0;justify-content:space-between;flex-wrap:wrap;padding:8px 20px}
body .app-window .window-title {color:var(--portal-ink);font-family:var(--serif)}
body .app-window .sidebar {background:var(--paper);border-color:var(--line)}
body .app-window .nav-item {color:var(--subtle)}
body .app-window .nav-item.active {background:var(--wash);color:var(--portal-ink);box-shadow:none}
body .account-placeholder.service-placeholder a {color:var(--button-ink);background:var(--button)}
body .lookup-layout,body .code-entry {overflow-wrap:anywhere}
@media (max-width:560px) {body .workspace-shell .footer-note {flex-wrap:wrap}body .code-entry .panel-header {flex-wrap:wrap}}

/* Keep the ink landscape visible after entering a service. */
body .workspace-shell, body .app-window .main, body:has(.lookup-layout),body:has(.subscription-sheet) {
  position:relative;isolation:isolate
}
body .workspace-shell::before,body .app-window .main::before,body:has(.lookup-layout)::before,body:has(.subscription-sheet)::before {
  content:"";position:absolute;z-index:-1;pointer-events:none;inset:0 0 auto;height:clamp(235px,28vw,400px);
  background:url("./lakeside-etching.webp") center top / 100% 100% no-repeat;mix-blend-mode:multiply;opacity:.57;
  mask-image:linear-gradient(#000 60%,transparent)
}
body:has(.lookup-layout)::before,body:has(.subscription-sheet)::before {top:70px}
body .workspace-shell .main,body .app-window .main {background:transparent}
:root[data-theme="dark"] :is(.workspace-shell,.app-window .main,body:has(.lookup-layout),body:has(.subscription-sheet))::before {
  filter:grayscale(1) invert(1) sepia(.55);mix-blend-mode:screen;opacity:.5
}
@media(max-width:600px){
  body .workspace-shell::before,body .app-window .main::before,body:has(.lookup-layout)::before,body:has(.subscription-sheet)::before {height:180px;background-size:auto 100%;background-position:60% top;opacity:.42}
}
body:not(.lookup-mode) .code-entry .redeem-note {color:var(--subtle)}
html:lang(ru) .code-entry :is(h1,h2,h3),html:lang(ru) .intro h1 {letter-spacing:normal;text-align:start}

/* Legacy navigation and receipt entry share the portal's readable ink. */
body .app-window .sidebar-label {color:var(--subtle)}
body .app-window #receiptPanel summary {color:var(--accent)}
:root[data-theme="dark"] body .app-window .workspace-name {color:#24354d}

/* Keep order-code and receipt fields distinct from nearby panels in both themes. */
:root:not([data-theme="dark"]) body .code-entry .input-shell:has(:is(#cardKey,#receiptNumber,#billName)),
:root:not([data-theme="dark"]) body .lookup-layout #cardKey {border-color:#8c7e69}
:root[data-theme="dark"] body .code-entry .input-shell:has(:is(#cardKey,#receiptNumber,#billName)),
:root[data-theme="dark"] body .lookup-layout #cardKey {border-color:#6b7f96}
:root body .code-entry .input-shell:has(:is(#cardKey,#receiptNumber,#billName)):focus-within,
:root body .lookup-layout #cardKey:focus {border-color:var(--accent)}
