:root {
  color-scheme: dark;
  --bg: #05070a;
  --bg-soft: #0b1014;
  --surface: rgba(14, 19, 24, 0.88);
  --surface-strong: rgba(20, 27, 33, 0.96);
  --surface-soft: rgba(255, 255, 255, 0.06);
  --ink: #f2fbf8;
  --muted: #a1b4b2;
  --faint: #718584;
  --line: rgba(165, 188, 185, 0.16);
  --line-strong: rgba(165, 188, 185, 0.34);
  --primary: #53ead0;
  --primary-strong: #b2fff0;
  --primary-soft: rgba(83, 234, 208, 0.14);
  --accent: #ff946f;
  --accent-soft: rgba(255, 148, 111, 0.14);
  --violet: #aeb5ff;
  --violet-soft: rgba(174, 181, 255, 0.13);
  --gold: #f7c96d;
  --gold-soft: rgba(247, 201, 109, 0.14);
  --danger: #ff7088;
  --danger-soft: rgba(255, 112, 136, 0.14);
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.56);
  --lift: 0 16px 48px rgba(0, 0, 0, 0.32);
  --glow: 0 0 0 1px rgba(83, 234, 208, 0.18), 0 16px 56px rgba(83, 234, 208, 0.12);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

input,
textarea,
select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

textarea {
  resize: vertical;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
}

.long-text,
.url-text,
.site-url,
.card,
.site-card,
.clue-card,
.modal,
.site-dialog,
.form-row,
.field-grid,
.integration-card,
.admin-tool-card,
.ai-preview-card {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--bg);
}

* {
  scrollbar-color: rgba(83, 234, 208, 0.38) rgba(255, 255, 255, 0.04);
  scrollbar-width: thin;
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.015) 0 1px, transparent 1px 68px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 68px),
    linear-gradient(126deg, rgba(83, 234, 208, 0.13), transparent 28%),
    linear-gradient(304deg, rgba(255, 148, 111, 0.1), transparent 32%),
    linear-gradient(238deg, rgba(174, 181, 255, 0.08), transparent 36%),
    linear-gradient(180deg, #10161a 0%, #070a0e 54%, #040507 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 24%),
    linear-gradient(90deg, transparent, rgba(83, 234, 208, 0.05), transparent),
    radial-gradient(ellipse at 50% -12%, rgba(255, 255, 255, 0.12), transparent 48%);
  content: "";
}

::selection {
  color: #04100e;
  background: var(--primary-strong);
}

button,
input,
select,
textarea {
  font: inherit;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

input,
select,
textarea,
pre,
code,
.view-panel,
.hub-card,
.home-panel,
.site-card,
.clue-card {
  max-width: 100%;
  overflow-wrap: anywhere;
}

input,
textarea {
  width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}

pre,
code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

pre {
  overflow-x: auto;
  white-space: pre-wrap;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.app-header::before,
.site-card::before {
  position: absolute;
  inset: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(178, 255, 240, 0.78), transparent);
  content: "";
}

.brand-row,
.title-group,
.header-actions,
.toolbar,
.password-row,
.dialog-header,
.dialog-actions,
.right-actions,
.section-heading,
.credential-editor-header,
.credential-preview,
.credential-preview-actions {
  display: flex;
  align-items: center;
}

.brand-row,
.title-group {
  gap: 14px;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(83, 234, 208, 0.46);
  border-radius: 8px;
  color: #06110f;
  background:
    linear-gradient(135deg, var(--primary-strong), var(--primary) 52%, #74b8ff),
    var(--primary);
  box-shadow: 0 14px 38px rgba(83, 234, 208, 0.24);
  font-weight: 900;
}

.brand-mark.compact {
  width: 40px;
  height: 40px;
}

.brand-mark.warm,
.tool-icon.warm {
  border-color: rgba(255, 148, 111, 0.44);
  background:
    linear-gradient(135deg, #ffe0b8, var(--accent) 58%, #ff6f92),
    var(--accent);
  box-shadow: 0 14px 38px rgba(255, 148, 111, 0.2);
}

.brand-mark.cool,
.tool-icon.cool {
  border-color: rgba(174, 181, 255, 0.45);
  background:
    linear-gradient(135deg, #e6dcff, var(--violet) 44%, var(--primary) 100%),
    var(--violet);
  box-shadow: 0 14px 38px rgba(174, 181, 255, 0.2);
}

.brand-mark.mint,
.tool-icon.mint {
  border-color: rgba(96, 255, 181, 0.42);
  background:
    linear-gradient(135deg, #d8fff1, #68ffc7 44%, #55a7ff 100%),
    var(--primary);
  box-shadow: 0 14px 38px rgba(96, 255, 181, 0.18);
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.2;
}

h2 {
  font-size: 20px;
  line-height: 1.3;
}

h3 {
  font-size: 16px;
  line-height: 1.35;
}

h4 {
  font-size: 14px;
  line-height: 1.35;
}

p,
.metric-label {
  color: var(--muted);
}

label {
  display: grid;
  min-width: 0;
  gap: 8px;
  color: #d6e6e3;
  font-size: 14px;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: rgba(4, 8, 11, 0.58);
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

select {
  color: var(--ink);
}

option {
  color: var(--ink);
  background: #11181c;
}

textarea {
  resize: vertical;
  padding: 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(83, 234, 208, 0.72);
  background: rgba(4, 8, 11, 0.82);
  box-shadow: 0 0 0 3px rgba(83, 234, 208, 0.15);
}

.password-row {
  gap: 8px;
}

.password-row input {
  flex: 1;
}

.credential-secret-hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.private-note-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.private-note-row textarea {
  flex: 1;
}

.private-note-row .icon-button {
  align-self: flex-start;
}

.primary-button,
.secondary-button,
.danger-button,
.icon-text-button,
.ghost-button,
.icon-button,
.mini-icon-button {
  min-height: 40px;
  border-radius: 7px;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  color: #06110f;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.48), transparent 34%),
    linear-gradient(135deg, var(--primary-strong), var(--primary));
  box-shadow: 0 14px 38px rgba(83, 234, 208, 0.22);
  font-weight: 900;
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 46px rgba(83, 234, 208, 0.32);
}

.secondary-button,
.icon-text-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.04));
  font-weight: 780;
}

.compact-button {
  min-width: 64px;
  padding: 0 12px;
}

.secondary-button:hover,
.icon-text-button:hover,
.ghost-button:hover,
.icon-button:hover,
.mini-icon-button:hover {
  border-color: rgba(83, 234, 208, 0.44);
  background: rgba(83, 234, 208, 0.1);
  transform: translateY(-1px);
}

.ghost-button {
  color: var(--primary-strong);
  background: rgba(83, 234, 208, 0.08);
  box-shadow: inset 0 0 0 1px rgba(83, 234, 208, 0.22);
}

.danger-button {
  padding: 0 14px;
  color: #ffdbe1;
  background: var(--danger-soft);
  box-shadow: inset 0 0 0 1px rgba(255, 111, 134, 0.32);
  font-weight: 850;
}

.danger-button:hover {
  background: rgba(255, 111, 134, 0.22);
}

.icon-button,
.mini-icon-button {
  display: inline-grid;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.04));
}

.icon-button {
  width: 42px;
  min-width: 42px;
}

.mini-icon-button {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
}

.mini-icon-button svg {
  width: 16px;
  height: 16px;
}

.copy-account-button {
  color: #78e2ff;
  border-color: rgba(120, 226, 255, 0.28);
  background: rgba(120, 226, 255, 0.08);
}

.copy-password-button {
  color: #ffd36a;
  border-color: rgba(255, 211, 106, 0.3);
  background: rgba(255, 211, 106, 0.09);
}

.copy-account-button:hover {
  color: #c6f4ff;
  border-color: rgba(120, 226, 255, 0.52);
  background: rgba(120, 226, 255, 0.14);
}

.copy-password-button:hover {
  color: #ffe6a8;
  border-color: rgba(255, 211, 106, 0.56);
  background: rgba(255, 211, 106, 0.15);
}

.copy-account-button:disabled,
.copy-password-button:disabled {
  color: var(--muted);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.password-unlock-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 11, 18, 0.72);
  backdrop-filter: blur(14px);
}

.password-unlock-dialog {
  width: min(420px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  padding: 0;
  overflow: visible;
  border: 0;
  color: var(--ink);
  background: transparent;
}

.password-unlock-dialog::backdrop {
  background:
    radial-gradient(circle at 50% 30%, rgba(83, 234, 208, 0.18), transparent 34%),
    rgba(5, 11, 18, 0.76);
  backdrop-filter: blur(14px);
}

.password-unlock-dialog.fallback-open {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  width: auto;
  max-width: none;
  height: auto;
  max-height: none;
  place-items: center;
  padding: 20px;
  background: rgba(5, 11, 18, 0.76);
  backdrop-filter: blur(14px);
}

.password-unlock-panel {
  width: 100%;
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 20px;
  border: 1px solid rgba(151, 173, 171, 0.22);
  border-radius: 10px;
  background:
    linear-gradient(150deg, rgba(83, 234, 208, 0.1), transparent 46%),
    var(--panel-strong);
  box-shadow: var(--shadow);
}

.password-unlock-panel h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.password-unlock-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.password-unlock-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.download-ready-panel {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: min(520px, calc(100vw - 28px));
  padding: 14px;
  border: 1px solid rgba(83, 234, 208, 0.28);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(83, 234, 208, 0.14), transparent 48%),
    rgba(10, 19, 27, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.download-ready-panel > div:first-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.download-ready-panel strong {
  color: var(--ink);
  font-size: 14px;
}

.download-ready-panel span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download-ready-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
}

.auth-panel {
  display: grid;
  width: min(100%, 440px);
  gap: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(83, 234, 208, 0.13), transparent 46%),
    linear-gradient(315deg, rgba(255, 148, 111, 0.08), transparent 42%),
    rgba(12, 17, 21, 0.92);
  box-shadow: var(--lift);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-brand h1 {
  margin: 0;
  color: #f8fffc;
  font-size: 24px;
}

.auth-brand p,
.auth-hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.library-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  min-height: 100vh;
  padding: 28px;
}

.library-sidebar {
  position: sticky;
  top: 28px;
  display: grid;
  align-self: start;
  gap: 16px;
  min-height: calc(100vh - 56px);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(83, 234, 208, 0.11), transparent 46%),
    linear-gradient(315deg, rgba(174, 181, 255, 0.08), transparent 46%),
    rgba(8, 12, 15, 0.76);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.library-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.library-brand h1 {
  font-size: 20px;
}

.library-brand p,
.sidebar-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.library-nav,
.sidebar-section {
  display: grid;
  gap: 8px;
}

.library-nav-button,
.future-tool-button {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border: 1px solid rgba(165, 188, 185, 0.14);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 850;
  text-align: left;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease,
    color 160ms ease;
}

.library-nav-button strong,
.future-tool-button strong {
  color: var(--muted);
  font-size: 12px;
}

.library-nav-button:hover,
.library-nav-button.active {
  border-color: rgba(83, 234, 208, 0.38);
  color: var(--primary-strong);
  background: rgba(83, 234, 208, 0.11);
  transform: translateY(-1px);
}

.future-tool-button {
  color: var(--muted);
  cursor: default;
  opacity: 0.78;
}

#logoutButton {
  color: #ffdbe1;
  cursor: pointer;
  opacity: 1;
}

#logoutButton:hover {
  border-color: rgba(255, 111, 134, 0.32);
  background: rgba(255, 111, 134, 0.1);
  transform: translateY(-1px);
}

.library-main {
  min-width: 0;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

.home-command-panel,
.home-metrics-grid,
.home-workbench-grid {
  max-width: 1280px;
  margin: 0 auto 18px;
}

.home-command-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(83, 234, 208, 0.1), transparent 44%),
    rgba(8, 12, 15, 0.74);
  box-shadow: var(--lift);
  backdrop-filter: blur(16px);
}

.home-search-box {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 6px 6px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(2, 6, 8, 0.58);
}

.home-search-box input {
  min-height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.home-search-box input:focus {
  box-shadow: none;
}

.home-search-box .primary-button {
  min-height: 36px;
}

.home-quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.home-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.home-metric-card {
  display: grid;
  gap: 8px;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background:
    linear-gradient(145deg, rgba(174, 181, 255, 0.07), transparent 50%),
    rgba(255, 255, 255, 0.04);
  text-align: left;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.home-metric-card:hover {
  border-color: rgba(83, 234, 208, 0.36);
  background:
    linear-gradient(145deg, rgba(83, 234, 208, 0.1), transparent 50%),
    rgba(255, 255, 255, 0.055);
  box-shadow: var(--lift);
  transform: translateY(-1px);
}

.home-metric-card span {
  font-size: 13px;
  font-weight: 850;
}

.home-metric-card strong {
  color: var(--primary-strong);
  font-size: 32px;
  line-height: 1;
}

.home-workbench-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.home-panel {
  display: grid;
  gap: 12px;
  min-height: 260px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(83, 234, 208, 0.08), transparent 48%),
    linear-gradient(315deg, rgba(255, 148, 111, 0.045), transparent 45%),
    rgba(12, 17, 21, 0.82);
  box-shadow: var(--lift);
}

.home-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-panel-header h2 {
  font-size: 17px;
}

.home-site-list,
.home-security-list {
  display: grid;
  align-content: start;
  gap: 8px;
}

.home-site-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(165, 188, 185, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.home-site-main-button,
.home-security-row {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.home-site-main-button strong,
.home-site-main-button span,
.home-security-row strong,
.home-security-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-site-main-button strong,
.home-security-row strong {
  color: #f8fffc;
  font-size: 14px;
}

.home-site-main-button span,
.home-security-row span {
  color: var(--muted);
  font-size: 12px;
}

.home-site-row:hover,
.home-security-row:hover {
  border-color: rgba(83, 234, 208, 0.3);
  background: rgba(83, 234, 208, 0.08);
}

.home-security-row {
  padding: 10px;
  border: 1px solid rgba(247, 201, 109, 0.2);
  border-radius: 8px;
  background: rgba(247, 201, 109, 0.06);
}

.home-security-row span {
  color: #ffe7a6;
}

.home-empty-line {
  display: grid;
  min-height: 52px;
  place-items: center;
  border: 1px dashed rgba(165, 188, 185, 0.22);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 13px;
  font-weight: 800;
}

.home-empty-line.success {
  border-color: rgba(83, 234, 208, 0.22);
  color: var(--primary-strong);
  background: rgba(83, 234, 208, 0.06);
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  max-width: 1280px;
  margin: 0 auto 18px;
}

.hub-card {
  min-height: 220px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(83, 234, 208, 0.08), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    rgba(12, 17, 21, 0.84);
  box-shadow: var(--lift);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.primary-tool-card {
  cursor: pointer;
}

.hub-card:hover {
  border-color: rgba(83, 234, 208, 0.34);
  box-shadow: var(--glow);
  transform: translateY(-1px);
}

.tool-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.tool-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(83, 234, 208, 0.32);
  border-radius: 8px;
  color: #06110f;
  background: linear-gradient(135deg, var(--primary-strong), var(--primary));
  font-weight: 950;
}

.tool-icon.muted {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.055);
}

.tool-status {
  padding: 5px 9px;
  border: 1px solid rgba(83, 234, 208, 0.3);
  border-radius: 999px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 850;
}

.tool-status.muted {
  border-color: rgba(165, 188, 185, 0.18);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.055);
}

.hub-card h2 {
  margin-bottom: 9px;
}

.hub-card p {
  line-height: 1.6;
}

.tool-metrics {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.tool-metrics span {
  padding: 7px 10px;
  border: 1px solid rgba(165, 188, 185, 0.14);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.tool-metrics strong {
  color: var(--primary-strong);
}

.framework-panel {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: var(--lift);
}

.framework-steps {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.framework-steps span {
  padding: 8px 10px;
  border: 1px solid rgba(83, 234, 208, 0.2);
  border-radius: 999px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-size: 13px;
  font-weight: 850;
}

.app-header {
  position: relative;
  display: flex;
  overflow: hidden;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1280px;
  margin: 0 auto 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(83, 234, 208, 0.16), transparent 42%),
    linear-gradient(315deg, rgba(174, 181, 255, 0.1), transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)),
    rgba(11, 16, 20, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.app-header h1 {
  font-size: 28px;
  letter-spacing: 0;
}

.app-header p {
  margin-top: 4px;
  color: #bfd0cd;
}

.header-actions {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.visually-hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  opacity: 0;
  white-space: nowrap;
}

.toolbar {
  position: sticky;
  top: 12px;
  z-index: 5;
  max-width: 1280px;
  margin: 0 auto 18px;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 12, 15, 0.72);
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(16px);
}

.clue-capture-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 12px;
  max-width: 1280px;
  margin: 0 auto 18px;
  padding: 14px;
  border: 1px solid rgba(255, 148, 111, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 148, 111, 0.12), transparent 46%),
    linear-gradient(315deg, rgba(83, 234, 208, 0.065), transparent 46%),
    rgba(8, 12, 15, 0.74);
  box-shadow: var(--lift);
  backdrop-filter: blur(16px);
}

.quick-fields,
.quick-side {
  display: grid;
  gap: 10px;
}

.quick-side {
  align-content: start;
}

.clue-file-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.clue-file-actions span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.ai-inbox-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 14px;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto 18px;
  overflow: hidden;
}

.ai-inbox-main,
.ai-preview-panel {
  display: grid;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(83, 234, 208, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(140deg, rgba(83, 234, 208, 0.09), transparent 45%),
    linear-gradient(320deg, rgba(255, 148, 111, 0.08), transparent 48%),
    rgba(8, 12, 15, 0.78);
  box-shadow: var(--lift);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading span {
  color: var(--muted);
  font-size: 12px;
}

.panel-heading h2 {
  margin: 4px 0 0;
  color: #f7f8ff;
  font-size: 18px;
}

.panel-heading small {
  max-width: 320px;
  color: #9fb2af;
  text-align: right;
}

.simple-ai-inbox {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.simple-ai-inbox p {
  margin: 0;
  color: #c6d6d3;
  font-size: 14px;
  line-height: 1.6;
}

.ai-share-input-row {
  display: grid;
  grid-template-columns: auto auto;
  gap: 10px;
  min-width: 0;
  justify-content: start;
}

.ai-share-input-row input {
  min-width: 0;
}

.ai-paste-textarea {
  width: 100%;
  min-height: 260px;
  max-width: 100%;
  box-sizing: border-box;
  resize: vertical;
  overflow: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
}

.ai-paste-meta {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.ai-paste-meta span:last-child {
  color: #ffd89a;
}

.ai-manual-paste-box {
  display: grid;
  min-width: 0;
  max-width: 100%;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 148, 111, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 148, 111, 0.08), transparent 54%),
    rgba(255, 255, 255, 0.04);
}

.ai-manual-paste-box textarea,
.simple-ai-inbox input,
.ai-inbox-grid input,
.ai-inbox-grid textarea,
.ai-advanced-options textarea {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}

.ai-manual-paste-box[hidden] {
  display: none;
}

.simple-ai-actions {
  color: var(--muted);
  font-size: 13px;
}

.simple-ai-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ai-advanced-options {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.ai-advanced-options summary {
  cursor: pointer;
  padding: 10px 12px;
  color: #b7cbc7;
  font-size: 13px;
  user-select: none;
}

.ai-advanced-options[open] {
  padding: 0 12px 12px;
}

.ai-advanced-options[open] summary {
  margin: 0 -12px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-save-options {
  background: rgba(3, 6, 8, 0.28);
}

.ai-inbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.ai-prompt-tools,
.ai-import-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.ai-preview-box {
  min-height: 220px;
  min-width: 0;
  max-width: 100%;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(3, 6, 8, 0.5);
  color: #d8e8e4;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ai-preview-box h3,
.ai-preview-box h4 {
  margin: 0 0 8px;
  color: #ffffff;
}

.ai-preview-box p,
.ai-preview-box li {
  color: #c8d5d3;
  font-size: 13px;
  line-height: 1.55;
}

.ai-preview-box ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.ai-preview-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  min-width: 0;
}

.ai-preview-card {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.clue-ai-snapshot {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(83, 234, 208, 0.12);
  border-radius: 8px;
  background: rgba(83, 234, 208, 0.045);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.clue-ai-line {
  margin: 0;
  color: #cfe7e2;
  font-size: 13px;
  line-height: 1.55;
}

.clue-raw-details {
  min-width: 0;
}

.clue-raw-details summary {
  cursor: pointer;
  color: var(--primary-strong);
  font-size: 13px;
}

.clue-raw-details pre {
  max-height: 220px;
  margin: 8px 0 0;
  padding: 10px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #dcebea;
  background: rgba(3, 6, 8, 0.45);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ai-preview-card h4 {
  margin: 0 0 8px;
}

.ai-inbox-list {
  display: grid;
  gap: 8px;
}

.ai-inbox-row,
.prompt-template-row {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.ai-inbox-row strong,
.prompt-template-row strong {
  color: #f7f8ff;
  font-size: 13px;
}

.ai-inbox-row span,
.prompt-template-row span {
  color: #9fb2af;
  font-size: 12px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pp-hero,
.pp-dashboard-v8 {
  display: grid;
  gap: 12px;
  max-width: 1440px;
  margin: 0 auto;
}

.pp-hero {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  margin-bottom: 10px;
}

.pp-hero-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.pp-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid rgba(174, 181, 255, 0.2);
  border-radius: 999px;
  color: var(--primary-strong);
  background: rgba(174, 181, 255, 0.09);
  font-size: 12px;
  font-weight: 850;
}

.pp-hero h1 {
  max-width: 760px;
  color: #f7f8ff;
  font-size: clamp(30px, 4.4vw, 56px);
  line-height: 1.02;
}

.pp-hero p {
  max-width: 980px;
  color: var(--muted);
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.pp-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.pp-message {
  max-width: 1440px;
  margin: 0 auto 12px;
  padding: 10px 14px;
  border: 1px solid rgba(83, 234, 208, 0.2);
  border-radius: 8px;
  color: #c9fff8;
  background: rgba(83, 234, 208, 0.08);
  font-size: 13px;
  line-height: 1.65;
}

.pp-dashboard {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  max-width: 1440px;
  margin: 0 auto 12px;
}

.pp-dashboard article,
.pp-account-stats article,
.pp-global-counts article,
.pp-global-mini {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(174, 181, 255, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(174, 181, 255, 0.13), transparent 50%),
    linear-gradient(315deg, rgba(83, 234, 208, 0.08), transparent 52%),
    rgba(10, 15, 20, 0.78);
  box-shadow: var(--lift);
}

.pp-dashboard span,
.pp-account-stats span,
.pp-detail-heading span,
.pp-panel-heading span,
.pp-record-toolbar span,
.pp-global-hero span,
.pp-global-counts span,
.pp-global-mini span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.pp-dashboard strong,
.pp-account-stats strong,
.pp-global-hero strong,
.pp-global-counts strong,
.pp-global-mini strong {
  overflow: hidden;
  color: #e7eaff;
  font-size: 24px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pp-dashboard strong {
  font-size: 18px;
}

.pp-dashboard small,
.pp-global-counts small,
.pp-global-mini small,
.pp-rule-note span,
.pp-inline-note,
.pp-record-toolbar p,
.pp-panel-heading small,
.pp-global-hero p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.pp-shell {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 18px;
  max-width: 1440px;
  margin: 0 auto;
}

.pp-account-panel,
.pp-record-panel,
.pp-history-panel,
.pp-global-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(174, 181, 255, 0.1), transparent 46%),
    linear-gradient(315deg, rgba(83, 234, 208, 0.07), transparent 48%),
    rgba(9, 14, 18, 0.78);
  box-shadow: var(--lift);
}

.pp-dashboard-top,
.pp-dashboard-bottom {
  display: grid;
  gap: 12px;
  align-items: stretch;
}

.pp-dashboard-top {
  grid-template-columns: minmax(330px, 410px) minmax(0, 1fr);
}

.pp-dashboard-bottom {
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, 0.95fr);
}

.pp-view input,
.pp-view select,
.pp-view textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}

.pp-account-panel {
  position: static;
  display: grid;
  align-self: start;
  gap: 10px;
  padding: 12px;
}

.pp-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.pp-panel-heading h2 {
  margin-top: 3px;
  color: #f7f8ff;
  font-size: 20px;
}

.pp-panel-heading small {
  max-width: 240px;
  text-align: right;
}

.pp-panel-heading select {
  width: min(220px, 100%);
  flex: 0 0 auto;
}

.pp-record-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.pp-history-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 12px;
}

.pp-create-box,
.pp-account-detail,
.pp-record-main {
  display: grid;
  min-width: 0;
}

.pp-create-box {
  gap: 10px;
}

.pp-account-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.pp-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.pp-account-toolbar {
  gap: 12px;
}

.pp-account-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.pp-account-sort-box {
  display: grid;
  gap: 8px;
}

.pp-account-sort-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.pp-account-list,
.pp-record-list {
  display: grid;
  gap: 10px;
}

.pp-account-list {
  height: clamp(360px, 58vh, 660px);
  overflow-y: auto;
  padding-right: 4px;
  align-content: start;
}

.pp-history-panel .pp-record-list {
  max-height: clamp(260px, 44vh, 560px);
  overflow-y: auto;
  padding-right: 4px;
}

.pp-account-list::-webkit-scrollbar,
.pp-record-list::-webkit-scrollbar {
  width: 8px;
}

.pp-account-list::-webkit-scrollbar-thumb,
.pp-record-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.pp-account-list::-webkit-scrollbar-track,
.pp-record-list::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.pp-account-card {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(165, 188, 185, 0.14);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.045);
  text-align: left;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.pp-account-card:hover,
.pp-account-card.active {
  border-color: rgba(174, 181, 255, 0.42);
  background:
    linear-gradient(135deg, rgba(174, 181, 255, 0.14), transparent 50%),
    rgba(255, 255, 255, 0.065);
  transform: translateY(-1px);
}

.pp-account-card strong,
.pp-account-card span,
.pp-account-card small,
.pp-record-main strong,
.pp-record-main span {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pp-account-card strong {
  color: #f7f8ff;
  font-size: 15px;
}

.pp-account-card span {
  color: var(--muted);
  font-size: 13px;
}

.pp-account-card small {
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 850;
}

.pp-account-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pp-account-mini {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.pp-account-mini span {
  color: rgba(165, 188, 185, 0.72);
  font-size: 11px;
}

.pp-account-mini strong {
  color: #f7f8ff;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.pp-account-mini.balance {
  border-color: rgba(174, 181, 255, 0.18);
  background: rgba(174, 181, 255, 0.08);
}

.pp-account-mini.expense {
  border-color: rgba(255, 148, 111, 0.18);
  background: rgba(255, 148, 111, 0.08);
}

.pp-account-mini.warn {
  border-color: rgba(255, 210, 94, 0.32);
  background: rgba(255, 210, 94, 0.11);
}

.pp-account-mini.warn strong {
  color: #ffe4a5;
}

.pp-account-mini.danger {
  border-color: rgba(255, 148, 111, 0.34);
  background: rgba(255, 148, 111, 0.13);
}

.pp-account-mini.danger strong {
  color: #ffd7c5;
}

.pp-account-detail {
  gap: 14px;
}

.pp-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pp-detail-heading h2 {
  margin-top: 4px;
  color: #f7f8ff;
  font-size: 24px;
}

.pp-detail-heading p {
  margin-top: 5px;
  color: #c8d5d3;
  overflow-wrap: anywhere;
}

.pp-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pp-account-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.pp-account-stats small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.pp-account-stats article.warn {
  border-color: rgba(255, 210, 94, 0.34);
  background:
    linear-gradient(135deg, rgba(255, 210, 94, 0.13), transparent 50%),
    rgba(10, 15, 20, 0.78);
}

.pp-account-stats article.warn strong {
  color: #ffe4a5;
}

.pp-account-stats article.danger {
  border-color: rgba(255, 148, 111, 0.38);
  background:
    linear-gradient(135deg, rgba(255, 148, 111, 0.16), transparent 50%),
    rgba(10, 15, 20, 0.78);
}

.pp-account-stats article.danger strong {
  color: #ffd7c5;
}

.pp-rule-note {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(83, 234, 208, 0.16);
  border-radius: 8px;
  background: rgba(83, 234, 208, 0.06);
}

.pp-rule-note strong {
  color: #f7f8ff;
}

.pp-record-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(190px, 240px) minmax(190px, 220px) minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid rgba(174, 181, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.pp-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pp-status {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid;
  border-radius: 8px;
  line-height: 1.5;
}

.pp-status strong {
  color: inherit;
  font-size: 13px;
}

.pp-status span {
  font-size: 12px;
}

.pp-status.ok {
  border-color: rgba(83, 234, 208, 0.22);
  color: #c9fff8;
  background: rgba(83, 234, 208, 0.08);
}

.pp-status.bad {
  border-color: rgba(255, 148, 111, 0.28);
  color: #ffd7c5;
  background: rgba(255, 148, 111, 0.1);
}

.pp-field {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.pp-field span,
.pp-record-type > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.pp-record-type {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.pp-record-type > span {
  grid-column: 1 / -1;
}

.pp-record-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pp-record-toolbar select {
  width: min(220px, 100%);
}

.pp-record-toolbar p {
  margin-top: 4px;
}

.pp-record-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(165, 188, 185, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(83, 234, 208, 0.07), transparent 46%),
    rgba(255, 255, 255, 0.045);
}

.pp-record-row.expense {
  border-color: rgba(255, 148, 111, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 148, 111, 0.08), transparent 46%),
    rgba(255, 255, 255, 0.045);
}

.pp-record-main {
  gap: 4px;
}

.pp-record-main strong {
  color: #f7f8ff;
}

.pp-record-main span {
  color: var(--muted);
  font-size: 13px;
}

.pp-record-row b {
  color: var(--primary-strong);
  font-size: 16px;
  white-space: nowrap;
}

.pp-record-row.expense b {
  color: #ffd7c5;
}

.pp-record-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.pp-record-mini {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.pp-record-mini.balance {
  border-color: rgba(174, 181, 255, 0.2);
  background: rgba(174, 181, 255, 0.08);
}

.pp-record-mini.income {
  border-color: rgba(83, 234, 208, 0.2);
  background: rgba(83, 234, 208, 0.08);
}

.pp-record-mini.expense {
  border-color: rgba(255, 148, 111, 0.18);
  background: rgba(255, 148, 111, 0.08);
}

.pp-record-mini span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.pp-record-mini strong {
  color: #f7f8ff;
  font-size: 19px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.pp-record-mini small {
  color: rgba(165, 188, 185, 0.78);
  font-size: 12px;
  line-height: 1.45;
}

.pp-global-panel {
  display: grid;
  gap: 10px;
  max-width: none;
  margin: 0;
  padding: 12px;
}

.pp-global-hero {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(174, 181, 255, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(174, 181, 255, 0.16), transparent 48%),
    linear-gradient(315deg, rgba(83, 234, 208, 0.1), transparent 54%),
    rgba(5, 10, 14, 0.74);
}

.pp-global-hero strong {
  font-size: clamp(28px, 3.4vw, 42px);
}

.pp-global-counts,
.pp-global-dense-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pp-global-mini.income {
  border-color: rgba(83, 234, 208, 0.2);
  background:
    linear-gradient(135deg, rgba(83, 234, 208, 0.1), transparent 48%),
    rgba(255, 255, 255, 0.04);
}

.pp-global-mini.expense {
  border-color: rgba(255, 148, 111, 0.2);
  background:
    linear-gradient(135deg, rgba(255, 148, 111, 0.09), transparent 48%),
    rgba(255, 255, 255, 0.04);
}

.pp-global-mini.balance {
  border-color: rgba(174, 181, 255, 0.22);
}

.pp-latest-panel,
.pp-rules-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(165, 188, 185, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.pp-latest-panel .pp-record-list {
  max-height: clamp(180px, 28vh, 360px);
  overflow-y: auto;
  padding-right: 4px;
}

.pp-rules-panel summary {
  color: #f7f8ff;
  cursor: pointer;
  font-weight: 850;
}

.pp-rules-panel div {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.ledger-dashboard,
.ledger-bottom-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-width: 1280px;
  margin: 0 auto 18px;
}

.ledger-dashboard article,
.ledger-settings-panel,
.ledger-panel,
.ledger-group-stats article {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(96, 255, 181, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(96, 255, 181, 0.11), transparent 48%),
    linear-gradient(315deg, rgba(85, 167, 255, 0.08), transparent 52%),
    rgba(8, 14, 18, 0.82);
  box-shadow: var(--lift);
}

.ledger-dashboard span,
.ledger-group-stats span,
.ledger-detail-heading span,
.ledger-settings-panel .metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.ledger-dashboard strong,
.ledger-group-stats strong {
  overflow: hidden;
  color: #e9fff7;
  font-size: 24px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-settings-panel,
.ledger-shell,
.ledger-bottom-grid {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}

.ledger-settings-panel {
  margin-bottom: 18px;
}

.ledger-settings-grid {
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(130px, 180px) minmax(130px, 180px) minmax(150px, 1fr) auto;
  gap: 10px;
  align-items: end;
  min-width: 0;
}

.ledger-shell {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.ledger-group-panel,
.ledger-detail-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(96, 255, 181, 0.09), transparent 46%),
    linear-gradient(315deg, rgba(85, 167, 255, 0.08), transparent 48%),
    rgba(9, 14, 18, 0.78);
  box-shadow: var(--lift);
}

.ledger-group-panel {
  position: sticky;
  top: 84px;
  display: grid;
  align-self: start;
  gap: 12px;
  padding: 14px;
}

.ledger-detail-panel,
.ledger-group-detail,
.ledger-create-box,
.ledger-withdrawal-main {
  display: grid;
  min-width: 0;
}

.ledger-detail-panel {
  gap: 14px;
  padding: 16px;
}

.ledger-create-box,
.ledger-group-list,
.ledger-entry-list,
.ledger-withdrawal-list {
  display: grid;
  gap: 10px;
}

.ledger-group-card {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 6px;
  padding: 12px 52px 12px 12px;
  border: 1px solid rgba(165, 188, 185, 0.14);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  text-align: left;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.ledger-group-card:hover,
.ledger-group-card.active {
  border-color: rgba(96, 255, 181, 0.4);
  background:
    linear-gradient(135deg, rgba(96, 255, 181, 0.12), transparent 50%),
    rgba(255, 255, 255, 0.065);
  transform: translateY(-1px);
}

.ledger-group-card strong,
.ledger-group-card span,
.ledger-group-card small,
.ledger-withdrawal-main strong,
.ledger-withdrawal-main span,
.ledger-withdrawal-main small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-group-card strong,
.ledger-withdrawal-main strong {
  color: #f7f8ff;
}

.ledger-group-card span,
.ledger-withdrawal-main span,
.ledger-withdrawal-main small {
  color: var(--muted);
  font-size: 13px;
}

.ledger-group-card small {
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 850;
}

.ledger-group-delete-button {
  position: absolute;
  top: 10px;
  right: 10px;
  border-color: rgba(255, 111, 134, 0.28);
  color: #ffdbe1;
  background: rgba(255, 111, 134, 0.12);
}

.ledger-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ledger-detail-heading h2 {
  margin-top: 4px;
  color: #f7f8ff;
  font-size: 24px;
}

.ledger-detail-heading p {
  margin-top: 5px;
  color: #c8d5d3;
  overflow-wrap: anywhere;
}

.ledger-group-controls,
.ledger-entry-form {
  display: grid;
  grid-template-columns: minmax(120px, 160px) minmax(130px, 170px) minmax(130px, 170px) auto;
  gap: 10px;
  align-items: end;
  min-width: 0;
}

.ledger-group-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.ledger-entry-form {
  grid-template-columns: minmax(130px, 170px) minmax(120px, 170px) minmax(0, 1fr) auto auto;
  padding: 10px;
  border: 1px solid rgba(96, 255, 181, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.ledger-entry-row,
.ledger-withdrawal-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(165, 188, 185, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(96, 255, 181, 0.07), transparent 46%),
    rgba(255, 255, 255, 0.045);
}

.ledger-entry-row b {
  color: var(--primary-strong);
  font-size: 16px;
  white-space: nowrap;
}

.ledger-bottom-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
}

.ledger-panel .section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ledger-panel .section-title select {
  max-width: 160px;
}

.ledger-withdrawal-row {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
}

.ledger-withdrawal-row.paid {
  opacity: 0.7;
}

.ledger-withdrawal-main {
  gap: 5px;
}

.ledger-withdrawal-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

.ledger-command-list {
  display: grid;
  grid-template-columns: minmax(130px, 190px) minmax(0, 1fr);
  gap: 10px 12px;
  align-items: center;
}

.ledger-command-list code {
  padding: 7px 9px;
  border: 1px solid rgba(96, 255, 181, 0.18);
  border-radius: 8px;
  color: #cffff0;
  background: rgba(3, 8, 10, 0.58);
  overflow-wrap: anywhere;
}

.ledger-command-list span {
  color: #c8d5d3;
  font-size: 13px;
}

.admin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-width: 1280px;
  margin: 0 auto 18px;
}

.admin-metrics-grid article {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(83, 234, 208, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(83, 234, 208, 0.13), transparent 48%),
    linear-gradient(315deg, rgba(174, 181, 255, 0.08), transparent 52%),
    rgba(10, 15, 20, 0.78);
  box-shadow: var(--lift);
}

.admin-metrics-grid span,
.admin-tool-card span,
.admin-backup-main span,
.integration-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.admin-metrics-grid small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-metrics-grid strong {
  overflow: hidden;
  color: #e5fff9;
  font-size: 23px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-shell {
  display: grid;
  grid-template-columns: minmax(260px, 390px) minmax(0, 1fr);
  gap: 18px;
  max-width: 1280px;
  margin: 0 auto;
}

.admin-tool-panel,
.admin-backup-panel {
  display: grid;
  align-content: start;
  min-width: 0;
  gap: 12px;
}

.admin-tool-card,
.admin-backup-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(83, 234, 208, 0.08), transparent 48%),
    linear-gradient(315deg, rgba(255, 148, 111, 0.05), transparent 48%),
    rgba(9, 14, 18, 0.78);
  box-shadow: var(--lift);
}

.admin-tool-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.admin-tool-card h2 {
  margin: 5px 0;
  color: #f7f8ff;
  font-size: 18px;
}

.admin-tool-card p {
  color: #c8d5d3;
  font-size: 13px;
  line-height: 1.55;
}

.admin-migration-card {
  border-color: rgba(255, 148, 111, 0.24);
  background:
    linear-gradient(135deg, rgba(255, 148, 111, 0.12), transparent 48%),
    linear-gradient(315deg, rgba(83, 234, 208, 0.08), transparent 48%),
    rgba(9, 14, 18, 0.8);
}

.admin-database-card {
  border-color: rgba(174, 181, 255, 0.24);
  background:
    linear-gradient(135deg, rgba(174, 181, 255, 0.13), transparent 48%),
    linear-gradient(315deg, rgba(83, 234, 208, 0.08), transparent 48%),
    rgba(9, 14, 18, 0.8);
}

.admin-backup-panel {
  gap: 14px;
  padding: 16px;
}

.admin-backup-create {
  display: grid;
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(83, 234, 208, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.admin-backup-list {
  display: grid;
  gap: 10px;
}

.admin-import-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(165, 188, 185, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.admin-backup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(165, 188, 185, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(83, 234, 208, 0.07), transparent 46%),
    rgba(255, 255, 255, 0.045);
}

.admin-backup-main {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.admin-backup-main strong,
.admin-backup-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-backup-main strong {
  color: #f7f8ff;
  font-size: 15px;
}

.admin-backup-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-backup-actions .icon-text-button {
  min-height: 34px;
  padding-inline: 10px;
  font-size: 12px;
}

.admin-integration-panel,
.option-manager-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 1280px;
  margin: 18px auto 0;
}

.option-manager-panel {
  grid-template-columns: 1fr;
}

.option-manager-toolbar {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(220px, 1.2fr) auto auto auto;
  gap: 10px;
  align-items: end;
  min-width: 0;
}

.option-manager-list {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.option-manager-header,
.option-manager-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 72px minmax(150px, 1fr) minmax(260px, auto);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.option-manager-header {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.option-manager-row.disabled {
  opacity: 0.58;
}

.option-manager-row strong,
.option-manager-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.option-manager-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  min-width: 0;
}

.compact-action {
  min-height: 32px;
  padding: 7px 10px;
  font-size: 12px;
}

.managed-option-combo {
  position: relative;
  display: grid;
  min-width: 0;
  width: 100%;
}

.managed-option-input {
  padding-right: 42px !important;
}

.managed-option-clear {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 26px;
  height: 26px;
  min-height: 0;
  padding: 0;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.055);
  font-size: 18px;
  line-height: 1;
}

.managed-option-clear:hover {
  color: var(--primary-strong);
  border-color: rgba(83, 234, 208, 0.38);
}

.managed-option-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  display: none;
  width: 100%;
  max-height: 230px;
  min-width: 0;
  padding: 6px;
  overflow: auto;
  border: 1px solid rgba(83, 234, 208, 0.28);
  border-radius: 8px;
  background: #11191f;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.48);
}

.managed-option-combo.open .managed-option-dropdown {
  display: grid;
  gap: 4px;
}

.managed-option-item {
  justify-content: flex-start;
  width: 100%;
  min-height: 34px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  color: #d8ebe7;
  background: transparent;
  font-size: 13px;
  text-align: left;
  overflow-wrap: anywhere;
}

.managed-option-item:hover,
.managed-option-item.active {
  color: #04100e;
  background: var(--primary);
}

.managed-option-item.add-new {
  color: var(--primary-strong);
  border: 1px dashed rgba(83, 234, 208, 0.38);
  background: rgba(83, 234, 208, 0.08);
}

.managed-option-item.add-new:hover {
  color: #04100e;
  background: var(--primary);
}

.managed-option-empty {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.prompt-library-panel {
  display: grid;
  grid-template-columns: minmax(300px, 0.7fr) minmax(0, 1.3fr);
  gap: 18px;
  max-width: 1280px;
  margin: 18px auto 0;
}

.integration-card {
  display: grid;
  min-width: 0;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(174, 181, 255, 0.08), transparent 48%),
    linear-gradient(315deg, rgba(83, 234, 208, 0.06), transparent 48%),
    rgba(9, 14, 18, 0.78);
  box-shadow: var(--lift);
}

.integration-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.integration-card h2 {
  margin: 5px 0;
  color: #f7f8ff;
  font-size: 18px;
}

.integration-card p {
  color: #c8d5d3;
  font-size: 13px;
}

.integration-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.compact-toggle {
  display: inline-flex;
  min-width: 86px;
}

.admin-settings-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

.prompt-template-list {
  display: grid;
  gap: 10px;
  max-height: 620px;
  overflow: auto;
}

.prompt-template-row {
  cursor: pointer;
}

.prompt-template-row.active {
  border-color: rgba(83, 234, 208, 0.52);
  background: rgba(83, 234, 208, 0.08);
}

.prompt-enabled-field {
  align-self: end;
  min-height: 42px;
}

.search-box {
  display: flex;
  min-width: 240px;
  flex: 1 1 360px;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: rgba(2, 6, 8, 0.58);
}

.search-box:focus-within {
  border-color: rgba(83, 234, 208, 0.65);
  box-shadow: 0 0 0 3px rgba(83, 234, 208, 0.12);
}

.search-box input {
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.search-box input:focus {
  box-shadow: none;
}

.toolbar select {
  width: auto;
  min-width: 136px;
}

.view-toggle {
  display: inline-flex;
  min-height: 42px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 6, 8, 0.58);
}

.segmented-button {
  min-width: 58px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 900;
  transition:
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.segmented-button:hover,
.segmented-button.active {
  color: #06110f;
  background: linear-gradient(135deg, var(--primary-strong), var(--primary));
  box-shadow: 0 10px 26px rgba(83, 234, 208, 0.18);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
  gap: 18px;
  max-width: 1280px;
  margin: 0 auto;
}

.stats-panel {
  position: sticky;
  top: 84px;
  display: grid;
  gap: 10px;
  align-self: start;
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(83, 234, 208, 0.11), transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    rgba(11, 16, 20, 0.72);
  box-shadow: var(--lift);
  backdrop-filter: blur(16px);
}

.stats-panel > div:not(.tag-list) {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(165, 188, 185, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.stats-panel > div:first-child {
  background:
    linear-gradient(135deg, rgba(83, 234, 208, 0.16), transparent),
    rgba(255, 255, 255, 0.045);
}

.stats-panel strong {
  color: var(--primary-strong);
  font-size: 28px;
  line-height: 1;
}

.metric-label {
  font-size: 12px;
  font-weight: 850;
}

.tag-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 12px;
}

.collection-list {
  display: grid;
  gap: 7px;
  padding-top: 4px;
}

.collection-button {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  border: 1px solid rgba(165, 188, 185, 0.14);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-weight: 820;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.collection-button strong {
  color: inherit;
  font-size: 13px;
}

.collection-button:hover,
.collection-button.active {
  border-color: rgba(83, 234, 208, 0.34);
  color: var(--primary-strong);
  background: rgba(83, 234, 208, 0.1);
  transform: translateY(-1px);
}

.tag-pill {
  max-width: 100%;
  padding: 5px 9px;
  overflow: hidden;
  border: 1px solid rgba(83, 234, 208, 0.22);
  border-radius: 999px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-pill.warm {
  border-color: rgba(255, 148, 111, 0.24);
  color: #ffd7c5;
  background: var(--accent-soft);
}

.site-list-wrap {
  container: site-list-area / inline-size;
  min-width: 0;
}

.site-list {
  display: grid;
  gap: 14px;
}

.site-list.card-view {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  align-items: start;
}

.site-list.list-view {
  overflow: hidden;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 17, 21, 0.78);
}

.site-card {
  position: relative;
  display: grid;
  overflow: hidden;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(83, 234, 208, 0.1), transparent 42%),
    linear-gradient(315deg, rgba(255, 148, 111, 0.055), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    rgba(12, 17, 21, 0.88);
  box-shadow: var(--lift);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.site-list.list-view .site-card {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid rgba(165, 188, 185, 0.12);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  isolation: isolate;
}

.site-list.list-view .site-avatar {
  display: none;
}

.site-list.list-view .site-card:last-child {
  border-bottom: 0;
}

.site-list.list-view .site-card:hover {
  background: rgba(83, 234, 208, 0.055);
  box-shadow: none;
  transform: none;
}

.site-list.list-view .site-main {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr) minmax(0, 0.85fr);
  gap: 12px;
  align-items: center;
}

.site-list.list-view .site-topline {
  flex-wrap: nowrap;
  min-width: 0;
  overflow: hidden;
  margin-bottom: 0;
}

.site-list.list-view .site-title {
  font-size: 14px;
}

.site-list.list-view .status {
  max-width: 96px;
  padding: 3px 7px;
  font-size: 11px;
}

.site-list.list-view .site-url {
  display: block;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  color: #9edbd3;
  background: transparent;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-list.list-view .site-url::after {
  display: none;
}

.site-list.list-view .site-url:hover {
  color: var(--primary-strong);
  background: transparent;
  transform: none;
}

.site-list.list-view .site-meta {
  flex-wrap: nowrap;
  min-width: 0;
  margin-top: 0;
  overflow: hidden;
}

.site-list.list-view .meta-chip {
  max-width: 118px;
  padding: 3px 6px;
  font-size: 11px;
}

.site-list.list-view .site-summary,
.site-list.list-view .site-facts,
.site-list.list-view .credential-preview-list,
.site-list.list-view .site-notes {
  display: none;
}

.site-list.list-view .site-actions {
  flex-wrap: nowrap;
  max-width: none;
  justify-content: flex-end;
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  padding: 4px;
  border: 1px solid rgba(165, 188, 185, 0.14);
  border-radius: 8px;
  background: rgba(8, 13, 17, 0.96);
  box-shadow: -18px 0 24px rgba(8, 13, 17, 0.72);
}

.site-list.list-view .icon-button {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  background: rgba(24, 32, 36, 0.98);
}

@container site-list-area (max-width: 760px) {
  .site-list.list-view {
    border: 0;
    background: transparent;
  }

  .site-list.list-view .site-card {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(12, 17, 21, 0.88);
  }

  .site-list.list-view .site-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-list.list-view .site-topline,
  .site-list.list-view .site-meta,
  .site-list.list-view .site-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .site-list.list-view .site-url {
    padding: 6px 8px;
    border: 1px solid rgba(83, 234, 208, 0.18);
    border-radius: 7px;
    background: rgba(83, 234, 208, 0.06);
  }

  .site-list.list-view .site-actions {
    width: fit-content;
    max-width: 100%;
    box-shadow: none;
  }
}

.site-card.is-archived {
  opacity: 0.74;
}

.site-avatar {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(83, 234, 208, 0.28);
  border-radius: 8px;
  color: var(--primary-strong);
  background:
    linear-gradient(135deg, rgba(83, 234, 208, 0.2), transparent),
    rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 0 24px rgba(83, 234, 208, 0.08);
  font-size: 20px;
  font-weight: 950;
}

.site-card:hover {
  border-color: rgba(83, 234, 208, 0.38);
  box-shadow: var(--glow);
  transform: translateY(-1px);
}

.site-main {
  min-width: 0;
}

.site-topline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.site-title {
  min-width: 0;
  overflow: hidden;
  color: #f8fffc;
  font-size: 18px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  flex: 0 0 auto;
  max-width: 220px;
  padding: 4px 9px;
  overflow: hidden;
  border: 1px solid rgba(244, 199, 107, 0.3);
  border-radius: 999px;
  color: #ffe7a6;
  background: var(--gold-soft);
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-favorite {
  border-color: rgba(83, 234, 208, 0.32);
  color: var(--primary-strong);
  background: var(--primary-soft);
}

.status-read-later {
  border-color: rgba(174, 181, 255, 0.32);
  color: #dce0ff;
  background: var(--violet-soft);
}

.status-archived {
  border-color: rgba(165, 188, 185, 0.24);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.055);
}

.site-url {
  display: inline-flex;
  min-width: 0;
  max-width: min(100%, 720px);
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  overflow: hidden;
  border: 1px solid rgba(83, 234, 208, 0.22);
  border-radius: 8px;
  color: var(--primary);
  background: rgba(83, 234, 208, 0.08);
  font-size: 14px;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
  white-space: normal;
  word-break: break-word;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.site-url::after {
  flex: 0 0 auto;
  color: var(--primary-strong);
  content: "打开";
  font-size: 12px;
  font-weight: 850;
}

.site-url:hover {
  border-color: rgba(83, 234, 208, 0.52);
  color: var(--primary-strong);
  background: rgba(83, 234, 208, 0.14);
  transform: translateY(-1px);
}

.site-url-empty {
  color: var(--faint);
  background: rgba(255, 255, 255, 0.035);
}

.site-url-empty::after {
  display: none;
}

.site-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.site-summary {
  max-width: 780px;
  margin-top: 10px;
  color: #d8e6e3;
  font-size: 14px;
  line-height: 1.58;
}

.site-facts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.site-fact {
  display: inline-flex;
  max-width: min(100%, 520px);
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  overflow: hidden;
  border: 1px solid rgba(165, 188, 185, 0.14);
  border-radius: 8px;
  color: #d8e6e3;
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
}

.site-fact strong {
  flex: 0 0 auto;
  color: var(--primary-strong);
}

.site-fact span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-fact.warning {
  border-color: rgba(247, 201, 109, 0.24);
  color: #ffe7a6;
  background: rgba(247, 201, 109, 0.07);
}

.site-fact.warning strong {
  color: var(--gold);
}

.meta-chip {
  max-width: 100%;
  padding: 5px 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.credential-preview-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.credential-preview {
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 8px 9px;
  border: 1px solid rgba(151, 173, 171, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(174, 181, 255, 0.07), transparent),
    rgba(255, 255, 255, 0.04);
}

.credential-preview-text {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.credential-preview-text strong,
.credential-preview-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.credential-preview-text strong {
  color: #f4fffb;
  font-size: 13px;
}

.credential-preview-text span {
  color: var(--muted);
  font-size: 12px;
}

.credential-preview-text .secret-line {
  color: #dce0ff;
}

.credential-preview-actions {
  gap: 6px;
  flex: 0 0 auto;
}

.credential-more {
  color: var(--gold);
  font-size: 12px;
  font-weight: 850;
}

.site-notes {
  display: -webkit-box;
  max-width: 760px;
  margin-top: 10px;
  overflow: hidden;
  color: #c5d3d0;
  font-size: 14px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.site-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 144px;
}

.active-action {
  border-color: rgba(83, 234, 208, 0.44);
  color: var(--primary-strong);
  background: rgba(83, 234, 208, 0.12);
}

.empty-state {
  display: none;
  padding: 68px 20px;
  border: 1px dashed rgba(165, 188, 185, 0.32);
  border-radius: 8px;
  place-items: center;
  gap: 14px;
  background:
    linear-gradient(145deg, rgba(83, 234, 208, 0.08), transparent),
    rgba(255, 255, 255, 0.035);
  box-shadow: var(--lift);
}

.empty-state.visible {
  display: grid;
}

.clue-list {
  display: grid;
  gap: 14px;
}

.clue-card {
  position: relative;
  display: grid;
  min-width: 0;
  max-width: 100%;
  gap: 12px;
  overflow: hidden;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 148, 111, 0.11), transparent 40%),
    linear-gradient(315deg, rgba(83, 234, 208, 0.07), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    rgba(12, 17, 21, 0.88);
  box-shadow: var(--lift);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.clue-card:hover {
  border-color: rgba(255, 148, 111, 0.36);
  box-shadow: 0 0 0 1px rgba(255, 148, 111, 0.16), 0 16px 48px rgba(255, 148, 111, 0.08);
  transform: translateY(-1px);
}

.clue-card.is-archived {
  opacity: 0.68;
}

.clue-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
  gap: 12px;
  align-items: start;
}

.clue-title-button {
  display: grid;
  min-width: 0;
  gap: 7px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.clue-title-button h3,
.clue-title-button p {
  overflow: hidden;
  text-overflow: ellipsis;
}

.clue-title-button h3 {
  color: #fff9f5;
  font-size: 18px;
  font-weight: 900;
  white-space: nowrap;
}

.clue-title-button p {
  display: -webkit-box;
  color: #d9e5e2;
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.clue-status {
  border-color: rgba(255, 148, 111, 0.3);
  color: #ffd7c5;
  background: var(--accent-soft);
}

.clue-source-url {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.clue-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.clue-image-strip,
.clue-attachment-list {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.clue-image-thumb,
.clue-file-thumb,
.clue-attachment-item {
  overflow: hidden;
  border: 1px solid rgba(165, 188, 185, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.clue-image-thumb {
  width: 78px;
  height: 58px;
  padding: 0;
}

.clue-file-thumb {
  display: grid;
  width: 112px;
  height: 58px;
  align-content: center;
  gap: 3px;
  padding: 8px;
  color: #f4fffb;
  text-align: left;
}

.clue-file-thumb strong {
  color: var(--primary-strong);
  font-size: 12px;
  letter-spacing: 0;
}

.clue-file-thumb span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
}

.clue-image-thumb img,
.clue-attachment-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.clue-image-more {
  display: grid;
  width: 48px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(255, 148, 111, 0.24);
  border-radius: 8px;
  color: #ffd7c5;
  background: rgba(255, 148, 111, 0.08);
  font-weight: 900;
}

.clue-attachment-list {
  margin-top: 8px;
}

.clue-attachment-list.compact {
  margin-top: 0;
}

.clue-attachment-item {
  position: relative;
  display: grid;
  width: min(180px, 100%);
  grid-template-rows: 104px auto;
  margin: 0;
}

.clue-attachment-item.text-file {
  grid-template-rows: 104px auto;
}

.clue-text-file-preview {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(83, 234, 208, 0.16), transparent 52%),
    rgba(4, 9, 13, 0.72);
}

.clue-text-file-preview strong {
  width: max-content;
  padding: 3px 8px;
  border: 1px solid rgba(83, 234, 208, 0.28);
  border-radius: 999px;
  color: var(--primary-strong);
  font-size: 12px;
}

.clue-text-file-preview span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.clue-attachment-item figcaption {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 7px 38px 7px 8px;
}

.clue-attachment-item figcaption span,
.clue-attachment-item figcaption small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clue-attachment-item figcaption span {
  color: #f4fffb;
  font-size: 12px;
  font-weight: 850;
}

.clue-attachment-item figcaption small {
  color: var(--muted);
  font-size: 11px;
}

.clue-attachment-item .mini-icon-button {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  background: rgba(8, 13, 17, 0.92);
}

.clue-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-dialog {
  width: min(900px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  overflow: auto;
  overflow-x: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(83, 234, 208, 0.1), transparent 44%),
    linear-gradient(315deg, rgba(174, 181, 255, 0.08), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025)),
    #10171b;
  box-shadow: var(--shadow);
}

.clue-dialog {
  max-width: calc(100vw - 28px);
  overflow-x: hidden;
}

.site-dialog::backdrop {
  background:
    linear-gradient(135deg, rgba(83, 234, 208, 0.08), transparent),
    rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(5px);
}

.site-form {
  display: grid;
  min-width: 0;
  gap: 18px;
  padding: 22px;
  overflow-x: hidden;
}

.dialog-header,
.dialog-actions {
  justify-content: space-between;
  gap: 16px;
}

.dialog-actions {
  position: sticky;
  bottom: -22px;
  z-index: 2;
  padding-top: 12px;
  background: linear-gradient(180deg, rgba(16, 23, 27, 0), #10171b 32%);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  max-width: 100%;
  gap: 16px;
}

.field-grid label,
.field-grid input,
.field-grid select,
.field-grid textarea,
.clue-dialog input,
.clue-dialog textarea,
.clue-dialog select {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}

.clue-dialog textarea {
  max-height: min(34vh, 320px);
  overflow: auto;
  resize: vertical;
}

.readonly-field {
  color: #d7e6e2;
  background: rgba(255, 255, 255, 0.045);
}

.clue-organized-preview {
  display: grid;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  padding: 12px;
  border: 1px solid rgba(83, 234, 208, 0.18);
  border-radius: 8px;
  background: rgba(83, 234, 208, 0.055);
  overflow-wrap: anywhere;
}

.clue-organized-preview h3,
.clue-organized-preview h4 {
  margin: 0;
}

.clue-organized-preview h3 {
  color: var(--primary-strong);
  font-size: 15px;
}

.clue-organized-preview h4 {
  color: #e6fbf7;
  font-size: 13px;
}

.clue-organized-preview section {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.clue-organized-preview ul {
  margin: 0;
  padding-left: 18px;
  color: #c8d9d6;
}

.wide-field {
  grid-column: 1 / -1;
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.toggle-field {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 820;
}

.toggle-field input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  accent-color: var(--primary);
}

.toggle-field:has(input:checked) {
  border-color: rgba(83, 234, 208, 0.34);
  color: var(--primary-strong);
  background: rgba(83, 234, 208, 0.1);
}

.url-edit-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.url-edit-row input {
  flex: 1 1 260px;
}

.credentials-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(83, 234, 208, 0.055), transparent),
    rgba(255, 255, 255, 0.035);
}

.section-heading {
  justify-content: space-between;
  gap: 14px;
}

.section-heading p {
  margin-top: 3px;
  font-size: 13px;
}

.credentials-list {
  display: grid;
  gap: 12px;
}

.credential-editor {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(151, 173, 171, 0.18);
  border-radius: 8px;
  background: rgba(3, 7, 10, 0.48);
}

.credential-editor-header {
  justify-content: space-between;
  gap: 12px;
}

.credential-index {
  color: var(--primary-strong);
}

.credential-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.credential-field-grid label:has(textarea) {
  grid-column: 1 / -1;
}

.mini-toggle-field {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid rgba(151, 173, 171, 0.18);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 13px;
  font-weight: 850;
}

.mini-toggle-field input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  accent-color: var(--primary);
}

.mini-toggle-field:has(input:checked) {
  border-color: rgba(83, 234, 208, 0.34);
  color: var(--primary-strong);
  background: rgba(83, 234, 208, 0.1);
}

.right-actions {
  justify-content: flex-end;
  gap: 10px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid rgba(82, 221, 199, 0.28);
  border-radius: 8px;
  color: #06110f;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.44), transparent 34%),
    linear-gradient(135deg, var(--primary-strong), var(--primary));
  box-shadow: var(--shadow);
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1100px) {
  .library-shell {
    grid-template-columns: 1fr;
  }

  .library-sidebar {
    position: static;
    min-height: auto;
  }

  .library-nav,
  .sidebar-section {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hub-grid {
    grid-template-columns: 1fr;
  }

  .home-command-panel,
  .home-workbench-grid,
  .pp-hero,
  .pp-dashboard-top,
  .pp-dashboard-bottom,
  .pp-shell,
  .ledger-shell,
  .ledger-bottom-grid,
  .admin-shell,
  .admin-integration-panel,
  .option-manager-panel,
  .option-manager-toolbar,
  .option-manager-header,
  .option-manager-row,
  .clue-capture-panel {
    grid-template-columns: 1fr;
  }

  .pp-account-panel,
  .ledger-group-panel {
    position: static;
  }

  .pp-record-form,
  .ledger-settings-grid,
  .ledger-group-controls,
  .ledger-entry-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-quick-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 820px) {
  .library-shell {
    padding: 16px;
  }

  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .stats-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .home-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pp-dashboard,
  .pp-account-stats,
  .pp-account-input-row,
  .pp-account-search-row,
  .pp-status-grid,
  .pp-record-overview,
  .pp-global-counts,
  .pp-global-dense-grid,
  .ledger-dashboard,
  .ledger-group-stats,
  .admin-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pp-detail-heading,
  .pp-panel-heading,
  .pp-record-toolbar,
  .pp-hero,
  .ledger-detail-heading {
    flex-direction: column;
  }

  .pp-hero {
    grid-template-columns: 1fr;
  }

  .pp-hero-actions {
    justify-content: flex-start;
  }

  .pp-panel-heading small {
    max-width: none;
    text-align: left;
  }

  .pp-detail-actions {
    justify-content: flex-start;
  }

  .stats-panel > div:not(.tag-list) {
    display: grid;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .tag-list {
    grid-column: 1 / -1;
    padding-top: 4px;
  }

  .collection-list {
    grid-column: 1 / -1;
  }

  .site-card {
    grid-template-columns: 1fr;
  }

  .site-list.card-view {
    grid-template-columns: 1fr;
  }

  .site-list.list-view {
    border: 0;
    background: transparent;
  }

  .site-list.list-view .site-card,
  .site-list.list-view .site-main {
    grid-template-columns: 1fr;
  }

  .site-list.list-view .site-card {
    gap: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(12, 17, 21, 0.78);
  }

  .site-list.list-view .site-topline,
  .site-list.list-view .site-meta,
  .site-list.list-view .site-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .site-avatar {
    display: none;
  }

  .site-actions {
    flex-wrap: wrap;
    max-width: none;
    justify-content: flex-start;
  }

  .field-grid,
  .credential-field-grid,
  .toggle-grid {
    grid-template-columns: 1fr;
  }

  .credential-field-grid label:has(textarea),
  .wide-field {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .library-nav,
  .sidebar-section {
    grid-template-columns: 1fr;
  }

  .toolbar > *,
  .toolbar select,
  .toolbar button {
    width: 100%;
  }

  .view-toggle {
    width: 100%;
  }

  .view-toggle .segmented-button {
    flex: 1;
    width: auto;
  }

  .search-box {
    min-width: 0;
  }

  .home-search-box {
    align-items: stretch;
    flex-direction: column;
  }

  .home-search-box .primary-button,
  .home-quick-actions button,
  .home-metrics-grid {
    width: 100%;
  }

  .home-metrics-grid {
    grid-template-columns: 1fr;
  }

  .pp-dashboard,
  .pp-account-stats,
  .pp-record-form,
  .pp-account-input-row,
  .pp-account-search-row,
  .pp-status-grid,
  .pp-record-overview,
  .pp-global-counts,
  .pp-global-dense-grid,
  .ledger-dashboard,
  .ledger-group-stats,
  .ledger-settings-grid,
  .ledger-group-controls,
  .ledger-entry-form,
  .ledger-withdrawal-row,
  .ledger-withdrawal-actions,
  .ledger-command-list,
  .admin-metrics-grid,
  .admin-backup-create,
  .integration-grid,
  .ai-inbox-grid {
    grid-template-columns: 1fr;
  }

  .admin-tool-card,
  .admin-backup-row {
    grid-template-columns: 1fr;
  }

  .admin-tool-card button,
  .admin-backup-actions {
    width: 100%;
  }

  .admin-backup-actions .icon-text-button {
    flex: 1 1 120px;
  }

  .admin-import-row,
  .integration-card header,
  .panel-heading,
  .admin-settings-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .ai-inbox-panel,
  .prompt-library-panel,
  .option-manager-toolbar,
  .option-manager-header,
  .option-manager-row {
    grid-template-columns: 1fr;
  }

  .ai-share-input-row {
    grid-template-columns: 1fr;
  }

  .panel-heading small {
    max-width: none;
    text-align: left;
  }

  .pp-record-row,
  .ledger-entry-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .pp-record-row .mini-icon-button,
  .ledger-entry-row .mini-icon-button {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .stats-panel {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .right-actions {
    flex-direction: column-reverse;
  }

  .dialog-actions button,
  .right-actions button,
  .section-heading button {
    width: 100%;
  }
}

/* Global product polish */
:root {
  --panel-glass: rgba(9, 14, 18, 0.82);
  --panel-glass-strong: rgba(13, 19, 24, 0.94);
  --panel-edge: rgba(190, 214, 211, 0.2);
  --panel-edge-strong: rgba(178, 255, 240, 0.36);
  --button-dark: rgba(255, 255, 255, 0.065);
  --button-dark-hover: rgba(255, 255, 255, 0.105);
  --focus-ring: 0 0 0 3px rgba(83, 234, 208, 0.18);
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.014) 1px, transparent 1px),
    linear-gradient(145deg, rgba(83, 234, 208, 0.13), transparent 34%),
    linear-gradient(315deg, rgba(255, 148, 111, 0.1), transparent 36%),
    linear-gradient(230deg, rgba(174, 181, 255, 0.08), transparent 42%),
    linear-gradient(180deg, #10171b 0%, #070b0f 52%, #040507 100%);
  background-size: 72px 72px, 72px 72px, auto, auto, auto, auto;
}

body::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 22%),
    linear-gradient(90deg, transparent, rgba(83, 234, 208, 0.05), transparent),
    linear-gradient(135deg, rgba(247, 201, 109, 0.045), transparent 30%, rgba(174, 181, 255, 0.05));
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.035);
}

::-webkit-scrollbar-thumb {
  border: 2px solid rgba(4, 7, 10, 0.92);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(83, 234, 208, 0.62), rgba(174, 181, 255, 0.42));
}

:where(button, a, input, textarea, select) {
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease,
    opacity 160ms ease;
}

:where(button, a, input, textarea, select):focus-visible {
  outline: 0;
  box-shadow: var(--focus-ring);
}

:where(input, textarea, select) {
  border-color: rgba(190, 214, 211, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025)),
    rgba(3, 7, 10, 0.72);
}

:where(input, textarea, select):hover {
  border-color: rgba(190, 214, 211, 0.28);
}

:where(input, textarea, select):focus {
  border-color: rgba(83, 234, 208, 0.58);
  background:
    linear-gradient(180deg, rgba(83, 234, 208, 0.08), rgba(255, 255, 255, 0.025)),
    rgba(2, 8, 10, 0.9);
}

.library-shell {
  width: min(100%, 1880px);
  margin: 0 auto;
  gap: 22px;
  padding: 30px;
}

.library-sidebar {
  border-color: var(--panel-edge);
  background:
    linear-gradient(145deg, rgba(83, 234, 208, 0.13), transparent 48%),
    linear-gradient(315deg, rgba(255, 148, 111, 0.07), transparent 45%),
    rgba(7, 11, 14, 0.84);
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.library-brand {
  padding: 4px 2px 16px;
}

.library-brand h1,
.app-header h1,
.section-heading h2,
.panel-heading h2,
.pp-panel-heading h2,
.ledger-detail-heading h2 {
  color: #f7fffc;
  text-shadow: 0 0 28px rgba(83, 234, 208, 0.11);
}

.brand-mark {
  box-shadow:
    0 18px 46px rgba(83, 234, 208, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.library-nav-button,
.future-tool-button {
  position: relative;
  overflow: hidden;
  min-height: 48px;
  border-color: rgba(190, 214, 211, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.035);
}

.library-nav-button::before,
.future-tool-button::before {
  position: absolute;
  inset: 9px auto 9px 0;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: transparent;
  content: "";
}

.library-nav-button:hover,
.library-nav-button.active {
  border-color: rgba(83, 234, 208, 0.46);
  background:
    linear-gradient(135deg, rgba(83, 234, 208, 0.18), transparent 58%),
    rgba(83, 234, 208, 0.085);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

.library-nav-button.active::before {
  background: linear-gradient(180deg, var(--primary), var(--violet));
}

.library-main {
  display: grid;
  min-width: 0;
  align-content: start;
}

.view-panel.active {
  min-width: 0;
  animation: panelFadeIn 180ms ease both;
}

@keyframes panelFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-header,
.home-command-panel,
.home-panel,
.hub-card,
.stats-panel,
.toolbar,
.site-list-wrap,
.quick-clue-panel,
.ai-paste-card,
.ai-preview-panel,
.prompt-library-panel,
.ai-inbox-panel,
.option-manager-panel,
.admin-tool-card,
.admin-backup-panel,
.integration-card,
.ledger-panel,
.ledger-settings-panel,
.pp-account-panel,
.pp-record-panel,
.pp-history-panel,
.pp-global-panel,
.site-dialog,
.clue-dialog,
.auth-card {
  border-color: var(--panel-edge);
  background:
    linear-gradient(145deg, rgba(83, 234, 208, 0.095), transparent 44%),
    linear-gradient(315deg, rgba(174, 181, 255, 0.075), transparent 44%),
    var(--panel-glass);
  box-shadow:
    0 22px 62px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.app-header {
  overflow: hidden;
  margin-bottom: 18px;
  padding: 18px;
}

.app-header::after {
  position: absolute;
  inset: auto 18px 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 148, 111, 0.45), rgba(83, 234, 208, 0.55), transparent);
  content: "";
}

.header-actions,
.right-actions,
.dialog-actions,
.pp-hero-actions,
.admin-settings-actions {
  gap: 10px;
}

.primary-button,
.secondary-button,
.icon-text-button,
.ghost-button,
.icon-button,
.mini-icon-button,
.segmented-button,
.view-toggle button,
.filter-chip,
.tag-chip,
.option-chip {
  border-radius: 8px;
}

.primary-button {
  color: #04110f;
  background:
    linear-gradient(135deg, var(--primary-strong), var(--primary) 55%, #80c7ff),
    var(--primary);
  box-shadow:
    0 14px 30px rgba(83, 234, 208, 0.23),
    inset 0 1px 0 rgba(255, 255, 255, 0.66);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow:
    0 18px 42px rgba(83, 234, 208, 0.29),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.secondary-button,
.icon-text-button,
.ghost-button,
.icon-button,
.mini-icon-button,
.segmented-button,
.view-toggle button {
  border-color: rgba(190, 214, 211, 0.18);
  color: #dff6f2;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.03)),
    var(--button-dark);
}

.secondary-button:hover,
.icon-text-button:hover,
.ghost-button:hover,
.icon-button:hover,
.mini-icon-button:hover,
.segmented-button:hover,
.view-toggle button:hover {
  border-color: rgba(83, 234, 208, 0.42);
  color: var(--primary-strong);
  background:
    linear-gradient(135deg, rgba(83, 234, 208, 0.12), transparent 60%),
    var(--button-dark-hover);
  transform: translateY(-1px);
}

.segmented-button.active,
.view-toggle button.active,
.filter-chip.active,
.tag-chip.active,
.option-chip.active {
  border-color: rgba(83, 234, 208, 0.48);
  color: #06110f;
  background:
    linear-gradient(135deg, var(--primary-strong), var(--primary)),
    var(--primary);
  box-shadow: 0 12px 26px rgba(83, 234, 208, 0.18);
}

.home-command-panel,
.home-metrics-grid,
.home-workbench-grid,
.pp-hero,
.pp-dashboard,
.pp-dashboard-v8 {
  max-width: 1500px;
}

.home-command-panel {
  padding: 14px;
}

.home-search-box {
  border-color: rgba(190, 214, 211, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.022)),
    rgba(2, 7, 10, 0.82);
}

.home-search-box:focus-within,
.search-box:focus-within,
.ai-share-input-row:focus-within,
.pp-account-search-row:focus-within {
  border-color: rgba(83, 234, 208, 0.5);
  box-shadow: var(--focus-ring);
}

.hub-card,
.home-panel,
.site-card,
.clue-card,
.ledger-group-card,
.ledger-entry-row,
.ledger-withdrawal-row,
.pp-account-card,
.pp-record-row,
.pp-record-mini,
.pp-status,
.admin-backup-row,
.option-manager-row,
.ai-inbox-row,
.prompt-template-row,
.ai-preview-card {
  border-color: rgba(190, 214, 211, 0.16);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), transparent 48%),
    rgba(255, 255, 255, 0.035);
  box-shadow:
    0 14px 38px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.hub-card:hover,
.site-card:hover,
.clue-card:hover,
.ledger-group-card:hover,
.pp-account-card:hover,
.pp-record-row:hover,
.admin-backup-row:hover,
.ai-inbox-row:hover,
.prompt-template-row:hover {
  border-color: rgba(83, 234, 208, 0.32);
  background:
    linear-gradient(145deg, rgba(83, 234, 208, 0.08), transparent 48%),
    rgba(255, 255, 255, 0.045);
  transform: translateY(-1px);
}

.site-card,
.clue-card,
.pp-account-card,
.pp-record-row,
.ledger-entry-row,
.admin-backup-row,
.option-manager-row {
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.site-list-wrap,
.site-list,
.clue-list,
.pp-account-list,
.pp-record-list,
.pp-latest-list,
.ledger-entry-list,
.ledger-group-list,
.admin-backup-list,
.option-manager-list,
.ai-inbox-list,
.prompt-template-list {
  min-width: 0;
  scrollbar-gutter: stable;
}

.site-list,
.clue-list,
.pp-account-list,
.pp-record-list,
.pp-latest-list,
.ledger-entry-list,
.ledger-group-list,
.admin-backup-list {
  padding-right: 4px;
}

.site-list.list-view {
  overflow: hidden;
  border-color: rgba(190, 214, 211, 0.18);
}

.site-list.list-view .site-card {
  min-height: 58px;
}

.site-url,
.site-title,
.clue-title,
.clue-content,
.ai-preview-card,
.pp-account-card,
.pp-record-row,
.ledger-entry-row,
.option-manager-row,
.admin-tool-card p {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.site-actions,
.credential-preview-actions,
.admin-backup-actions,
.ledger-withdrawal-actions,
.pp-detail-actions {
  gap: 8px;
}

.ledger-withdrawal-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: min(520px, 100%);
}

.ledger-withdrawal-actions input {
  min-width: 0;
}

.ledger-withdrawal-actions button {
  white-space: nowrap;
}

.site-actions .mini-icon-button,
.credential-preview-actions .mini-icon-button {
  flex: 0 0 auto;
}

.stats-panel {
  gap: 10px;
}

.stats-panel > div:not(.tag-list),
.pp-dashboard article,
.pp-account-stats article,
.pp-global-counts article,
.pp-global-mini {
  border-color: rgba(190, 214, 211, 0.18);
  background:
    linear-gradient(145deg, rgba(83, 234, 208, 0.095), transparent 54%),
    rgba(3, 8, 11, 0.64);
}

.pp-dashboard article:hover,
.pp-account-stats article:hover,
.pp-global-counts article:hover,
.pp-global-mini:hover,
.stats-panel > div:not(.tag-list):hover {
  border-color: rgba(83, 234, 208, 0.33);
}

.pp-dashboard article.warn,
.pp-status.warn,
.pp-account-stat.warn,
.pp-record-mini.warn {
  border-color: rgba(247, 201, 109, 0.46);
  background:
    linear-gradient(145deg, rgba(247, 201, 109, 0.13), transparent 50%),
    rgba(10, 15, 20, 0.78);
}

.pp-dashboard article.danger,
.pp-status.danger,
.pp-account-stat.danger,
.pp-record-mini.danger {
  border-color: rgba(255, 112, 136, 0.46);
  background:
    linear-gradient(145deg, rgba(255, 112, 136, 0.13), transparent 50%),
    rgba(10, 15, 20, 0.78);
}

.pp-dashboard strong,
.pp-account-stats strong,
.pp-global-hero strong,
.pp-global-counts strong,
.pp-global-mini strong {
  color: #f5fffb;
  text-shadow: 0 0 26px rgba(83, 234, 208, 0.11);
}

.pp-status-grid,
.pp-record-overview,
.pp-global-counts,
.pp-global-dense-grid,
.ledger-dashboard,
.admin-metrics-grid {
  gap: 10px;
}

.pp-account-list,
.pp-record-list,
.pp-latest-list {
  border-radius: 8px;
}

.dialog-backdrop {
  backdrop-filter: blur(10px);
}

.dialog,
.site-dialog,
.clue-dialog {
  overflow: hidden;
}

.dialog-body {
  min-width: 0;
  max-height: min(76vh, 860px);
  overflow: auto;
  padding-right: 4px;
}

.dialog-header,
.dialog-actions {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)),
    rgba(4, 8, 11, 0.7);
}

.field-grid,
.credential-field-grid,
.toggle-grid,
.admin-settings-grid,
.integration-grid,
.option-manager-toolbar,
.ai-inbox-grid,
.ledger-settings-grid,
.pp-account-input-row,
.pp-record-form {
  min-width: 0;
}

.tag-list,
.collection-list,
.option-chip-list {
  min-width: 0;
  overflow-wrap: anywhere;
}

.badge,
.pp-badge,
.status-pill,
.source-pill,
.site-type,
.site-status,
.clue-type,
.clue-status {
  border-color: rgba(190, 214, 211, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.05);
}

.toolbar {
  position: relative;
  z-index: 1;
  padding: 12px;
}

.toolbar > *,
.toolbar input,
.toolbar select,
.toolbar button {
  min-width: 0;
}

@media (min-width: 1180px) {
  .library-sidebar {
    max-height: calc(100vh - 60px);
    overflow: auto;
  }

  .view-panel.active {
    padding-bottom: 16px;
  }
}

@media (max-width: 980px) {
  .library-shell {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .library-sidebar {
    position: relative;
    top: 0;
    min-height: auto;
  }

  .library-nav,
  .sidebar-section {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-header {
    padding: 16px;
  }
}

@media (max-width: 620px) {
  .library-shell {
    padding: 12px;
  }

  .library-nav,
  .sidebar-section {
    grid-template-columns: 1fr;
  }

  .app-header,
  .home-command-panel,
  .home-panel,
  .hub-card,
  .stats-panel,
  .toolbar,
  .site-list-wrap,
  .quick-clue-panel,
  .ai-paste-card,
  .ai-preview-panel,
  .prompt-library-panel,
  .ai-inbox-panel,
  .option-manager-panel,
  .admin-tool-card,
  .admin-backup-panel,
  .integration-card,
  .ledger-panel,
  .ledger-settings-panel,
  .pp-account-panel,
  .pp-record-panel,
  .pp-history-panel,
  .pp-global-panel {
    padding: 12px;
  }

  .site-card,
  .clue-card,
  .ledger-entry-row,
  .pp-account-card,
  .pp-record-row,
  .admin-backup-row,
  .option-manager-row {
    transform: none !important;
  }

  .primary-button:hover,
  .secondary-button:hover,
  .icon-text-button:hover,
  .ghost-button:hover,
  .icon-button:hover,
  .mini-icon-button:hover,
  .segmented-button:hover {
    transform: none;
  }
}

/* Ouyang Tools premium UI pass */
:root {
  --primary: #00f5ff;
  --primary-strong: #baffff;
  --primary-soft: rgba(0, 245, 255, 0.14);
  --panel-glass: rgba(7, 11, 16, 0.78);
  --panel-glass-strong: rgba(9, 14, 20, 0.96);
  --panel-edge: rgba(186, 255, 255, 0.18);
  --panel-edge-strong: rgba(0, 245, 255, 0.42);
  --focus-ring: 0 0 0 3px rgba(0, 245, 255, 0.18), 0 0 34px rgba(0, 245, 255, 0.12);
  --premium-shadow: 0 24px 78px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.016) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    radial-gradient(circle at 16% 0%, rgba(0, 245, 255, 0.16), transparent 32%),
    radial-gradient(circle at 88% 8%, rgba(174, 181, 255, 0.12), transparent 34%),
    linear-gradient(180deg, #0b1117 0%, #05080d 52%, #030507 100%);
  background-size: 72px 72px, 72px 72px, auto, auto, auto;
}

body::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 24%),
    linear-gradient(90deg, transparent, rgba(0, 245, 255, 0.055), transparent),
    radial-gradient(ellipse at 50% -16%, rgba(255, 255, 255, 0.12), transparent 46%);
}

.library-shell {
  width: min(100%, 1900px);
  grid-template-columns: minmax(248px, 292px) minmax(0, 1fr);
  gap: clamp(16px, 2vw, 28px);
  padding: clamp(14px, 2vw, 32px);
  transition: grid-template-columns 220ms ease;
}

.library-shell.sidebar-collapsed {
  grid-template-columns: 84px minmax(0, 1fr);
}

.library-sidebar {
  border-radius: 10px;
  backdrop-filter: blur(22px) saturate(1.2);
}

.library-brand .brand-mark {
  cursor: pointer;
}

.library-shell.sidebar-collapsed .library-sidebar {
  padding: 14px 10px;
}

.library-shell.sidebar-collapsed .library-brand {
  justify-content: center;
  padding-bottom: 12px;
}

.library-shell.sidebar-collapsed .library-brand > div:not(.brand-mark),
.library-shell.sidebar-collapsed .library-nav-button span,
.library-shell.sidebar-collapsed .future-tool-button span,
.library-shell.sidebar-collapsed .sidebar-label {
  display: none;
}

.library-shell.sidebar-collapsed .library-nav-button,
.library-shell.sidebar-collapsed .future-tool-button {
  min-height: 48px;
  justify-content: center;
  padding: 0;
}

.library-shell.sidebar-collapsed .library-nav-button strong,
.library-shell.sidebar-collapsed .future-tool-button strong {
  font-size: 11px;
}

.app-header,
.home-command-panel,
.home-panel,
.hub-card,
.stats-panel,
.toolbar,
.site-list-wrap,
.clue-capture-panel,
.ai-inbox-main,
.ai-preview-panel,
.admin-tool-card,
.integration-card,
.ledger-panel,
.ledger-settings-panel,
.pp-account-panel,
.pp-record-panel,
.pp-history-panel,
.pp-global-panel {
  border-radius: 10px;
  box-shadow: var(--premium-shadow);
  backdrop-filter: blur(18px) saturate(1.12);
}

.app-header {
  max-width: 1500px;
  margin: 0 auto 18px;
}

.app-header h1 {
  letter-spacing: 0;
}

#cluesToolView {
  max-width: 1580px;
  margin: 0 auto;
}

#cluesToolView .app-header {
  min-height: 102px;
  align-items: center;
  border-color: rgba(0, 245, 255, 0.22);
  background:
    linear-gradient(135deg, rgba(0, 245, 255, 0.15), transparent 50%),
    linear-gradient(315deg, rgba(174, 181, 255, 0.09), transparent 50%),
    rgba(7, 11, 16, 0.76);
}

#cluesToolView .app-header h1 {
  background: linear-gradient(90deg, #ffffff, #baffff 48%, #7bdfff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1;
}

#cluesToolView .app-header p {
  display: inline-flex;
  width: fit-content;
  margin-top: 10px;
  padding: 5px 10px;
  border: 1px solid rgba(0, 245, 255, 0.24);
  border-radius: 999px;
  color: #baffff;
  background: rgba(0, 245, 255, 0.08);
  font-weight: 800;
}

#cluesToolView .brand-mark.warm {
  color: #031214;
  background: linear-gradient(135deg, #baffff, #00f5ff 58%, #9fb6ff);
  box-shadow: 0 18px 48px rgba(0, 245, 255, 0.28);
}

.clue-capture-panel {
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.55fr);
  max-width: 1500px;
  padding: 18px;
  border-color: rgba(0, 245, 255, 0.2);
  background:
    linear-gradient(135deg, rgba(0, 245, 255, 0.1), transparent 46%),
    linear-gradient(315deg, rgba(255, 148, 111, 0.07), transparent 48%),
    rgba(7, 11, 16, 0.72);
}

.clue-capture-panel input,
.clue-capture-panel textarea,
.simple-ai-inbox textarea,
.simple-ai-inbox input {
  border-radius: 10px;
}

#quickClueTitle {
  min-height: 54px;
  font-size: 17px;
  font-weight: 850;
}

#quickClueContent {
  min-height: 132px;
}

.quick-side {
  grid-template-rows: auto auto;
  align-content: stretch;
}

.quick-side .primary-button {
  min-height: 54px;
}

.ai-inbox-panel {
  grid-template-columns: minmax(0, 1.08fr) minmax(330px, 0.62fr);
  max-width: 1500px;
  gap: 18px;
  overflow: visible;
}

.ai-inbox-main,
.ai-preview-panel {
  border-color: rgba(0, 245, 255, 0.2);
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(0, 245, 255, 0.1), transparent 42%),
    linear-gradient(315deg, rgba(174, 181, 255, 0.08), transparent 46%),
    rgba(7, 11, 16, 0.78);
}

.ai-preview-panel {
  position: sticky;
  top: 18px;
  align-self: start;
}

.panel-heading {
  align-items: center;
}

.panel-heading span {
  color: #8bdde1;
  font-weight: 900;
  letter-spacing: 0;
}

.panel-heading h2 {
  font-size: clamp(18px, 2vw, 24px);
}

.simple-ai-inbox p {
  max-width: 880px;
  color: #d5e7e7;
}

.ai-paste-textarea {
  min-height: 310px;
  border-color: rgba(0, 245, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02)),
    rgba(3, 8, 12, 0.82);
}

.ai-share-input-row {
  display: flex;
  flex-wrap: wrap;
}

#simpleAiOrganizeButton {
  min-width: 156px;
  min-height: 48px;
}

.ai-preview-box {
  min-height: 300px;
  border-color: rgba(0, 245, 255, 0.17);
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(0, 245, 255, 0.065), transparent 48%),
    rgba(2, 6, 9, 0.64);
}

.ai-preview-box:empty::before {
  display: block;
  padding: 18px;
  border: 1px dashed rgba(0, 245, 255, 0.22);
  border-radius: 10px;
  color: #9eb9ba;
  content: "整理结果会显示在这里。粘贴内容后点开始整理。";
}

.content-grid {
  grid-template-columns: 1fr;
  max-width: 1500px;
}

#cluesToolView .stats-panel {
  position: relative;
  top: 0;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  align-items: stretch;
}

#cluesToolView .collection-list,
#cluesToolView .tag-list {
  grid-column: 1 / -1;
}

#cluesToolView .collection-list {
  display: flex;
  flex-wrap: wrap;
}

#cluesToolView .collection-button {
  flex: 1 1 150px;
}

.clue-list {
  gap: 16px;
}

.clue-card {
  cursor: grab;
  border-radius: 10px;
}

.clue-card:active {
  cursor: grabbing;
}

.clue-card.is-dragging {
  opacity: 0.62;
  transform: scale(0.99);
}

.clue-card.is-drop-target {
  border-color: rgba(0, 245, 255, 0.64);
  box-shadow: 0 0 0 2px rgba(0, 245, 255, 0.18), 0 24px 70px rgba(0, 245, 255, 0.12);
}

.clue-card-header {
  align-items: start;
}

.clue-title-button h3 {
  font-size: 19px;
}

.clue-actions {
  justify-content: flex-start;
}

.empty-state {
  position: relative;
  min-height: 300px;
  place-items: center;
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(0, 245, 255, 0.07), transparent 48%),
    rgba(255, 255, 255, 0.025);
}

.empty-state::before {
  width: 76px;
  height: 76px;
  border: 1px solid rgba(0, 245, 255, 0.28);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(0, 245, 255, 0.22), transparent),
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.42), transparent 32%);
  box-shadow: 0 18px 52px rgba(0, 245, 255, 0.16);
  content: "";
}

.toolbar {
  max-width: 1500px;
  border-radius: 10px;
}

.search-box {
  border-radius: 10px;
}

.site-dialog {
  width: min(1080px, calc(100vw - 24px));
  max-height: min(92dvh, 920px);
  overflow: hidden;
  border-radius: 12px;
  border-color: rgba(0, 245, 255, 0.28);
  background:
    linear-gradient(135deg, rgba(0, 245, 255, 0.12), transparent 42%),
    linear-gradient(315deg, rgba(174, 181, 255, 0.08), transparent 45%),
    rgba(8, 13, 18, 0.96);
}

.site-dialog[open] {
  display: block;
}

.site-form {
  max-height: min(92dvh, 920px);
  padding: 0 22px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.dialog-header {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 -22px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(0, 245, 255, 0.12);
  backdrop-filter: blur(18px);
}

.dialog-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 0 -22px;
  padding: 14px 22px 18px;
  border-top: 1px solid rgba(0, 245, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(8, 13, 18, 0.62), rgba(8, 13, 18, 0.98) 34%),
    rgba(8, 13, 18, 0.96);
  backdrop-filter: blur(18px);
}

.site-dialog .field-grid {
  gap: 14px;
}

.site-dialog textarea {
  max-height: min(30vh, 280px);
  overflow: auto;
}

.credentials-section,
.credential-editor {
  border-radius: 10px;
}

.credential-field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.url-edit-row {
  flex-wrap: nowrap;
}

.url-edit-row input {
  flex-basis: auto;
}

@media (max-width: 1180px) {
  .ai-inbox-panel {
    grid-template-columns: 1fr;
  }

  .ai-preview-panel {
    position: relative;
    top: 0;
  }

  #cluesToolView .stats-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .library-shell,
  .library-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .library-shell.sidebar-collapsed .library-brand > div:not(.brand-mark),
  .library-shell.sidebar-collapsed .library-nav-button span,
  .library-shell.sidebar-collapsed .future-tool-button span,
  .library-shell.sidebar-collapsed .sidebar-label {
    display: initial;
  }

  .library-shell.sidebar-collapsed .library-nav-button,
  .library-shell.sidebar-collapsed .future-tool-button {
    justify-content: space-between;
    padding: 0 12px;
  }

  .library-shell.sidebar-collapsed .library-brand {
    justify-content: flex-start;
  }

  .clue-capture-panel,
  #cluesToolView .stats-panel,
  .field-grid,
  .credential-field-grid,
  .toggle-grid {
    grid-template-columns: 1fr;
  }

  .url-edit-row {
    flex-wrap: wrap;
  }

  .site-dialog {
    width: calc(100vw - 14px);
    max-height: calc(100dvh - 14px);
  }

  .site-form {
    max-height: calc(100dvh - 14px);
    padding: 0 14px;
  }

  .dialog-header,
  .dialog-actions {
    margin-right: -14px;
    margin-left: -14px;
    padding-right: 14px;
    padding-left: 14px;
  }
}

/* Premium reference rollout: apply the shared main-page direction to the whole toolbox */
:root {
  --ref-bg-0: #05070b;
  --ref-bg-1: #080d13;
  --ref-card: rgba(14, 22, 31, 0.72);
  --ref-card-strong: rgba(18, 29, 41, 0.88);
  --ref-stroke: rgba(255, 255, 255, 0.12);
  --ref-stroke-strong: rgba(128, 255, 240, 0.28);
  --ref-text: rgba(245, 250, 255, 0.96);
  --ref-muted: rgba(198, 213, 224, 0.66);
  --ref-faint: rgba(198, 213, 224, 0.44);
  --ref-aqua: #80fff0;
  --ref-cyan: #70c8ff;
  --ref-violet: #a78bfa;
  --ref-amber: #ffd166;
  --ref-danger: #ff7b8a;
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --shadow-lg: 0 24px 90px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --shadow-md: 0 18px 48px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --blur-glass: blur(22px) saturate(145%);
  --primary: var(--ref-aqua);
  --primary-strong: #ecfffc;
  --primary-soft: rgba(128, 255, 240, 0.14);
  --muted: var(--ref-muted);
  --line: var(--ref-stroke);
  --line-strong: rgba(128, 255, 240, 0.34);
  --panel-edge: var(--ref-stroke);
  --panel-edge-strong: var(--ref-stroke-strong);
  --panel-glass: var(--ref-card);
  --panel-glass-strong: var(--ref-card-strong);
  --focus-ring: 0 0 0 4px rgba(128, 255, 240, 0.1), 0 0 34px rgba(112, 200, 255, 0.13);
}

body {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Display",
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  background:
    radial-gradient(circle at 12% 12%, rgba(128, 255, 240, 0.16), transparent 34%),
    radial-gradient(circle at 80% 4%, rgba(112, 200, 255, 0.16), transparent 32%),
    radial-gradient(circle at 90% 82%, rgba(255, 120, 80, 0.11), transparent 38%),
    linear-gradient(135deg, #03100f 0%, #06070d 48%, #100a0d 100%);
}

body::before {
  opacity: 0.38;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0.2) 65%, transparent);
}

body::after {
  position: fixed;
  top: -300px;
  right: -280px;
  z-index: 0;
  width: 760px;
  height: 760px;
  pointer-events: none;
  background: conic-gradient(from 180deg, transparent, rgba(128, 255, 240, 0.24), rgba(167, 139, 250, 0.18), transparent 68%);
  content: "";
  filter: blur(68px);
  opacity: 0.58;
}

.auth-shell {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  padding: clamp(18px, 4vw, 54px);
  background:
    linear-gradient(90deg, rgba(2, 5, 7, 0.82), rgba(2, 5, 7, 0.38) 48%, rgba(2, 5, 7, 0.72)),
    linear-gradient(180deg, rgba(2, 5, 7, 0.2), rgba(2, 5, 7, 0.72)),
    url("assets/login-bg.png") center / cover no-repeat;
}

.auth-shell,
.library-shell {
  position: relative;
  z-index: 1;
}

.auth-shell::before {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 22% 16%, rgba(128, 255, 240, 0.18), transparent 32%),
    radial-gradient(circle at 78% 8%, rgba(112, 200, 255, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.48));
  content: "";
  pointer-events: none;
}

.auth-shell::after {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 52px 52px;
  content: "";
  z-index: 0;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 72%);
  pointer-events: none;
}

.auth-panel {
  position: relative;
  z-index: 2;
  width: min(460px, calc(100vw - 32px));
  gap: 24px;
  padding: 24px;
  border-color: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.045)),
    rgba(8, 13, 18, 0.72);
  box-shadow: var(--shadow-lg);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
}

.auth-brand {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.055);
}

.auth-brand .brand-mark,
.library-brand .brand-mark {
  border-radius: 15px;
  color: #061416;
  background: linear-gradient(135deg, #7ffff0, #6dd6ff 78%);
  box-shadow: 0 14px 34px rgba(112, 200, 255, 0.28), inset 0 -1px 0 rgba(0, 0, 0, 0.26);
}

.auth-brand h1 {
  font-size: 20px;
  letter-spacing: -0.035em;
}

.auth-form label {
  color: rgba(245, 250, 255, 0.76);
  font-weight: 850;
}

.auth-form input {
  margin-top: 8px;
  min-height: 52px;
}

.library-shell {
  width: min(1540px, calc(100vw - 44px));
  min-height: calc(100vh - 36px);
  margin: 18px auto;
  padding: 0;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 22px;
}

.library-sidebar {
  top: 18px;
  min-height: calc(100vh - 36px);
  padding: 20px;
  overflow: hidden;
  border-color: var(--ref-stroke);
  border-radius: var(--radius-xl);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035));
  box-shadow: var(--shadow-md);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
}

.library-brand {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.055);
}

.library-brand h1 {
  font-size: 16px;
  letter-spacing: -0.03em;
}

.library-nav,
.sidebar-section {
  gap: 10px;
}

.library-nav-button,
.future-tool-button {
  min-height: 54px;
  padding: 10px 12px;
  border-color: rgba(255, 255, 255, 0.075);
  border-radius: 18px;
  color: var(--ref-muted);
  background: rgba(255, 255, 255, 0.035);
  transition:
    transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
    background 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
    color 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.library-nav-button:hover,
.library-nav-button.active {
  border-color: rgba(128, 255, 240, 0.38);
  color: var(--ref-text);
  background: linear-gradient(135deg, rgba(128, 255, 240, 0.17), rgba(112, 200, 255, 0.06));
  box-shadow: inset 3px 0 0 rgba(128, 255, 240, 0.85), 0 16px 40px rgba(0, 0, 0, 0.24);
  transform: translateY(-1px);
}

.library-main {
  gap: 18px;
}

.view-panel.active {
  display: grid;
  gap: 18px;
}

.app-header {
  min-height: 90px;
  padding: 18px 20px;
  border-radius: 28px;
}

.hub-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 310px;
  align-items: end;
  padding: clamp(22px, 3vw, 36px);
  border-radius: var(--radius-xl);
}

.hub-header h1 {
  max-width: 820px;
  background: linear-gradient(135deg, #f7ffff 0%, #84fff2 42%, #8ac7ff 78%, #ffd0b2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: clamp(42px, 5vw, 76px);
  letter-spacing: -0.075em;
  line-height: 0.96;
}

.hub-header p {
  max-width: 720px;
  margin-top: 18px;
  color: var(--ref-muted);
  font-size: 15px;
  line-height: 1.7;
}

.home-command-panel,
.home-metrics-grid,
.home-workbench-grid,
.hub-grid,
.content-grid,
.toolbar,
.site-list-wrap,
.clue-capture-panel,
.ai-inbox-panel,
.pp-hero,
.pp-dashboard,
.pp-dashboard-v8,
.admin-metrics-grid,
.admin-section,
.ledger-dashboard,
.ledger-layout {
  max-width: 1540px;
}

.home-command-panel,
.home-panel,
.hub-card,
.stats-panel,
.toolbar,
.site-list-wrap,
.clue-capture-panel,
.ai-inbox-main,
.ai-preview-panel,
.admin-tool-card,
.admin-backup-panel,
.integration-card,
.option-manager-panel,
.prompt-library-panel,
.ledger-panel,
.ledger-settings-panel,
.pp-account-panel,
.pp-record-panel,
.pp-history-panel,
.pp-global-panel,
.pp-account-card,
.pp-record-row,
.ledger-group-card,
.ledger-entry-row,
.ledger-withdrawal-row,
.site-card,
.clue-card {
  border-color: rgba(255, 255, 255, 0.09);
  border-radius: 23px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.035));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 18px 48px rgba(0, 0, 0, 0.24);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
}

.home-command-panel {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 18px;
  border-radius: 28px;
}

.home-metrics-grid {
  gap: 14px;
}

.home-metric-card {
  min-height: 140px;
  padding: 18px;
  border-color: rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.055);
}

.home-metric-card strong {
  font-size: 42px;
  letter-spacing: -0.06em;
}

.hub-grid {
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
}

.hub-card {
  position: relative;
  min-height: 240px;
  padding: 20px;
  overflow: hidden;
}

.hub-card::before,
.home-panel::before,
.site-card::before,
.clue-card::before,
.pp-account-card::before,
.ledger-group-card::before,
.admin-tool-card::before {
  position: absolute;
  inset: 0;
  height: auto;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(circle at 85% 0%, rgba(128, 255, 240, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(128, 255, 240, 0.08), transparent 48%);
  content: "";
  opacity: 0.72;
}

.hub-card > *,
.home-panel > *,
.site-card > *,
.clue-card > *,
.pp-account-card > *,
.ledger-group-card > *,
.admin-tool-card > * {
  position: relative;
}

.hub-card:hover,
.home-metric-card:hover,
.home-panel:hover,
.site-card:hover,
.clue-card:hover,
.pp-account-card:hover,
.ledger-group-card:hover,
.admin-tool-card:hover {
  border-color: rgba(128, 255, 240, 0.26);
  background: linear-gradient(145deg, rgba(128, 255, 240, 0.09), rgba(255, 255, 255, 0.04));
  transform: translateY(-3px);
}

.primary-button,
.secondary-button,
.danger-button,
.icon-text-button,
.ghost-button,
.icon-button,
.mini-icon-button,
.segmented-button,
.view-toggle button,
.filter-chip,
.tag-chip,
.option-chip,
.collection-button {
  min-height: 46px;
  border-radius: 15px;
}

.primary-button {
  color: #031414;
  border-color: rgba(128, 255, 240, 0.65);
  background: linear-gradient(135deg, #8affee, #72cfff);
  box-shadow: 0 18px 46px rgba(114, 207, 255, 0.18);
}

.primary-button:hover {
  box-shadow: 0 24px 62px rgba(114, 207, 255, 0.31);
}

input,
textarea,
select {
  border-radius: 16px;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.24);
}

input,
select {
  min-height: 50px;
  padding-right: 15px;
  padding-left: 15px;
}

textarea {
  padding: 15px;
  line-height: 1.65;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(128, 255, 240, 0.48);
  background: rgba(0, 0, 0, 0.32);
  box-shadow: var(--focus-ring);
}

.search-box,
.home-search-box {
  min-height: 54px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
}

.site-dialog,
.clue-dialog {
  border-radius: 28px;
}

.site-form {
  border-radius: inherit;
}

.dialog-header,
.dialog-actions {
  background:
    linear-gradient(180deg, rgba(18, 29, 41, 0.9), rgba(10, 15, 21, 0.72)),
    rgba(8, 13, 18, 0.86);
}

.tag-pill,
.meta-chip,
.status,
.source-pill,
.site-type,
.site-status,
.clue-type,
.clue-status,
.pp-badge,
.tool-status,
.badge {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
}

.tag-pill.warm,
.status.clue-status {
  color: #071414;
  border-color: transparent;
  background: linear-gradient(135deg, var(--ref-aqua), var(--ref-cyan));
  font-weight: 900;
}

@media (max-width: 980px) {
  .library-shell {
    width: min(100%, calc(100vw - 24px));
    grid-template-columns: 1fr;
    margin: 12px auto;
  }

  .library-sidebar {
    min-height: auto;
  }

  .hub-header,
  .home-command-panel {
    grid-template-columns: 1fr;
  }

  .hub-header h1 {
    font-size: clamp(38px, 10vw, 56px);
  }
}

@media (max-width: 620px) {
  .auth-shell {
    padding: 14px;
  }

  .auth-panel,
  .library-sidebar,
  .app-header,
  .hub-header,
  .home-command-panel,
  .home-panel,
  .hub-card,
  .site-card,
  .clue-card {
    border-radius: 22px;
  }
}

/* UI redesign v2: high-end SaaS toolbox shell */
:root {
  --ui-bg-deep: #050913;
  --ui-bg-panel: rgba(9, 17, 29, 0.72);
  --ui-bg-panel-strong: rgba(12, 23, 38, 0.88);
  --ui-border: rgba(180, 245, 255, 0.14);
  --ui-border-strong: rgba(104, 241, 255, 0.34);
  --ui-text: #f4fbff;
  --ui-text-soft: #b8c9d7;
  --ui-text-muted: #7f96a8;
  --ui-cyan: #00f5ff;
  --ui-blue: #54a8ff;
  --ui-mint: #70ffe2;
  --ui-purple: #9b7cff;
  --ui-amber: #ffc166;
  --ui-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  --ui-soft-shadow: 0 14px 42px rgba(0, 0, 0, 0.26);
  --ui-radius-xl: 28px;
  --ui-radius-lg: 22px;
  --ui-radius-md: 16px;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 0;
  overflow-x: hidden;
  color: var(--ui-text);
  background:
    radial-gradient(circle at 12% 8%, rgba(0, 245, 255, 0.16), transparent 30%),
    radial-gradient(circle at 84% 4%, rgba(155, 124, 255, 0.16), transparent 28%),
    radial-gradient(circle at 76% 78%, rgba(112, 255, 226, 0.12), transparent 32%),
    linear-gradient(145deg, #050913 0%, #08111e 48%, #03060d 100%);
  font-size: 16px;
  letter-spacing: 0;
}

body::before {
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 72%);
  opacity: 0.32;
}

body.calm-focus-mode {
  --ui-cyan: #92fff1;
  --ui-blue: #8dc7ff;
  --ui-purple: #b5a4ff;
}

.auth-panel {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(145deg, rgba(8, 15, 25, 0.74), rgba(4, 9, 16, 0.56)),
    rgba(4, 8, 14, 0.76);
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(24px) saturate(1.16);
}

.library-shell {
  width: min(1680px, calc(100vw - 32px));
  min-height: calc(100vh - 32px);
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  margin: 16px auto;
  padding: 0;
}

.library-main {
  display: block;
  min-width: 0;
}

.library-sidebar {
  position: sticky;
  top: 16px;
  min-height: calc(100vh - 32px);
  padding: 18px 14px;
  border: 1px solid var(--ui-border);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(12, 24, 40, 0.82), rgba(5, 10, 18, 0.72)),
    rgba(9, 18, 31, 0.76);
  box-shadow: var(--ui-soft-shadow);
}

.library-brand {
  gap: 12px;
  margin-bottom: 14px;
  padding: 8px 6px 18px;
}

.library-brand h1 {
  font-size: 18px;
}

.library-brand p {
  font-size: 12px;
}

.brand-mark {
  box-shadow:
    0 0 28px rgba(0, 245, 255, 0.22),
    inset 0 0 18px rgba(255, 255, 255, 0.08);
}

.library-nav {
  gap: 8px;
}

.library-nav-button,
.future-tool-button {
  min-height: 52px;
  padding: 10px 12px;
  border-radius: 16px;
  border-color: transparent;
  background: transparent;
}

.library-nav-button:hover,
.future-tool-button:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.055);
}

.library-nav-button.active {
  border-color: rgba(0, 245, 255, 0.34);
  background:
    linear-gradient(135deg, rgba(0, 245, 255, 0.18), rgba(84, 168, 255, 0.08)),
    rgba(255, 255, 255, 0.055);
  box-shadow: 0 14px 36px rgba(0, 245, 255, 0.11);
}

.sidebar-section {
  padding-top: 14px;
}

.global-topbar {
  position: sticky;
  top: 16px;
  z-index: 60;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  width: min(1440px, 100%);
  min-height: 74px;
  margin: 0 auto 18px;
  padding: 12px 14px 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(10, 21, 36, 0.78), rgba(4, 9, 17, 0.62)),
    rgba(7, 13, 23, 0.76);
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(24px) saturate(1.2);
}

.global-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

.global-brand strong,
.global-brand span {
  display: block;
}

.global-brand strong {
  font-size: 16px;
  font-weight: 900;
}

.global-brand span {
  color: var(--ui-text-muted);
  font-size: 11px;
  text-transform: uppercase;
}

.global-nav {
  display: flex;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.global-nav button,
.topbar-icon-button,
.topbar-admin-button,
.topbar-menu-button {
  border: 1px solid transparent;
  color: var(--ui-text-soft);
  background: transparent;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.global-nav button {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 800;
  white-space: nowrap;
}

.global-nav button:hover,
.global-nav button.active {
  color: var(--ui-text);
  border-color: rgba(0, 245, 255, 0.22);
  background: rgba(0, 245, 255, 0.1);
}

.global-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.topbar-icon-button,
.topbar-admin-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  gap: 8px;
  border-radius: 14px;
  padding: 0 12px;
  white-space: nowrap;
}

.topbar-icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.topbar-icon-button:hover {
  color: var(--ui-text);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.topbar-admin-button {
  color: #031418;
  border-color: rgba(112, 255, 226, 0.7);
  background: linear-gradient(135deg, var(--ui-mint), #77cfff);
  box-shadow: 0 16px 42px rgba(0, 245, 255, 0.14);
  font-weight: 900;
}

.topbar-admin-button:hover,
.primary-button:hover,
.secondary-button:hover,
.icon-text-button:hover,
.ghost-button:hover {
  transform: translateY(-1px) scale(1.01);
}

.topbar-menu-button {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  padding: 0;
}

.topbar-menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 99px;
  background: currentColor;
}

.view-panel.active {
  display: block;
  min-width: 0;
}

.app-header,
.home-command-panel,
.home-metrics-grid,
.home-workbench-grid,
.hub-grid,
.framework-panel,
.content-grid,
.toolbar,
.site-list-wrap,
.clue-capture-panel,
.ai-inbox-panel,
.pp-hero,
.pp-shell,
.ledger-shell,
.admin-layout {
  width: min(1440px, 100%);
  max-width: none;
  margin-right: auto;
  margin-left: auto;
}

.hub-header {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, auto);
  min-height: clamp(390px, 42vh, 560px);
  align-items: end;
  gap: 28px;
  overflow: hidden;
  padding: clamp(30px, 5vw, 62px);
  border-radius: 34px;
  background:
    radial-gradient(circle at 16% 22%, rgba(0, 245, 255, 0.26), transparent 28%),
    radial-gradient(circle at 78% 6%, rgba(155, 124, 255, 0.2), transparent 30%),
    linear-gradient(135deg, rgba(15, 32, 54, 0.92), rgba(5, 10, 18, 0.76));
  box-shadow: var(--ui-shadow);
}

.hub-header::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.052) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.052) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at 30% 30%, black, transparent 76%);
  content: "";
  opacity: 0.48;
}

.hub-header > * {
  position: relative;
  z-index: 1;
}

.hub-header .title-group {
  align-items: flex-start;
  gap: 18px;
}

.hub-header .brand-mark {
  width: 58px;
  height: 58px;
  font-size: 25px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin-bottom: 14px;
  color: var(--ui-cyan);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hub-header h1 {
  max-width: 900px;
  font-size: clamp(56px, 8vw, 112px);
  line-height: 0.92;
  letter-spacing: 0;
  background: linear-gradient(135deg, #ffffff 0%, #a8fff8 36%, #7fc8ff 68%, #ffe1bb 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.hub-header p {
  max-width: 760px;
  margin-top: 20px;
  color: #c8d7e4;
  font-size: clamp(17px, 1.8vw, 22px);
  line-height: 1.75;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero-badges span,
.home-category-pills button,
.tool-status,
.framework-steps span {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.065);
  backdrop-filter: blur(14px);
}

.hero-badges span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  color: #dffbff;
  font-weight: 800;
}

.hub-header .header-actions {
  justify-content: flex-end;
  max-width: 420px;
}

.hub-header .header-actions .primary-button,
.hub-header .header-actions .secondary-button {
  width: 100%;
  justify-content: center;
}

.hero-action {
  min-height: 54px;
  font-size: 15px;
}

.home-command-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  border-radius: 28px;
}

.home-search-box {
  min-height: 68px;
  padding: 0 10px 0 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.home-search-box input {
  min-height: 64px;
  font-size: 18px;
}

.home-search-box .primary-button {
  min-height: 48px;
  padding: 0 24px;
}

.home-category-pills {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: thin;
}

.home-category-pills button {
  min-height: 40px;
  flex: 0 0 auto;
  border-radius: 999px;
  color: var(--ui-text-soft);
  padding: 0 16px;
  font-weight: 850;
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.home-category-pills button:hover,
.home-category-pills button.active {
  color: #031416;
  border-color: rgba(112, 255, 226, 0.72);
  background: linear-gradient(135deg, var(--ui-mint), #75d2ff);
}

.home-quick-actions {
  justify-content: flex-start;
  gap: 10px;
}

.home-metrics-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}

.home-metric-card {
  min-height: 150px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px;
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035)),
    rgba(9, 17, 29, 0.66);
}

.home-metric-card span {
  color: var(--ui-text-soft);
  font-size: 14px;
  font-weight: 850;
}

.home-metric-card strong {
  margin-top: 18px;
  font-size: clamp(38px, 4vw, 54px);
  letter-spacing: 0;
}

.home-workbench-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.home-panel,
.hub-card,
.framework-panel,
.stats-panel,
.toolbar,
.site-list-wrap,
.clue-capture-panel,
.ai-inbox-panel,
.pp-card,
.pp-account-card,
.ledger-group-card,
.admin-tool-card {
  border: 1px solid var(--ui-border);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.032)),
    var(--ui-bg-panel);
  box-shadow: var(--ui-soft-shadow);
  backdrop-filter: blur(22px) saturate(1.08);
}

.home-panel {
  min-height: 280px;
  padding: 20px;
  border-radius: 24px;
}

.home-panel-header h2 {
  font-size: 20px;
}

.hub-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.hub-card {
  min-height: 270px;
  padding: 24px;
  border-radius: 26px;
  cursor: pointer;
}

.hub-card.is-filtered-out {
  display: none !important;
}

.hub-card h2 {
  margin-top: 24px;
  font-size: 24px;
  line-height: 1.2;
}

.hub-card p {
  margin-top: 12px;
  color: var(--ui-text-soft);
  font-size: 15px;
  line-height: 1.72;
}

.hub-card:hover,
.home-panel:hover,
.home-metric-card:hover,
.site-card:hover,
.clue-card:hover,
.pp-account-card:hover,
.ledger-group-card:hover,
.admin-tool-card:hover {
  border-color: var(--ui-border-strong);
  box-shadow:
    0 26px 80px rgba(0, 0, 0, 0.34),
    0 0 44px rgba(0, 245, 255, 0.08);
  transform: translateY(-4px);
}

.tool-icon {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  color: #031416;
  background: linear-gradient(135deg, var(--ui-mint), #72cfff);
  box-shadow: 0 16px 38px rgba(0, 245, 255, 0.18);
  font-size: 17px;
  font-weight: 950;
}

.tool-icon.warm {
  background: linear-gradient(135deg, #ffd07a, #ff8ec6);
}

.tool-icon.cool {
  background: linear-gradient(135deg, #8e7cff, #67d8ff);
}

.tool-icon.mint {
  background: linear-gradient(135deg, #6fffe6, #a5ffbf);
}

.tool-icon.muted {
  color: #d8e8f0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
}

.tool-status {
  color: var(--ui-text-soft);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
}

.primary-tool-card .tool-status {
  color: #031416;
  border-color: transparent;
  background: linear-gradient(135deg, var(--ui-mint), #76cdff);
}

.tool-metrics {
  margin-top: auto;
  padding-top: 22px;
}

.tool-metrics span {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.toolbox-about-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px;
  border-radius: 28px;
}

.toolbox-about-panel h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 38px);
}

.toolbox-about-panel p {
  max-width: 680px;
  margin: 12px 0 0;
  color: var(--ui-text-soft);
  line-height: 1.72;
}

.framework-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.framework-steps span {
  min-height: 42px;
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--ui-text-soft);
}

.app-header:not(.hub-header) {
  padding: 26px;
  border-radius: 28px;
}

.app-header:not(.hub-header) h1 {
  font-size: clamp(28px, 4vw, 46px);
  letter-spacing: 0;
}

.toolbar {
  gap: 12px;
  padding: 16px;
  border-radius: 24px;
}

.content-grid {
  grid-template-columns: minmax(230px, 270px) minmax(0, 1fr);
  gap: 18px;
}

.stats-panel,
.site-list-wrap {
  border-radius: 24px;
}

.stats-panel {
  position: sticky;
  top: 108px;
  align-self: start;
}

.site-card,
.clue-card,
.pp-account-card,
.ledger-group-card {
  border-radius: 22px;
}

input,
textarea,
select {
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}

button,
a,
input,
textarea,
select {
  outline-offset: 4px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(0, 245, 255, 0.72);
}

@media (min-width: 1340px) {
  .hub-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .library-shell {
    width: min(100%, calc(100vw - 24px));
    grid-template-columns: 1fr;
    margin: 12px auto;
  }

  .library-sidebar {
    position: relative;
    top: auto;
    min-height: auto;
  }

  .library-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sidebar-section {
    display: none;
  }

  .global-topbar {
    top: 12px;
    grid-template-columns: auto auto;
  }

  .global-nav,
  .global-actions {
    display: none;
  }

  .topbar-menu-button {
    display: inline-block;
    justify-self: end;
  }

  .library-shell.top-nav-open .global-nav,
  .library-shell.top-nav-open .global-actions {
    display: grid;
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .library-shell.top-nav-open .global-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .library-shell.top-nav-open .global-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hub-header {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hub-header .header-actions {
    max-width: none;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .stats-panel {
    position: relative;
    top: auto;
  }
}

@media (max-width: 767px) {
  body {
    font-size: 15px;
  }

  .library-shell {
    width: min(100%, calc(100vw - 18px));
    gap: 12px;
    margin: 9px auto;
  }

  .library-sidebar,
  .global-topbar,
  .hub-header,
  .home-command-panel,
  .home-panel,
  .hub-card,
  .framework-panel,
  .app-header:not(.hub-header),
  .toolbar,
  .site-list-wrap,
  .clue-capture-panel,
  .ai-inbox-panel {
    border-radius: 20px;
  }

  .library-nav {
    grid-template-columns: 1fr 1fr;
  }

  .library-nav-button strong {
    font-size: 12px;
  }

  .global-brand {
    min-width: 0;
  }

  .global-brand span {
    display: none;
  }

  .library-shell.top-nav-open .global-nav,
  .library-shell.top-nav-open .global-actions {
    grid-template-columns: 1fr;
  }

  .hub-header {
    padding: 26px 20px;
  }

  .hub-header .title-group {
    display: block;
  }

  .hub-header .brand-mark {
    margin-bottom: 16px;
  }

  .hub-header h1 {
    font-size: clamp(46px, 14vw, 68px);
  }

  .hub-header p {
    font-size: 16px;
  }

  .home-search-box {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    min-height: auto;
    padding: 12px;
  }

  .home-search-box .primary-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .home-quick-actions,
  .header-actions,
  .framework-steps {
    flex-direction: column;
    align-items: stretch;
  }

  .home-quick-actions button,
  .header-actions button,
  .topbar-icon-button,
  .topbar-admin-button {
    width: 100%;
  }

  .home-metrics-grid,
  .home-workbench-grid,
  .hub-grid {
    grid-template-columns: 1fr;
  }

  .toolbox-about-panel {
    display: block;
    padding: 22px;
  }

  .framework-steps {
    justify-content: flex-start;
    margin-top: 18px;
  }
}

/* UI density pass: keep premium feel, reduce empty space */
@media (min-width: 1181px) {
  .library-shell {
    width: min(1560px, calc(100vw - 28px));
    grid-template-columns: 204px minmax(0, 1fr);
    gap: 16px;
    margin: 12px auto;
  }

  .library-sidebar {
    top: 12px;
    align-content: start;
    min-height: calc(100vh - 24px);
    gap: 10px;
    padding: 12px;
    border-radius: 22px;
  }

  .library-brand {
    min-height: 0 !important;
    margin-bottom: 8px;
    padding: 10px !important;
    border-radius: 16px;
  }

  .library-brand .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    font-size: 16px;
  }

  .library-brand h1 {
    font-size: 15px;
    line-height: 1.15;
  }

  .library-brand p {
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.35;
  }

  .library-nav,
  .sidebar-section {
    gap: 7px;
  }

  .library-nav-button,
  .future-tool-button {
    min-height: 44px;
    padding: 8px 10px;
    border-radius: 13px;
    font-size: 13px;
  }

  .library-nav-button strong,
  .future-tool-button strong {
    font-size: 10px;
  }

  .sidebar-label {
    margin: 2px 0;
    font-size: 11px;
  }

  .global-topbar {
    top: 12px;
    min-height: 58px;
    margin-bottom: 12px;
    padding: 8px 10px 8px 12px;
    border-radius: 20px;
  }

  .global-brand .brand-mark {
    width: 34px;
    height: 34px;
  }

  .global-nav button,
  .topbar-icon-button,
  .topbar-admin-button {
    min-height: 36px;
    border-radius: 12px;
    font-size: 13px;
  }

  .global-nav button {
    padding: 0 12px;
  }

  #homeView > .app-header,
  #homeView > section {
    margin-bottom: 12px;
  }

  .app-header,
  .home-command-panel,
  .home-metrics-grid,
  .home-workbench-grid,
  .hub-grid,
  .framework-panel,
  .content-grid,
  .toolbar,
  .site-list-wrap,
  .clue-capture-panel,
  .ai-inbox-panel,
  .pp-hero,
  .pp-shell,
  .ledger-shell,
  .admin-layout {
    width: min(1320px, 100%);
  }

  .hub-header {
    min-height: 330px;
    grid-template-columns: minmax(0, 1.35fr) minmax(250px, 336px);
    gap: 22px;
    padding: 34px 42px;
    border-radius: 28px;
  }

  .hub-header .brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    font-size: 21px;
  }

  .hub-header .title-group {
    gap: 14px;
  }

  .hero-eyebrow {
    margin-bottom: 8px;
    font-size: 11px;
  }

  .hub-header h1 {
    font-size: clamp(58px, 6.2vw, 88px);
    line-height: 0.96;
  }

  .hub-header p {
    max-width: 720px;
    margin-top: 12px;
    font-size: 18px;
    line-height: 1.55;
  }

  .hero-badges {
    gap: 8px;
    margin-top: 14px;
  }

  .hero-badges span {
    min-height: 30px;
    padding: 0 11px;
    font-size: 13px;
  }

  .hub-header .header-actions {
    gap: 8px;
    max-width: 336px;
  }

  .hub-header .header-actions .primary-button,
  .hub-header .header-actions .secondary-button,
  .hero-action {
    min-height: 42px;
    border-radius: 13px;
    font-size: 13px;
  }

  .home-command-panel {
    gap: 10px;
    padding: 12px;
    border-radius: 22px;
  }

  .home-search-box {
    min-height: 54px;
    border-radius: 17px;
    padding-left: 14px;
  }

  .home-search-box input {
    min-height: 50px;
    font-size: 15px;
  }

  .home-search-box .primary-button {
    min-height: 40px;
    padding: 0 18px;
    border-radius: 12px;
  }

  .home-category-pills {
    gap: 8px;
    padding-bottom: 4px;
  }

  .home-category-pills button {
    min-height: 32px;
    padding: 0 12px;
    font-size: 13px;
  }

  .home-quick-actions {
    gap: 8px;
  }

  .home-quick-actions .primary-button,
  .home-quick-actions .secondary-button {
    min-height: 38px;
    border-radius: 12px;
    font-size: 13px;
  }

  .home-metrics-grid {
    grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
    gap: 10px;
  }

  .home-metric-card {
    min-height: 104px;
    padding: 14px 16px;
    border-radius: 18px;
  }

  .home-metric-card span {
    font-size: 12px;
  }

  .home-metric-card strong {
    margin-top: 8px;
    font-size: 39px;
    line-height: 1;
  }

  .home-workbench-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }

  .home-panel {
    min-height: 218px;
    padding: 16px;
    border-radius: 20px;
  }

  .home-panel-header h2 {
    font-size: 17px;
  }

  .hub-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }

  .hub-card {
    min-height: 218px;
    padding: 18px;
    border-radius: 20px;
  }

  .tool-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-size: 14px;
  }

  .tool-status {
    padding: 5px 8px;
    font-size: 11px;
  }

  .hub-card h2 {
    margin-top: 16px;
    font-size: 20px;
  }

  .hub-card p {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.55;
  }

  .tool-metrics {
    padding-top: 14px;
  }

  .toolbox-about-panel {
    padding: 20px;
    border-radius: 22px;
  }
}

/* UI simplification pass: remove duplicate navigation and make sidebar truly optional */
.global-topbar {
  grid-template-columns: auto auto minmax(0, 1fr) auto;
}

.global-nav,
.topbar-menu-button,
.hero-legacy-actions[hidden] {
  display: none !important;
}

.topbar-context {
  min-width: 0;
  color: var(--ui-text-muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.topbar-sidebar-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  color: var(--ui-text-soft);
  background: rgba(255, 255, 255, 0.055);
  font-weight: 900;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.topbar-sidebar-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.topbar-sidebar-button:hover,
.topbar-sidebar-button[aria-pressed="true"] {
  color: #031416;
  border-color: rgba(112, 255, 226, 0.72);
  background: linear-gradient(135deg, var(--ui-mint), #75d2ff);
}

.library-shell.sidebar-hidden {
  grid-template-columns: minmax(0, 1fr);
}

.library-shell.sidebar-hidden .library-sidebar {
  display: none;
}

.library-shell.sidebar-hidden .library-main,
.library-shell.sidebar-hidden .global-topbar,
.library-shell.sidebar-hidden .app-header,
.library-shell.sidebar-hidden .home-command-panel,
.library-shell.sidebar-hidden .home-metrics-grid,
.library-shell.sidebar-hidden .home-workbench-grid,
.library-shell.sidebar-hidden .hub-grid,
.library-shell.sidebar-hidden .framework-panel,
.library-shell.sidebar-hidden .content-grid,
.library-shell.sidebar-hidden .toolbar,
.library-shell.sidebar-hidden .site-list-wrap,
.library-shell.sidebar-hidden .clue-capture-panel,
.library-shell.sidebar-hidden .ai-inbox-panel,
.library-shell.sidebar-hidden .pp-hero,
.library-shell.sidebar-hidden .pp-shell,
.library-shell.sidebar-hidden .ledger-shell,
.library-shell.sidebar-hidden .admin-layout {
  width: min(1440px, 100%);
}

.hub-header {
  grid-template-columns: minmax(0, 1fr) !important;
}

.hub-header .title-group {
  max-width: 980px;
}

.hub-header .header-actions[hidden] {
  display: none !important;
}

@media (min-width: 1181px) {
  .global-topbar {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
  }

  .topbar-sidebar-button,
  .topbar-icon-button,
  .topbar-admin-button {
    min-height: 36px;
    border-radius: 12px;
    font-size: 13px;
  }

  .hub-header {
    min-height: 275px;
    padding: 32px 40px;
  }

  .hub-header h1 {
    font-size: clamp(56px, 5.6vw, 82px);
  }
}

@media (max-width: 767px) {
  .global-topbar {
    grid-template-columns: auto 1fr;
  }

  .topbar-context {
    display: none;
  }

  .topbar-sidebar-button {
    width: auto;
    padding: 0 12px;
  }

  .global-brand {
    justify-self: end;
  }
}

@media (max-width: 1180px) {
  .global-topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .topbar-context {
    display: none;
  }

  .global-actions {
    display: flex !important;
    gap: 8px;
  }
}

@media (max-width: 767px) {
  .global-topbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .global-actions {
    display: grid !important;
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
    margin-top: 4px;
  }

  .topbar-icon-button,
  .topbar-admin-button {
    width: 100%;
  }
}

/* Clue sidebar fix: keep filters readable inside the narrow left panel */
#cluesToolView .stats-panel {
  display: grid !important;
  grid-template-columns: 1fr !important;
  align-content: start;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}

#cluesToolView .stats-panel > div:not(.tag-list),
#cluesToolView .collection-list,
#cluesToolView .tag-list {
  grid-column: 1 / -1 !important;
  min-width: 0;
}

#cluesToolView .collection-list {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 8px;
  padding-top: 2px;
}

#cluesToolView .collection-button {
  width: 100%;
  min-width: 0;
  flex: none !important;
  justify-content: space-between;
  overflow: hidden;
}

#cluesToolView .collection-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#cluesToolView .collection-button strong {
  flex: 0 0 auto;
  margin-left: 10px;
}

#cluesToolView .tag-list {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px;
  overflow: hidden;
  padding-top: 4px;
}

#cluesToolView .tag-list .tag-pill {
  max-width: 100%;
  min-height: 32px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  #cluesToolView .stats-panel {
    grid-template-columns: 1fr !important;
  }
}
