:root {
  --ui-ink: #f4fbff;
  --ui-text: #d7e5ef;
  --ui-muted: #9fb1c0;
  --ui-faint: #708595;
  --ui-panel: rgba(8, 17, 28, 0.62);
  --ui-panel-strong: rgba(10, 22, 35, 0.76);
  --ui-panel-soft: rgba(255, 255, 255, 0.07);
  --ui-line: rgba(185, 239, 255, 0.18);
  --ui-line-hot: rgba(111, 244, 255, 0.46);
  --ui-cyan: #72f6ff;
  --ui-blue: #5d9dff;
  --ui-green: #35d6a2;
  --ui-gold: #ffd27a;
  --ui-red: #ff6b65;
  --ui-radius: 8px;
  --ui-blur: blur(26px) saturate(160%);
  --ui-shadow:
    0 26px 72px rgba(0, 0, 0, 0.4),
    0 10px 28px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06);
  --ui-shadow-soft:
    0 16px 34px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

@keyframes tool-bg-drift {
  0% { background-position: 50% 50%, 0 0, 0 0; }
  50% { background-position: 56% 45%, 28px 18px, -16px 22px; }
  100% { background-position: 50% 50%, 0 0, 0 0; }
}

@keyframes glass-sheen {
  0% { transform: translateX(-120%) skewX(-18deg); opacity: 0; }
  18% { opacity: 0.42; }
  46% { opacity: 0; }
  100% { transform: translateX(140%) skewX(-18deg); opacity: 0; }
}

@keyframes scan-down {
  0% { transform: translateY(-120%); opacity: 0; }
  12% { opacity: 0.7; }
  80% { opacity: 0.32; }
  100% { transform: translateY(140%); opacity: 0; }
}

@keyframes signal-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(114, 246, 255, 0.0), 0 0 22px rgba(114, 246, 255, 0.2); }
  50% { box-shadow: 0 0 0 5px rgba(114, 246, 255, 0.08), 0 0 38px rgba(114, 246, 255, 0.34); }
}

@keyframes float-panel {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes toast-in {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

body.hub-page,
body.ocr-page,
body.recording-page {
  color: var(--ui-text);
  background-color: #06111c;
  background-image:
    linear-gradient(180deg, rgba(3, 8, 13, 0.08), rgba(3, 8, 13, 0.72)),
    url("./assets/apple-glass-bg.png"),
    radial-gradient(circle at 74% 16%, rgba(114, 246, 255, 0.14), transparent 34%);
  background-size: cover, cover, cover;
  background-position: center, center, center;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body.hub-page::before,
body.ocr-page::before,
body.recording-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(114, 246, 255, 0.055) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(114, 246, 255, 0.045) 0 1px, transparent 1px 100%),
    radial-gradient(circle at 16% 10%, rgba(255, 210, 122, 0.12), transparent 30%),
    radial-gradient(circle at 82% 88%, rgba(53, 214, 162, 0.12), transparent 36%);
  background-size: 42px 42px, 42px 42px, 100% 100%, 100% 100%;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.58) 70%, transparent);
}

body.hub-page::after,
body.ocr-page::after,
body.recording-page::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.52), transparent 22%, transparent 78%, rgba(0, 0, 0, 0.42));
  mix-blend-mode: screen;
  opacity: 0.55;
}

.hub-page button,
.ocr-page button,
.recording-page button,
.ocr-page .file-button {
  -webkit-tap-highlight-color: transparent;
}

.hub-page .shell,
.ocr-page .app,
.recording-page .app {
  position: relative;
  z-index: 1;
}

.hub-page .topbar,
.hub-page .workspace,
.ocr-page aside,
.ocr-page .topbar,
.ocr-page .status,
.ocr-page .dropzone,
.ocr-page .panel,
.recording-page .topbar,
.recording-page .rule-nav,
.recording-page .statusbar,
.recording-page .panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.035) 42%, rgba(114, 246, 255, 0.035)),
    var(--ui-panel);
  box-shadow: var(--ui-shadow);
  backdrop-filter: var(--ui-blur);
  -webkit-backdrop-filter: var(--ui-blur);
}

.hub-page .topbar::before,
.hub-page .workspace::before,
.ocr-page aside::before,
.ocr-page .dropzone::before,
.ocr-page .panel::before,
.recording-page .panel::before,
.recording-page .rule-nav::before,
.recording-page .statusbar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.23), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 40%);
  opacity: 0.72;
}

.hub-page .topbar::after,
.ocr-page .panel::after,
.recording-page .panel::after {
  content: "";
  position: absolute;
  top: -40%;
  left: -30%;
  width: 30%;
  height: 180%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  animation: glass-sheen 8.6s ease-in-out infinite;
}

.hub-page .shell {
  gap: 14px;
  padding: 16px;
}

.hub-page .topbar {
  min-height: 78px;
  grid-template-columns: minmax(250px, 1fr) auto minmax(250px, 1fr);
  padding: 12px 16px;
}

.hub-page .topbar > *,
.ocr-page aside > *,
.ocr-page .panel > *,
.recording-page .panel > *,
.recording-page .statusbar > *,
.recording-page .rule-nav > * {
  position: relative;
  z-index: 1;
}

.hub-page .brand {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  column-gap: 12px;
  align-items: center;
}

.hub-page .brand::before,
.ocr-page .brand::before {
  content: "";
  display: block;
  border-radius: var(--ui-radius);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow:
    0 0 34px rgba(114, 246, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  animation: signal-pulse 4.8s ease-in-out infinite;
}

.hub-page .brand::before {
  grid-row: 1 / span 2;
  width: 46px;
  height: 46px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.02)),
    url("./assets/shanji-avatar.jpg");
  background-size: cover;
  background-position: center;
}

.hub-page .brand h1 {
  grid-column: 2;
  color: var(--ui-ink);
  font-size: 22px;
  line-height: 1.16;
  letter-spacing: 0;
  text-shadow: 0 0 24px rgba(114, 246, 255, 0.12);
}

.hub-page .brand p {
  grid-column: 2;
  width: fit-content;
  max-width: 100%;
  margin-top: 6px;
  padding: 4px 10px;
  border: 1px solid rgba(114, 246, 255, 0.2);
  border-radius: var(--ui-radius);
  background: rgba(114, 246, 255, 0.07);
  color: var(--ui-muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.hub-page .tabs {
  gap: 5px;
  padding: 5px;
  border-color: rgba(114, 246, 255, 0.24);
  border-radius: var(--ui-radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035)),
    rgba(4, 12, 22, 0.58);
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
}

.hub-page .tab {
  position: relative;
  min-height: 40px;
  border-radius: 7px;
  color: #aab8c6;
  transition:
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.hub-page .tab:hover {
  color: var(--ui-ink);
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-1px);
}

.hub-page .tab.active,
.hub-page .tab[data-tool="recording"].active {
  color: #03111d;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(114, 246, 255, 0.74)),
    rgba(114, 246, 255, 0.78);
  box-shadow:
    0 0 26px rgba(114, 246, 255, 0.28),
    0 12px 24px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.hub-page .tab.active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 5px;
  height: 2px;
  border-radius: 999px;
  background: rgba(3, 17, 29, 0.34);
}

.hub-page .workspace {
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(3, 9, 16, 0.5);
}

.hub-page .workspace::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.hub-page iframe {
  display: block;
  background: transparent;
}

.ocr-page .app {
  min-height: 100vh;
  grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
}

.ocr-page aside {
  color: var(--ui-text);
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035)),
    rgba(6, 15, 26, 0.66);
  animation: float-panel 7s ease-in-out infinite;
}

.ocr-page .brand {
  padding-bottom: 8px;
}

.ocr-page .brand::before {
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.08)),
    url("./assets/apple-glass-bg.png");
  background-size: 480px 480px;
  background-position: 38% 64%;
}

.ocr-page h1,
.ocr-page .topbar h2,
.ocr-page .panel-head h3,
.recording-page .panel-head h2,
.recording-page .brand h1 {
  color: var(--ui-ink);
  letter-spacing: 0;
  text-shadow: 0 0 26px rgba(114, 246, 255, 0.1);
}

.ocr-page h1 {
  font-size: 29px;
}

.ocr-page .brand p,
.ocr-page .step,
.ocr-page .drop-desc,
.ocr-page .file-name,
.ocr-page .empty,
.recording-page .brand .sub,
.recording-page .muted,
.recording-page .slot-label span,
.recording-page .field label,
.recording-page .field .tiny {
  color: var(--ui-muted);
}

.ocr-page .steps {
  gap: 12px;
}

.ocr-page .step {
  padding: 10px;
  border: 1px solid rgba(114, 246, 255, 0.13);
  border-radius: var(--ui-radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025)),
    rgba(8, 17, 28, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.ocr-page .step b {
  color: #04121d;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(114, 246, 255, 0.76)),
    var(--ui-cyan);
  box-shadow:
    0 0 22px rgba(114, 246, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.ocr-page main {
  min-width: 0;
  min-height: 0;
  padding: 0;
}

.ocr-page .topbar {
  min-height: 60px;
  padding: 12px 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.035)),
    rgba(7, 17, 28, 0.62);
}

.ocr-page .status {
  min-height: 36px;
  color: var(--ui-muted);
  background:
    linear-gradient(90deg, rgba(114, 246, 255, 0.1), rgba(255, 255, 255, 0.035)),
    rgba(5, 14, 24, 0.54);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.ocr-page .status[data-tone="ok"] {
  color: #a8ffe1;
  border-color: rgba(53, 214, 162, 0.32);
  background: rgba(53, 214, 162, 0.12);
}

.ocr-page .status[data-tone="warn"] {
  color: #ffe0a4;
  border-color: rgba(255, 210, 122, 0.32);
  background: rgba(255, 210, 122, 0.12);
}

.ocr-page .status[data-tone="error"] {
  color: #ffc1bd;
  border-color: rgba(255, 107, 101, 0.32);
  background: rgba(255, 107, 101, 0.12);
}

.ocr-page .upload-grid,
.ocr-page .workbench {
  gap: 14px;
}

.ocr-page .dropzone {
  min-height: 152px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.03)),
    rgba(6, 16, 27, 0.58);
  box-shadow: var(--ui-shadow-soft);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.ocr-page .dropzone:hover,
.ocr-page .dropzone.is-dragging {
  transform: translateY(-3px);
  border-color: var(--ui-line-hot);
  background:
    linear-gradient(145deg, rgba(114, 246, 255, 0.16), rgba(255, 255, 255, 0.035)),
    rgba(6, 16, 27, 0.66);
}

.ocr-page .drop-icon {
  border-radius: var(--ui-radius);
  color: var(--ui-cyan);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04)),
    rgba(114, 246, 255, 0.08);
  box-shadow:
    0 0 26px rgba(114, 246, 255, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.ocr-page .drop-title,
.ocr-page label.field-label,
.recording-page .slot-label strong,
.recording-page .drop-title {
  color: var(--ui-ink);
}

.ocr-page .file-button,
.ocr-page .ghost,
.ocr-page .primary,
.recording-page button {
  border-radius: var(--ui-radius);
  border: 1px solid rgba(185, 239, 255, 0.2);
  color: var(--ui-text);
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.ocr-page .file-button,
.ocr-page .ghost,
.recording-page button,
.recording-page button.ghost {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05)),
    rgba(7, 17, 29, 0.58);
}

.ocr-page .file-button:hover,
.ocr-page .ghost:hover,
.recording-page button:hover {
  transform: translateY(-1px);
  border-color: rgba(114, 246, 255, 0.42);
  color: var(--ui-ink);
  box-shadow:
    0 16px 30px rgba(0, 0, 0, 0.25),
    0 0 24px rgba(114, 246, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.ocr-page .primary,
.recording-page button.primary {
  color: #03111d;
  border-color: rgba(114, 246, 255, 0.52);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(114, 246, 255, 0.76)),
    var(--ui-cyan);
  text-shadow: none;
}

.ocr-page .primary:hover,
.recording-page button.primary:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(93, 157, 255, 0.74)),
    var(--ui-blue);
}

.ocr-page .primary:disabled,
.ocr-page .ghost:disabled,
.recording-page button:disabled {
  opacity: 0.44;
  transform: none;
  box-shadow: none;
}

.ocr-page .panel,
.recording-page .panel {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.026)),
    rgba(6, 16, 27, 0.62);
}

.ocr-page .panel-head,
.recording-page .panel-head {
  border-bottom: 1px solid rgba(185, 239, 255, 0.12);
  background:
    linear-gradient(90deg, rgba(114, 246, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(4, 12, 21, 0.28);
}

.ocr-page .panel-body {
  padding: 14px;
}

.ocr-page .preview-box,
.ocr-page textarea,
.ocr-page .options,
.ocr-page .offset-input,
.ocr-page .pill,
.recording-page .trajectory-shell,
.recording-page .slot,
.recording-page .slot-input,
.recording-page .timing-input {
  border-color: rgba(185, 239, 255, 0.16);
  border-radius: var(--ui-radius);
  color: var(--ui-text);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.025)),
    rgba(4, 12, 21, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.ocr-page .preview-box,
.recording-page .trajectory-shell {
  position: relative;
  overflow: hidden;
}

.ocr-page .preview-box::after,
.recording-page .trajectory-shell::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 64px;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(114, 246, 255, 0), rgba(114, 246, 255, 0.18), rgba(114, 246, 255, 0));
  animation: scan-down 5.5s ease-in-out infinite;
}

.ocr-page textarea::placeholder {
  color: #8193a3;
}

.ocr-page textarea,
.ocr-page .offset-input,
.recording-page .slot-input,
.recording-page .timing-input {
  outline: none;
}

.ocr-page textarea:focus,
.ocr-page .offset-input:focus,
.recording-page .slot-input:focus,
.recording-page .timing-input:focus {
  border-color: rgba(114, 246, 255, 0.56);
  box-shadow:
    0 0 0 3px rgba(114, 246, 255, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.ocr-page .check,
.ocr-page .offset-row {
  color: var(--ui-text);
}

.ocr-page .check input {
  accent-color: var(--ui-cyan);
}

.ocr-page th {
  color: var(--ui-ink);
  background:
    linear-gradient(180deg, rgba(114, 246, 255, 0.14), rgba(255, 255, 255, 0.055)),
    rgba(7, 17, 29, 0.82);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

.ocr-page th,
.ocr-page td {
  border-bottom-color: rgba(185, 239, 255, 0.11);
}

.ocr-page .progress {
  background: rgba(114, 246, 255, 0.08);
}

.ocr-page .bar {
  background: linear-gradient(90deg, transparent, var(--ui-cyan), transparent);
  box-shadow: 0 0 18px rgba(114, 246, 255, 0.36);
}

.recording-page .app {
  min-height: 100%;
  gap: 10px;
  padding: 16px;
}

.recording-page .topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  align-items: center;
  padding: 12px 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035)),
    rgba(7, 17, 29, 0.66);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(28px) saturate(170%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
}

.recording-page .toolbar {
  display: grid;
  grid-template-columns: repeat(4, max-content);
  justify-content: end;
  align-items: center;
  gap: 10px;
}

.recording-page .rule-nav {
  justify-content: center;
  gap: 6px;
  padding: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035)),
    rgba(4, 12, 21, 0.62);
}

.recording-page .rule-nav button {
  border: 0;
  min-height: 36px;
  padding: 0 14px;
  color: var(--ui-muted);
  background: transparent;
  box-shadow: none;
}

.recording-page .rule-nav button.active {
  color: #03111d;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(53, 214, 162, 0.76)),
    var(--ui-green);
  box-shadow:
    0 0 24px rgba(53, 214, 162, 0.24),
    0 12px 24px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.recording-page .statusbar {
  background:
    linear-gradient(90deg, rgba(114, 246, 255, 0.09), rgba(255, 255, 255, 0.028)),
    rgba(4, 12, 21, 0.6);
}

.recording-page .layout {
  flex: 1;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 0;
  align-items: stretch;
}

.recording-page .panel-body {
  min-height: 0;
}

.recording-page .slot {
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.recording-page .slot:hover {
  transform: translateY(-2px);
  border-color: rgba(114, 246, 255, 0.28);
}

.recording-page .tag {
  border: 1px solid rgba(185, 239, 255, 0.16);
  border-radius: 999px;
  color: var(--ui-text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)),
    rgba(7, 17, 29, 0.56);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.recording-page .tag.ok {
  color: #a8ffe1;
  border-color: rgba(53, 214, 162, 0.28);
}

.recording-page .tag.warn {
  color: #ffe0a4;
  border-color: rgba(255, 210, 122, 0.28);
}

.recording-page .tag.err {
  color: #ffc1bd;
  border-color: rgba(255, 107, 101, 0.3);
}

.recording-page .warning-box {
  color: #ffe0a4;
  border-color: rgba(255, 210, 122, 0.22);
  border-radius: var(--ui-radius);
  background: rgba(255, 210, 122, 0.1);
}

.recording-page .codebox {
  color: #e8f7ff;
  border-color: rgba(114, 246, 255, 0.16);
  border-radius: var(--ui-radius);
  background:
    linear-gradient(145deg, rgba(2, 8, 15, 0.92), rgba(8, 20, 33, 0.78)),
    rgba(2, 8, 15, 0.86);
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.ocr-page .settings-rail {
  gap: 0;
}

.ocr-page .settings-card,
.ocr-page .panel,
.ocr-page .dropzone,
.recording-page .panel,
.recording-page .rule-nav,
.recording-page .statusbar {
  transition:
    transform 220ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 220ms ease,
    box-shadow 220ms ease,
    background 220ms ease;
}

.ocr-page .settings-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.036)),
    rgba(7, 18, 31, 0.58);
  box-shadow: var(--ui-shadow-soft);
  backdrop-filter: var(--ui-blur);
  -webkit-backdrop-filter: var(--ui-blur);
}

.ocr-page .settings-card:hover,
.ocr-page .panel:hover,
.ocr-page .dropzone:hover,
.recording-page .panel:hover,
.recording-page .rule-nav:hover,
.recording-page .statusbar:hover {
  transform: translateY(-3px);
  border-color: rgba(114, 246, 255, 0.36);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.34),
    0 0 34px rgba(114, 246, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.17);
}

.ocr-page .settings-card-head {
  order: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ocr-page .settings-card h2 {
  margin: 0;
  color: var(--ui-ink);
  font-size: 16px;
  line-height: 1.25;
}

.ocr-page .settings-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(114, 246, 255, 0.2);
  border-radius: 999px;
  color: #b9fbff;
  background: rgba(114, 246, 255, 0.08);
  font-size: 12px;
  white-space: nowrap;
}

.ocr-page .settings-card .options {
  order: 3;
  padding: 0;
  border: 0;
  background: transparent;
}

.ocr-page .settings-card .offset-row {
  align-items: flex-start;
  padding: 12px;
  border: 1px solid rgba(185, 239, 255, 0.12);
  border-radius: var(--ui-radius);
  background: rgba(255, 255, 255, 0.045);
}

.ocr-page .settings-card .offset-input {
  height: 44px;
}

.ocr-page .settings-card .check {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(185, 239, 255, 0.12);
  border-radius: var(--ui-radius);
  background: rgba(255, 255, 255, 0.035);
}

.ocr-page .match-action {
  order: 2;
  width: 100%;
  min-height: 46px;
}

.recording-page .input-panel,
.recording-page .output-panel {
  min-height: 0;
}

.recording-page .input-panel {
  margin: 0;
}

.recording-page .input-panel .panel-body {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.recording-page .slot-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.recording-page .slot {
  padding: 10px;
}

.recording-page .slot-head {
  align-items: center;
  margin-bottom: 8px;
}

.recording-page .slot-label {
  gap: 2px;
}

.recording-page .slot-input {
  min-height: 44px;
  font-size: 15px;
}

.recording-page .input-settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.recording-page .timing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.recording-page .field {
  display: grid;
  grid-template-columns: auto minmax(72px, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 7px 10px;
  border: 1px solid rgba(185, 239, 255, 0.14);
  border-radius: var(--ui-radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.024)),
    rgba(4, 12, 21, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.recording-page .field label,
.recording-page .field .tiny {
  white-space: nowrap;
}

.recording-page .timing-input {
  min-height: 34px;
  padding: 6px 8px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.recording-page .input-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.recording-page .output-panel .panel-body {
  display: flex;
  flex-direction: column;
}

.recording-page .output-box {
  margin-top: 0;
  min-height: 0;
  gap: 10px;
}

.recording-page .output-panel .codebox {
  flex: 1;
  min-height: 520px;
  resize: none;
}

.recording-page .toolbar button {
  min-height: 44px;
  justify-content: center;
  white-space: nowrap;
}

.recording-page .trajectory-dialog {
  width: min(1120px, calc(100vw - 32px));
  max-height: min(760px, calc(100dvh - 32px));
  padding: 0;
  border: 1px solid rgba(185, 239, 255, 0.22);
  border-radius: var(--ui-radius);
  color: var(--ui-text);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.045)),
    rgba(7, 18, 31, 0.74);
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(34px) saturate(180%);
  -webkit-backdrop-filter: blur(34px) saturate(180%);
}

.recording-page .trajectory-dialog::backdrop {
  background: rgba(2, 8, 15, 0.62);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.recording-page .trajectory-modal {
  display: grid;
  grid-template-rows: auto minmax(360px, 1fr);
  max-height: min(760px, calc(100dvh - 32px));
}

.recording-page .trajectory-modal-head {
  border: 0;
  border-bottom: 1px solid rgba(185, 239, 255, 0.14);
  background: rgba(255, 255, 255, 0.055);
}

.recording-page .trajectory-modal-head h2 {
  margin: 0 0 4px;
}

.recording-page .modal-sub {
  margin: 0;
  color: var(--ui-muted);
  font-size: 13px;
  line-height: 1.4;
}

.recording-page .trajectory-dialog .trajectory-shell {
  min-height: 480px;
  margin: 14px;
}

.recording-page .import-dialog {
  width: min(920px, calc(100vw - 32px));
  max-height: min(720px, calc(100dvh - 32px));
  overflow: hidden;
}

.recording-page .import-modal {
  grid-template-rows: auto minmax(0, 1fr);
  max-height: min(720px, calc(100dvh - 32px));
  overflow: hidden;
}

.recording-page .import-body {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 10px;
  padding: 12px 14px;
  min-height: 0;
  overflow: hidden;
}

.recording-page .import-controls,
.recording-page .import-footer {
  position: relative;
  z-index: 4;
  padding: 8px 12px;
  border: 1px solid rgba(185, 239, 255, 0.14);
  border-radius: var(--ui-radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.036)),
    rgba(4, 12, 21, 0.68);
  box-shadow:
    0 -12px 32px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

.recording-page .import-footer .head-actions {
  position: relative;
  z-index: 5;
  flex-wrap: wrap;
}

.recording-page .import-footer button {
  position: relative;
  z-index: 6;
}

.recording-page .import-message {
  min-width: min(100%, 280px);
}

.recording-page .save-password {
  display: grid;
  grid-template-columns: auto minmax(86px, 118px);
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 4px 8px 4px 10px;
  border: 1px solid rgba(185, 239, 255, 0.14);
  border-radius: var(--ui-radius);
  color: var(--ui-muted);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025)),
    rgba(4, 12, 21, 0.46);
}

.recording-page .save-password span {
  font-size: 13px;
  white-space: nowrap;
}

.recording-page .save-password input {
  width: 100%;
  min-height: 32px;
  border: 1px solid rgba(185, 239, 255, 0.14);
  border-radius: calc(var(--ui-radius) - 3px);
  padding: 0 9px;
  color: var(--ui-text);
  background: rgba(3, 10, 18, 0.46);
  outline: none;
}

.recording-page .save-password input:focus {
  border-color: rgba(114, 246, 255, 0.58);
  box-shadow: 0 0 0 3px rgba(114, 246, 255, 0.12);
}

.recording-page .cloud-saving-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(2, 8, 15, 0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.recording-page .cloud-saving-overlay[hidden] {
  display: none;
}

.recording-page .saving-card {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 18px;
  border: 1px solid rgba(185, 239, 255, 0.2);
  border-radius: var(--ui-radius);
  color: var(--ui-text);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.04)),
    rgba(7, 18, 31, 0.78);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.recording-page .saving-spinner {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid rgba(185, 239, 255, 0.2);
  border-top-color: var(--ui-cyan);
  animation: spin 0.82s linear infinite;
}

.recording-page .toast-host {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 220;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.recording-page .toast {
  border: 1px solid rgba(185, 239, 255, 0.18);
  border-radius: var(--ui-radius);
  padding: 12px 14px;
  color: var(--ui-text);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.036)),
    rgba(4, 12, 21, 0.82);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  transform: translateY(8px);
  opacity: 0;
  animation: toast-in 180ms ease forwards;
}

.recording-page .toast.success {
  border-color: rgba(53, 214, 162, 0.36);
}

.recording-page .toast.error {
  border-color: rgba(255, 116, 104, 0.42);
}

.ocr-page .toast-host {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 220;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.ocr-page .toast {
  border: 1px solid rgba(185, 239, 255, 0.18);
  border-radius: var(--ui-radius);
  padding: 12px 14px;
  color: var(--ui-text);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.036)),
    rgba(4, 12, 21, 0.82);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  transform: translateY(8px);
  opacity: 0;
  animation: toast-in 180ms ease forwards;
}

.ocr-page .toast.success {
  border-color: rgba(53, 214, 162, 0.36);
}

.ocr-page .toast.warn {
  border-color: rgba(255, 191, 91, 0.42);
}

.ocr-page .toast.error {
  border-color: rgba(255, 116, 104, 0.42);
}

.recording-page .import-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.recording-page .import-target {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr);
  align-items: center;
  gap: 10px;
  min-width: min(100%, 320px);
}

.recording-page .import-target select {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(185, 239, 255, 0.18);
  border-radius: var(--ui-radius);
  color: var(--ui-text);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.032)),
    rgba(4, 12, 21, 0.56);
  outline: none;
}

.recording-page .import-meta,
.recording-page .import-message {
  margin: 0;
  color: var(--ui-muted);
  font-size: 13px;
  line-height: 1.45;
}

.recording-page .import-message.error {
  color: #ffc1bd;
}

.recording-page .trajectory-dialog .import-preview-shell {
  z-index: 1;
  justify-self: center;
  align-self: center;
  width: min(100%, 440px);
  aspect-ratio: 16 / 9;
  min-height: 0;
  height: auto;
  max-height: none;
  margin: 0;
  pointer-events: none;
  overscroll-behavior: contain;
  touch-action: none;
}

.recording-page .import-preview-shell .trajectory-host,
.recording-page .import-preview-shell svg {
  width: 100%;
  height: 100%;
}

.recording-page .import-preview-shell svg {
  border-radius: inherit;
}

.recording-page .app.embedded .topbar .toolbar {
  width: 100%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.recording-page .app.embedded .topbar .toolbar button {
  min-width: 0;
  width: 100%;
  padding-inline: 8px;
  gap: 6px;
}

.recording-page .app.embedded .topbar {
  justify-content: flex-end;
  border: 1px solid rgba(185, 239, 255, 0.16);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.042)),
    rgba(7, 17, 29, 0.72);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(28px) saturate(170%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  padding: 10px;
}

.recording-page .app.embedded .layout {
  padding-top: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 980px) {
  .hub-page {
    overflow: auto;
  }

  .hub-page .shell,
  .ocr-page .app,
  .recording-page .app {
    padding: 12px;
  }

  .ocr-page .app,
  .recording-page .layout {
    grid-template-columns: 1fr;
  }

  .recording-page .slot-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ocr-page aside {
    animation: none;
  }
}

@media (max-width: 720px) {
  .hub-page .topbar {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .hub-page .brand {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .hub-page .brand::before {
    width: 42px;
    height: 42px;
  }

  .hub-page .tabs {
    justify-self: stretch;
    width: 100%;
  }

  .hub-page .tab {
    flex: 1;
    min-width: 0;
    padding: 0 10px;
  }

  .ocr-page .topbar,
  .recording-page .topbar {
    align-items: stretch;
  }

  .ocr-page .status {
    max-width: none;
  }

  .recording-page .toolbar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-content: stretch;
    gap: 8px;
  }

  .recording-page .toolbar button {
    min-width: 0;
    padding-inline: 8px;
    gap: 6px;
  }

  .recording-page .slot-list,
  .recording-page .timing-grid,
  .recording-page .input-settings-row {
    grid-template-columns: 1fr;
  }

  .recording-page .field {
    grid-template-columns: auto minmax(88px, 1fr) auto;
  }
}

/* Apple dock-inspired glass refinement */
:root {
  --ui-ink: #f7fbfc;
  --ui-text: #e5edef;
  --ui-muted: #b3c0c3;
  --ui-faint: #849397;
  --ui-panel: rgba(18, 27, 30, 0.34);
  --ui-panel-strong: rgba(18, 26, 30, 0.52);
  --ui-panel-soft: rgba(255, 255, 255, 0.09);
  --ui-line: rgba(255, 255, 255, 0.24);
  --ui-line-hot: rgba(209, 251, 255, 0.48);
  --ui-cyan: #a8f5f6;
  --ui-blue: #8bbcf7;
  --ui-green: #78dfb8;
  --ui-blur: blur(30px) saturate(145%);
  --ui-shadow:
    0 24px 64px rgba(0, 0, 0, 0.26),
    0 8px 24px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    inset 0 -1px 0 rgba(255, 255, 255, 0.055);
  --ui-shadow-soft:
    0 16px 38px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04);
  --dock-glass:
    linear-gradient(180deg, rgba(255, 255, 255, 0.19), rgba(255, 255, 255, 0.065) 42%, rgba(255, 255, 255, 0.025)),
    rgba(24, 32, 34, 0.3);
  --control-glass:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.075) 46%, rgba(255, 255, 255, 0.035)),
    rgba(25, 33, 36, 0.34);
}

body.hub-page,
body.ocr-page,
body.recording-page {
  background-color: #0a1314;
  background-image:
    linear-gradient(180deg, rgba(5, 12, 13, 0.04), rgba(4, 10, 12, 0.5)),
    url("./assets/apple-glass-bg.png");
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat;
}

body.hub-page::before,
body.ocr-page::before,
body.recording-page::before {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.28), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.3)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 24%, transparent 76%, rgba(0, 0, 0, 0.18));
  background-size: cover;
  mask-image: none;
  opacity: 1;
}

body.hub-page::after,
body.ocr-page::after,
body.recording-page::after {
  background: linear-gradient(132deg, rgba(255, 255, 255, 0.045), transparent 28%, transparent 72%, rgba(207, 255, 235, 0.035));
  mix-blend-mode: normal;
  opacity: 1;
}

.hub-page .topbar,
.hub-page .workspace,
.ocr-page aside,
.ocr-page .topbar,
.ocr-page .status,
.ocr-page .dropzone,
.ocr-page .panel,
.ocr-page .settings-card,
.recording-page .topbar,
.recording-page .rule-nav,
.recording-page .statusbar,
.recording-page .panel,
.recording-page .trajectory-dialog,
.recording-page .import-controls,
.recording-page .import-footer {
  border-color: var(--ui-line);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.045) 44%, rgba(255, 255, 255, 0.018)),
    var(--ui-panel);
  box-shadow: var(--ui-shadow);
  backdrop-filter: var(--ui-blur);
  -webkit-backdrop-filter: var(--ui-blur);
}

.hub-page .topbar::before,
.hub-page .workspace::before,
.ocr-page aside::before,
.ocr-page .dropzone::before,
.ocr-page .panel::before,
.recording-page .panel::before,
.recording-page .rule-nav::before,
.recording-page .statusbar::before {
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.2), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 34%);
  opacity: 0.54;
}

.hub-page .topbar::after,
.ocr-page .panel::after,
.recording-page .panel::after,
.ocr-page .preview-box::after,
.recording-page .trajectory-shell::after {
  display: none;
  animation: none;
}

.hub-page .topbar {
  background: var(--dock-glass);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow:
    0 22px 54px rgba(0, 0, 0, 0.24),
    0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    inset 0 -1px 0 rgba(255, 255, 255, 0.055);
}

.hub-page .brand p {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: var(--ui-muted);
}

.hub-page .tabs {
  gap: 4px;
  padding: 6px;
  border-color: rgba(255, 255, 255, 0.25);
  border-radius: 16px;
  background: var(--dock-glass);
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(34px) saturate(150%);
  -webkit-backdrop-filter: blur(34px) saturate(150%);
}

.hub-page .tab {
  min-height: 42px;
  padding-inline: 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: rgba(235, 242, 244, 0.72);
  font-size: 14px;
  font-weight: 650;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
  transition:
    transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1),
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.hub-page .tab:hover {
  transform: translateY(-2px) scale(1.015);
  color: var(--ui-ink);
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.105);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.hub-page .tab.active,
.hub-page .tab[data-tool="recording"].active {
  color: #f8ffff;
  border-color: rgba(224, 255, 255, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.09)),
    rgba(78, 180, 188, 0.24);
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
}

.hub-page .tab.active::after {
  left: 50%;
  right: auto;
  bottom: 4px;
  width: 4px;
  height: 4px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #d9ffff;
  box-shadow: 0 0 8px rgba(189, 255, 255, 0.92);
}

.hub-page .tab:active,
.ocr-page .file-button:active,
.ocr-page .ghost:active,
.ocr-page .primary:active,
.recording-page button:active {
  transform: translateY(1px) scale(0.975);
}

.hub-page .workspace {
  background: rgba(10, 17, 19, 0.18);
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.ocr-page aside,
.ocr-page .topbar,
.recording-page .topbar,
.recording-page .app.embedded .topbar {
  background: var(--dock-glass);
}

.ocr-page aside {
  animation: none;
}

.ocr-page .settings-card,
.ocr-page .dropzone,
.ocr-page .panel,
.recording-page .panel,
.recording-page .rule-nav,
.recording-page .statusbar {
  box-shadow: var(--ui-shadow-soft);
}

.ocr-page .settings-card:hover,
.ocr-page .panel:hover,
.ocr-page .dropzone:hover,
.recording-page .panel:hover,
.recording-page .rule-nav:hover,
.recording-page .statusbar:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow:
    0 22px 52px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -1px 0 rgba(255, 255, 255, 0.045);
}

.ocr-page .status,
.recording-page .statusbar,
.ocr-page .panel-head,
.recording-page .panel-head {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.03)),
    rgba(22, 30, 32, 0.23);
}

.ocr-page .settings-card .offset-row,
.ocr-page .settings-card .check,
.ocr-page .preview-box,
.ocr-page textarea,
.ocr-page .offset-input,
.recording-page .slot,
.recording-page .slot-input,
.recording-page .field,
.recording-page .timing-input,
.recording-page .save-password,
.recording-page .save-password input,
.recording-page .import-target select {
  border-color: rgba(255, 255, 255, 0.17);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.035)),
    rgba(19, 27, 30, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.13),
    inset 0 -1px 0 rgba(255, 255, 255, 0.025);
}

.ocr-page .file-button,
.ocr-page .ghost,
.ocr-page .primary,
.recording-page button {
  position: relative;
  overflow: hidden;
  border-color: rgba(255, 255, 255, 0.24);
  border-radius: 11px;
  color: var(--ui-text);
  background: var(--control-glass);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -1px 0 rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  transition:
    transform 170ms cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 170ms ease,
    color 170ms ease,
    background 170ms ease,
    box-shadow 170ms ease;
}

.ocr-page .file-button:hover,
.ocr-page .ghost:hover,
.ocr-page .primary:hover,
.recording-page button:hover {
  transform: translateY(-2px) scale(1.012);
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--ui-ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.085)),
    rgba(38, 48, 50, 0.36);
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    inset 0 -1px 0 rgba(255, 255, 255, 0.055);
}

.ocr-page .primary,
.recording-page button.primary,
.recording-page .rule-nav button.active {
  color: #f5ffff;
  border-color: rgba(205, 255, 255, 0.38);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.09)),
    rgba(61, 173, 181, 0.32);
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    inset 0 -1px 0 rgba(255, 255, 255, 0.055);
}

.ocr-page .primary:hover,
.recording-page button.primary:hover,
.recording-page .rule-nav button.active:hover {
  color: #ffffff;
  border-color: rgba(218, 255, 255, 0.52);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.11)),
    rgba(68, 185, 191, 0.38);
}

.recording-page .rule-nav {
  border-radius: 14px;
  padding: 6px;
  background: var(--dock-glass);
}

.recording-page .rule-nav button {
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.recording-page .rule-nav button:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.ocr-page .primary:disabled,
.ocr-page .ghost:disabled,
.recording-page button:disabled {
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(225, 235, 237, 0.42);
  background: rgba(255, 255, 255, 0.045);
  opacity: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.hub-page .tab:focus-visible,
.ocr-page button:focus-visible,
.ocr-page .file-button:focus-within,
.recording-page button:focus-visible,
.ocr-page textarea:focus,
.ocr-page .offset-input:focus,
.recording-page .slot-input:focus,
.recording-page .timing-input:focus,
.recording-page .save-password input:focus,
.recording-page .import-target select:focus {
  outline: none;
  border-color: rgba(202, 255, 255, 0.64);
  box-shadow:
    0 0 0 3px rgba(165, 240, 241, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .hub-page .topbar,
  .hub-page .tabs,
  .hub-page .workspace,
  .ocr-page aside,
  .ocr-page .topbar,
  .ocr-page .status,
  .ocr-page .dropzone,
  .ocr-page .panel,
  .ocr-page .settings-card,
  .recording-page .topbar,
  .recording-page .rule-nav,
  .recording-page .statusbar,
  .recording-page .panel,
  .recording-page .trajectory-dialog {
    background-color: rgba(17, 26, 29, 0.9);
  }
}

@media (max-width: 720px) {
  .hub-page .tabs {
    border-radius: 14px;
  }

  .hub-page .tab {
    min-height: 44px;
    padding-inline: 10px;
    font-size: 13px;
  }

  .recording-page .rule-nav {
    border-radius: 12px;
  }
}
