:root {
  color-scheme: dark;
  --bg: #050608;
  --panel: #0d1117;
  --panel-soft: #111821;
  --ink: #eef6f7;
  --muted: #91a0ad;
  --line: #24303c;
  --line-strong: #3b4a56;
  --teal: #20d6bf;
  --teal-dark: #14a595;
  --gold: #f4c95d;
  --amber: #f59e0b;
  --rose: #fb7185;
  --green: #34d399;
  --blue: #60a5fa;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.46);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-soft: #f7fafc;
  --ink: #10202b;
  --muted: #617283;
  --line: #d8e2ea;
  --line-strong: #bccbd8;
  --teal: #0f9f90;
  --teal-dark: #0b8075;
  --gold: #b88914;
  --amber: #b7791f;
  --rose: #dc4261;
  --green: #168a61;
  --blue: #2563eb;
  --shadow: 0 16px 36px rgba(15, 32, 45, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(32, 214, 191, 0.06), transparent 340px),
    var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

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

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  padding: 20px clamp(18px, 4vw, 52px);
  background:
    linear-gradient(180deg, rgba(13, 17, 23, 0.98), rgba(8, 11, 15, 0.94)),
    #0d1117;
  border-bottom: 1px solid rgba(32, 214, 191, 0.24);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
}

.title-block {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  color: var(--ink);
  font-size: clamp(23px, 3vw, 32px);
}

h2 {
  color: var(--ink);
  font-size: 18px;
}

.brand-logo {
  position: relative;
  justify-self: center;
  display: grid;
  min-width: 258px;
  min-height: 86px;
  padding: 17px 54px 15px 28px;
  overflow: hidden;
  border: 1px solid rgba(244, 201, 93, 0.64);
  border-radius: 12px;
  background:
    radial-gradient(circle at 18% 14%, rgba(244, 201, 93, 0.28), transparent 28%),
    radial-gradient(circle at 86% 20%, rgba(220, 38, 38, 0.20), transparent 24%),
    linear-gradient(135deg, rgba(244, 201, 93, 0.20), rgba(32, 214, 191, 0.12) 47%, rgba(96, 165, 250, 0.12)),
    rgba(5, 6, 8, 0.92);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.07) inset,
    0 0 34px rgba(244, 201, 93, 0.18),
    0 0 28px rgba(32, 214, 191, 0.18),
    0 18px 42px rgba(0, 0, 0, 0.52);
  text-align: center;
  animation: brand-pulse 5.8s ease-in-out infinite;
}

.brand-logo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.14) 44%, transparent 62%);
  transform: translateX(-110%);
  animation: brand-shine 5.6s ease-in-out infinite;
}

.brand-logo::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 9px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #b91c1c, var(--gold), var(--teal), transparent);
  opacity: 0.92;
}

.brand-mountain {
  position: absolute;
  left: 20px;
  right: 54px;
  top: 10px;
  height: 34px;
  opacity: 0.46;
  pointer-events: none;
}

.brand-mountain::before,
.brand-mountain::after {
  content: "";
  position: absolute;
  bottom: 0;
  background: linear-gradient(135deg, rgba(244, 201, 93, 0.80), rgba(32, 214, 191, 0.18));
  clip-path: polygon(0 100%, 24% 42%, 36% 72%, 54% 18%, 70% 62%, 84% 34%, 100% 100%);
}

.brand-mountain::before {
  left: 0;
  width: 72%;
  height: 100%;
}

.brand-mountain::after {
  right: 0;
  width: 52%;
  height: 78%;
  opacity: 0.62;
  transform: translateY(5px);
}

.brand-seal {
  position: absolute;
  z-index: 2;
  top: 13px;
  right: 17px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(248, 113, 113, 0.76);
  border-radius: 5px;
  background:
    linear-gradient(135deg, rgba(127, 29, 29, 0.95), rgba(220, 38, 38, 0.62)),
    #7f1d1d;
  color: #ffe4d6;
  font-family: "KaiTi", "STKaiti", "SimSun", serif;
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
  box-shadow:
    0 0 18px rgba(220, 38, 38, 0.26),
    inset 0 0 0 2px rgba(255, 226, 210, 0.12);
  transform: rotate(-7deg);
}

.brand-waves {
  position: absolute;
  left: 26px;
  right: 64px;
  bottom: 14px;
  height: 8px;
  opacity: 0.82;
  background:
    radial-gradient(18px 8px at 10px 8px, transparent 58%, rgba(32, 214, 191, 0.92) 62%, transparent 70%) 0 0 / 32px 8px repeat-x;
  pointer-events: none;
}

.brand-word {
  position: relative;
  z-index: 2;
  background: linear-gradient(90deg, #fff7d1 0%, #f8d66f 24%, #ffe5b0 42%, #d9fffb 68%, var(--teal) 100%);
  background-clip: text;
  color: transparent;
  font-family: "STKaiti", "KaiTi", "Microsoft YaHei UI", "Microsoft YaHei", serif;
  font-size: clamp(35px, 3.8vw, 48px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-shadow:
    0 0 1px rgba(255, 255, 255, 0.70),
    0 0 18px rgba(244, 201, 93, 0.28),
    0 0 24px rgba(32, 214, 191, 0.22);
  white-space: nowrap;
}

.brand-sub {
  position: relative;
  z-index: 2;
  margin-top: 8px;
  color: rgba(238, 246, 247, 0.74);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

@keyframes brand-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.07) inset,
      0 0 28px rgba(244, 201, 93, 0.14),
      0 0 24px rgba(32, 214, 191, 0.14),
      0 18px 42px rgba(0, 0, 0, 0.52);
  }

  50% {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.10) inset,
      0 0 42px rgba(244, 201, 93, 0.25),
      0 0 36px rgba(32, 214, 191, 0.22),
      0 20px 48px rgba(0, 0, 0, 0.58);
  }
}

@keyframes brand-shine {
  0%,
  58% {
    transform: translateX(-120%);
  }

  78%,
  100% {
    transform: translateX(120%);
  }
}

.source-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.header-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
  min-width: 0;
}

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

.small-button {
  min-height: 32px;
  padding: 0 13px;
  font-size: 12px;
}

.tool-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.main-tool-nav {
  position: relative;
  width: 100%;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 7px clamp(18px, 4vw, 52px);
  border-top: 1px solid rgba(32, 214, 191, 0.20);
  border-bottom: 1px solid rgba(32, 214, 191, 0.20);
  background:
    radial-gradient(circle at center top, rgba(32, 214, 191, 0.14), transparent 44%),
    linear-gradient(90deg, rgba(32, 214, 191, 0.08), transparent 24%, transparent 76%, rgba(244, 201, 93, 0.07)),
    #070b10;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 8px 24px rgba(0, 0, 0, 0.24);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.tool-nav a {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 112px;
  min-height: 36px;
  padding: 7px 19px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  transition: color 0.18s ease, transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.tool-nav a::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(145, 160, 173, 0.58);
  box-shadow: 0 0 0 4px rgba(145, 160, 173, 0.07);
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.tool-nav a::after {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: 9px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
    rgba(12, 18, 25, 0.82);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.tool-nav a.active,
.tool-nav a:hover {
  border-color: rgba(32, 214, 191, 0.38);
  color: var(--teal);
}

.tool-nav a:hover {
  transform: translateY(-1px);
}

.tool-nav a.active::after,
.tool-nav a:hover::after {
  opacity: 1;
}

.tool-nav a.active::before,
.tool-nav a:hover::before {
  background: var(--teal);
  box-shadow:
    0 0 0 4px rgba(32, 214, 191, 0.12),
    0 0 16px rgba(32, 214, 191, 0.55);
}

.tool-nav a.active {
  background:
    linear-gradient(135deg, rgba(32, 214, 191, 0.18), rgba(244, 201, 93, 0.05)),
    rgba(11, 17, 24, 0.96);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -2px 0 rgba(32, 214, 191, 0.56),
    0 0 22px rgba(32, 214, 191, 0.14);
}

.theme-picker {
  position: absolute;
  top: 50%;
  right: clamp(18px, 4vw, 52px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 4px 6px 4px 12px;
  border: 1px solid rgba(145, 160, 173, 0.22);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent),
    rgba(8, 13, 19, 0.88);
  color: var(--muted);
  transform: translateY(-50%);
}

.theme-picker span {
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.theme-select {
  width: auto;
  min-width: 106px;
  min-height: 28px;
  padding: 0 28px 0 9px;
  border-radius: 8px;
  background: #070a0f;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.source-strip span,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(145, 160, 173, 0.22);
  border-radius: 999px;
  background: rgba(17, 24, 33, 0.84);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 520px) minmax(320px, 1fr);
  gap: 16px;
  padding: 16px clamp(14px, 4vw, 52px) 32px;
}

.query-panel,
.map-panel,
.result-panel,
.table-panel {
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--panel);
  border: 1px solid rgba(145, 160, 173, 0.22);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.map-panel {
  min-height: 298px;
}

.result-panel,
.table-panel {
  grid-column: 1 / -1;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head.compact {
  margin-bottom: 12px;
}

.map-panel .section-head {
  align-items: flex-start;
  flex-wrap: wrap;
}

.map-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.map-source-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.map-source-tab {
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(145, 160, 173, 0.24);
  border-radius: 999px;
  background: rgba(10, 15, 21, 0.86);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.map-source-tab:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(32, 214, 191, 0.46);
  color: var(--ink);
}

.map-source-tab.active {
  border-color: rgba(32, 214, 191, 0.62);
  background: rgba(32, 214, 191, 0.16);
  color: var(--teal);
  box-shadow: 0 0 18px rgba(32, 214, 191, 0.14);
}

.map-source-tab:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

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

.section-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.field-label {
  display: block;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #070a0f;
  color: var(--ink);
  outline: none;
}

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

textarea {
  min-height: 170px;
  resize: vertical;
  padding: 11px;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(32, 214, 191, 0.16);
}

.primary-button,
.secondary-button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.primary-button {
  border-color: rgba(32, 214, 191, 0.58);
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  color: #041211;
  font-weight: 900;
}

.primary-button:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #1bbcab, #49f0dd);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.secondary-button {
  padding: 0 14px;
  background: #0a0f15;
  color: var(--ink);
  font-weight: 800;
}

.secondary-button:hover:not(:disabled) {
  border-color: rgba(244, 201, 93, 0.55);
  color: var(--gold);
}

.batch-actions {
  display: grid;
  grid-template-columns: 128px 110px 110px;
  gap: 8px;
  margin-top: 10px;
}

.status-line {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.status-line[data-type="ok"] {
  color: var(--green);
}

.status-line[data-type="warn"] {
  color: var(--amber);
}

.status-line[data-type="error"] {
  color: var(--rose);
}

.map-shell {
  position: relative;
  height: 230px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0a0f15;
}

.leaflet-map {
  width: 100%;
  height: 100%;
}

.map-empty {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(32, 214, 191, 0.11), rgba(244, 201, 93, 0.08)),
    #070a0f;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.map-empty[hidden] {
  display: none;
}

.leaflet-popup-content {
  margin: 10px 12px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 12px;
  line-height: 1.5;
}

.badge.good {
  border-color: rgba(52, 211, 153, 0.32);
  background: rgba(16, 185, 129, 0.12);
  color: var(--green);
}

.badge.warn {
  border-color: rgba(245, 158, 11, 0.32);
  background: rgba(245, 158, 11, 0.13);
  color: var(--amber);
}

.badge.bad {
  border-color: rgba(251, 113, 133, 0.34);
  background: rgba(251, 113, 133, 0.12);
  color: var(--rose);
}

.badge.muted {
  background: rgba(17, 24, 33, 0.84);
}

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

.source-summary-card {
  min-height: 112px;
  padding: 14px;
  border: 1px solid rgba(145, 160, 173, 0.20);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(32, 214, 191, 0.08), rgba(96, 165, 250, 0.04)),
    var(--panel-soft);
}

.source-summary-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
}

.source-summary-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.source-summary-card strong {
  display: block;
  margin-top: 8px;
  color: var(--teal);
  font-size: 24px;
  font-weight: 950;
  line-height: 1.2;
}

.metric {
  min-height: 84px;
  padding: 12px;
  border: 1px solid rgba(145, 160, 173, 0.20);
  border-radius: 8px;
  background: var(--panel-soft);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 7px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.35;
}

.empty-state,
.table-empty {
  color: var(--muted);
  text-align: center;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
}

.source-tables {
  display: grid;
  gap: 14px;
}

.source-group {
  overflow: hidden;
  border: 1px solid rgba(145, 160, 173, 0.20);
  border-radius: 8px;
  background: rgba(17, 24, 33, 0.52);
}

.source-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(32, 214, 191, 0.08), transparent),
    #0f151d;
}

.source-group-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 0;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  background: #090d13;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #111821;
  color: #c4d0db;
  font-weight: 900;
}

td {
  color: #dbe7ee;
  overflow-wrap: anywhere;
}

tbody tr:hover {
  background: rgba(32, 214, 191, 0.06);
}

tbody tr.duplicate-row {
  background: var(--duplicate-bg);
  box-shadow: inset 4px 0 0 var(--duplicate-border);
}

tbody tr.duplicate-row:hover {
  background: color-mix(in srgb, var(--duplicate-bg), white 7%);
}

td.duplicate-ip {
  color: var(--duplicate-text);
  font-weight: 900;
}

.duplicate-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-left: 8px;
  padding: 2px 7px;
  border: 1px solid color-mix(in srgb, var(--duplicate-border), white 16%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--duplicate-border), transparent 74%);
  color: var(--duplicate-text);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.source-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 0 10px rgba(32, 214, 191, 0.45);
}

.source-dot.secondary {
  background: var(--amber);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.44);
}

.source-dot.tertiary {
  background: var(--blue);
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.44);
}

.twofa-workspace {
  grid-template-columns: 1fr;
  padding-left: 14px;
  padding-right: 14px;
}

.twofa-panel {
  width: 100%;
  min-height: calc(100vh - 148px);
  margin: 0 auto;
}

.auth-panel {
  max-width: 460px;
  width: 100%;
  margin: 0 auto;
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.auth-tab {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0a0f15;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.auth-tab.active {
  border-color: rgba(32, 214, 191, 0.52);
  background: rgba(32, 214, 191, 0.12);
  color: var(--teal);
}

.stack-form {
  display: grid;
  gap: 10px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.secret-input {
  min-height: 108px;
}

.compact-secret-input {
  min-height: 92px;
}

.vault-layout {
  display: grid;
  grid-template-columns: minmax(360px, 480px) minmax(0, 1fr);
  gap: 16px;
}

.twofa-actions {
  grid-template-columns: 1fr 110px;
}

.code-panel {
  min-height: 560px;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 8px;
  margin-bottom: 12px;
}

.code-list {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 18px;
  padding-top: 8px;
}

.code-card {
  padding: 14px;
  border: 1px solid rgba(145, 160, 173, 0.20);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(32, 214, 191, 0.08), rgba(244, 201, 93, 0.04)),
    var(--panel-soft);
}

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

.code-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
}

.code-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.code-value {
  min-height: 58px;
  border: 1px solid rgba(32, 214, 191, 0.38);
  border-radius: 8px;
  background: #070a0f;
  color: var(--gold);
  cursor: pointer;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
  text-shadow: 0 0 18px rgba(244, 201, 93, 0.20);
}

.delete-button {
  min-height: 42px;
  border: 1px solid rgba(251, 113, 133, 0.34);
  border-radius: 8px;
  background: rgba(251, 113, 133, 0.08);
  color: var(--rose);
  cursor: pointer;
  font-weight: 800;
}

.timebar {
  height: 6px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #070a0f;
}

.timebar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width 0.2s linear;
}

.code-notes {
  min-height: 20px;
}

.totp-tile {
  position: relative;
  width: 322px;
  min-height: 112px;
  padding: 11px 12px 8px;
  border: 1px solid rgba(32, 214, 191, 0.26);
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(32, 214, 191, 0.08), rgba(244, 201, 93, 0.03)),
    #0a0f15;
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.34);
}

.totp-tile h3 {
  max-width: calc(100% - 76px);
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-action {
  position: absolute;
  top: 4px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  appearance: none;
  background: transparent;
  cursor: pointer;
  line-height: 1;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.tile-action svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.tile-edit {
  right: 42px;
  border: 1px solid rgba(32, 214, 191, 0.24);
  background: rgba(32, 214, 191, 0.08);
  color: var(--teal);
}

.tile-edit:hover {
  border-color: rgba(32, 214, 191, 0.54);
  background: rgba(32, 214, 191, 0.16);
  box-shadow: 0 0 16px rgba(32, 214, 191, 0.16);
}

.tile-delete {
  right: 9px;
  border: 1px solid rgba(251, 113, 133, 0.24);
  background: rgba(251, 113, 133, 0.08);
  color: var(--rose);
}

.totp-tile .tile-delete {
  border: 1px solid rgba(251, 113, 133, 0.24);
  border-radius: 7px;
  background: rgba(251, 113, 133, 0.08);
  color: var(--rose);
}

.tile-delete:hover {
  border-color: rgba(251, 113, 133, 0.54);
  background: rgba(251, 113, 133, 0.16);
  color: var(--rose);
  box-shadow: 0 0 16px rgba(251, 113, 133, 0.16);
}

.tile-code {
  display: block;
  width: calc(100% - 52px);
  min-height: 72px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 68px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 72px;
  text-align: center;
}

.tile-remaining {
  position: absolute;
  right: 8px;
  bottom: 9px;
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
}

.tile-timebar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  overflow: hidden;
  background: transparent;
}

.tile-timebar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width 0.12s linear;
  will-change: width;
}

.add-card {
  display: grid;
  place-items: center;
  width: 116px;
  min-height: 112px;
  border: 4px dashed rgba(238, 246, 247, 0.82);
  border-radius: 5px;
  background: #0a0f15;
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.34);
  cursor: pointer;
  font-size: 72px;
  font-weight: 700;
  line-height: 1;
}

.add-secret-button {
  min-width: 132px;
  padding: 0 16px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(10px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  position: relative;
  width: min(540px, 100%);
  max-height: min(92vh, 760px);
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(145, 160, 173, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    var(--panel);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.62);
}

.secret-modal {
  width: min(520px, 100%);
}

.edit-modal {
  width: min(420px, 100%);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #070a0f;
  color: var(--muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.modal-close:hover {
  border-color: rgba(244, 201, 93, 0.55);
  color: var(--gold);
}

:root[data-theme="light"] body {
  background:
    linear-gradient(180deg, rgba(15, 159, 144, 0.10), transparent 330px),
    var(--bg);
}

:root[data-theme="light"] .topbar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 252, 0.96)),
    #ffffff;
  border-bottom-color: rgba(15, 159, 144, 0.22);
  box-shadow: 0 10px 28px rgba(15, 32, 45, 0.10);
}

:root[data-theme="light"] .brand-logo {
  border-color: rgba(156, 112, 34, 0.76);
  background:
    radial-gradient(circle at 18% 18%, rgba(250, 204, 21, 0.22), transparent 28%),
    radial-gradient(circle at 86% 16%, rgba(185, 28, 28, 0.22), transparent 24%),
    linear-gradient(135deg, #111417 0%, #092329 46%, #101820 100%),
    #0b1114;
  box-shadow:
    0 0 0 1px rgba(255, 236, 178, 0.16) inset,
    0 0 0 3px rgba(18, 25, 29, 0.82) inset,
    0 0 28px rgba(156, 112, 34, 0.18),
    0 18px 36px rgba(15, 32, 45, 0.20);
}

:root[data-theme="light"] .brand-logo::before {
  background: linear-gradient(110deg, transparent 0%, rgba(255, 245, 215, 0.16) 44%, transparent 62%);
}

:root[data-theme="light"] .brand-logo::after {
  height: 3px;
  background: linear-gradient(90deg, transparent, #991b1b, #d6a53f, #14a595, transparent);
  opacity: 0.98;
}

:root[data-theme="light"] .brand-mountain {
  opacity: 0.42;
}

:root[data-theme="light"] .brand-mountain::before,
:root[data-theme="light"] .brand-mountain::after {
  background: linear-gradient(135deg, rgba(214, 165, 63, 0.82), rgba(20, 165, 149, 0.22));
}

:root[data-theme="light"] .brand-waves {
  opacity: 0.84;
  background:
    radial-gradient(18px 8px at 10px 8px, transparent 56%, rgba(32, 214, 191, 0.92) 61%, transparent 71%) 0 0 / 32px 8px repeat-x;
}

:root[data-theme="light"] .brand-word {
  background: none;
  background-clip: initial;
  color: #f5d270;
  font-weight: 900;
  text-shadow:
    0 1px 0 rgba(72, 42, 8, 0.92),
    0 0 14px rgba(245, 210, 112, 0.22);
}

:root[data-theme="light"] .brand-sub {
  color: rgba(238, 246, 247, 0.78);
  font-weight: 900;
  text-shadow: none;
}

:root[data-theme="light"] .brand-seal {
  border-color: rgba(248, 113, 113, 0.72);
  background:
    linear-gradient(135deg, rgba(127, 29, 29, 0.96), rgba(220, 38, 38, 0.72)),
    #7f1d1d;
  color: #ffe4d6;
  box-shadow:
    0 0 18px rgba(220, 38, 38, 0.24),
    inset 0 0 0 2px rgba(255, 226, 210, 0.16);
}

:root[data-theme="light"] .main-tool-nav {
  border-top-color: rgba(15, 159, 144, 0.20);
  border-bottom-color: rgba(15, 159, 144, 0.22);
  background:
    radial-gradient(circle at center top, rgba(15, 159, 144, 0.12), transparent 44%),
    linear-gradient(90deg, rgba(15, 159, 144, 0.08), transparent 25%, transparent 75%, rgba(184, 137, 20, 0.08)),
    #eef5f7;
  box-shadow: 0 8px 22px rgba(15, 32, 45, 0.08);
}

:root[data-theme="light"] .tool-nav a {
  color: var(--muted);
}

:root[data-theme="light"] .tool-nav a::after {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.32)),
    rgba(255, 255, 255, 0.82);
}

:root[data-theme="light"] .tool-nav a.active {
  background:
    linear-gradient(135deg, rgba(15, 159, 144, 0.14), rgba(184, 137, 20, 0.06)),
    rgba(255, 255, 255, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.90),
    inset 0 -2px 0 rgba(15, 159, 144, 0.46),
    0 10px 22px rgba(15, 32, 45, 0.08);
}

:root[data-theme="light"] .theme-picker {
  border-color: rgba(15, 32, 45, 0.10);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 250, 252, 0.86)),
    #ffffff;
  box-shadow: 0 8px 20px rgba(15, 32, 45, 0.08);
}

:root[data-theme="light"] .theme-select,
:root[data-theme="light"] input,
:root[data-theme="light"] select,
:root[data-theme="light"] textarea {
  background: #ffffff;
  color: var(--ink);
}

:root[data-theme="light"] .query-panel,
:root[data-theme="light"] .map-panel,
:root[data-theme="light"] .result-panel,
:root[data-theme="light"] .table-panel,
:root[data-theme="light"] .modal-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 253, 0.88)),
    var(--panel);
  border-color: rgba(15, 32, 45, 0.10);
}

:root[data-theme="light"] .badge,
:root[data-theme="light"] .badge.muted,
:root[data-theme="light"] .source-strip span {
  border-color: rgba(15, 32, 45, 0.10);
  background: rgba(248, 251, 253, 0.92);
}

:root[data-theme="light"] .map-source-tab {
  border-color: rgba(15, 32, 45, 0.12);
  background: rgba(255, 255, 255, 0.94);
  color: var(--muted);
}

:root[data-theme="light"] .map-source-tab.active {
  border-color: rgba(15, 159, 144, 0.48);
  background: rgba(15, 159, 144, 0.12);
  color: var(--teal);
}

:root[data-theme="light"] .secondary-button,
:root[data-theme="light"] .auth-tab,
:root[data-theme="light"] .map-shell,
:root[data-theme="light"] .modal-close {
  background: #ffffff;
  color: var(--ink);
}

:root[data-theme="light"] .map-empty {
  background:
    linear-gradient(135deg, rgba(15, 159, 144, 0.11), rgba(184, 137, 20, 0.08)),
    #f8fbfd;
}

:root[data-theme="light"] .source-group {
  background: rgba(255, 255, 255, 0.74);
}

:root[data-theme="light"] .source-summary-card {
  border-color: rgba(15, 32, 45, 0.10);
  background:
    linear-gradient(135deg, rgba(15, 159, 144, 0.08), rgba(59, 130, 246, 0.04)),
    #ffffff;
}

:root[data-theme="light"] .source-group-head {
  background:
    linear-gradient(90deg, rgba(15, 159, 144, 0.08), transparent),
    #f4f8fb;
}

:root[data-theme="light"] table {
  background: #ffffff;
}

:root[data-theme="light"] th {
  background: #edf4f7;
  color: #304553;
}

:root[data-theme="light"] td {
  color: #203442;
}

:root[data-theme="light"] tbody tr:hover {
  background: rgba(15, 159, 144, 0.07);
}

:root[data-theme="light"] td.duplicate-ip {
  color: color-mix(in srgb, var(--duplicate-border), #10202b 40%);
}

:root[data-theme="light"] .duplicate-badge {
  background: color-mix(in srgb, var(--duplicate-border), white 82%);
  color: #142635;
}

:root[data-theme="light"] .totp-tile {
  border-color: rgba(15, 159, 144, 0.24);
  background:
    linear-gradient(135deg, rgba(15, 159, 144, 0.08), rgba(184, 137, 20, 0.04)),
    #ffffff;
  box-shadow: 0 10px 24px rgba(15, 32, 45, 0.11);
}

:root[data-theme="light"] .tile-code {
  color: var(--teal);
}

:root[data-theme="light"] .add-card {
  border-color: rgba(16, 32, 43, 0.72);
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(15, 32, 45, 0.11);
}

:root[data-theme="light"] .modal-backdrop {
  background: rgba(15, 32, 45, 0.36);
}

@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  .topbar {
    align-items: center;
    grid-template-columns: 1fr;
  }

  .brand-logo {
    order: -1;
    justify-self: center;
    min-width: 226px;
    min-height: 76px;
    padding: 14px 50px 13px 22px;
  }

  .brand-word {
    font-size: 32px;
  }

  .brand-seal {
    top: 12px;
    right: 13px;
    width: 30px;
    height: 30px;
    font-size: 19px;
  }

  .source-strip {
    justify-content: flex-start;
  }

  .header-actions,
  .tool-nav,
  .account-actions {
    justify-items: start;
    justify-content: flex-start;
  }

  .main-tool-nav {
    gap: 8px;
    justify-content: flex-start;
  }

  .nav-links {
    justify-content: flex-start;
    width: 100%;
  }

  .theme-picker {
    position: static;
    transform: none;
  }

  .batch-actions {
    grid-template-columns: 1fr;
  }

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

  .map-shell {
    height: 210px;
  }

  .vault-layout,
  .form-row,
  .twofa-actions,
  .search-row,
  .code-row,
  .section-actions {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-actions,
  .add-secret-button {
    width: 100%;
  }

  .code-list {
    display: grid;
    grid-template-columns: 1fr;
  }

  .totp-tile,
  .add-card {
    width: 100%;
  }

  .tile-code {
    font-size: 56px;
  }
}
