:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  color: #f3f6fb;
  background: #0b1220;
  --canvas: #0b1220;
  --surface: #111a2b;
  --surface-raised: #17233a;
  --surface-soft: rgb(23 35 58 / 82%);
  --ink: #f3f6fb;
  --muted: #9aa9bd;
  --faint: #66758a;
  --line: rgb(148 163 184 / 18%);
  --line-strong: rgb(148 163 184 / 32%);
  --accent: #78aefc;
  --accent-strong: #4f8ff7;
  --accent-soft: rgb(120 174 252 / 13%);
  --warning: #f2bd68;
  --danger: #f47d91;
  --focus: #7dd3fc;
  --shadow: 0 20px 55px rgb(2 8 23 / 30%);
}

* {
  box-sizing: border-box;
}

::selection {
  background: rgb(120 174 252 / 28%);
  color: #fff;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(55% 42% at 0% 0%, rgb(67 107 184 / 18%), transparent 70%),
    radial-gradient(48% 38% at 100% 12%, rgb(53 92 152 / 15%), transparent 72%),
    linear-gradient(135deg, #0b1220 0%, #0f192b 56%, #0b1220 100%);
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 0 42%, rgb(120 174 252 / 4%) 52%, transparent 67%);
  mask-image: linear-gradient(to bottom, #000, transparent 85%);
}

h1,
h2,
p {
  margin: 0;
}

h1,
h2,
.eyebrow,
.brand-block p,
.status-inner,
.row-index,
.json-toolbar,
.document-state {
  letter-spacing: 0;
}

h1 {
  font-size: 18px;
  line-height: 1.25;
}

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

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgb(11 18 32 / 88%);
  box-shadow: 0 8px 28px rgb(2 8 23 / 22%);
  backdrop-filter: blur(18px) saturate(120%);
}

.header-inner,
.status-inner,
.workspace,
.conflict-banner {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgb(120 174 252 / 62%);
  border-radius: 12px;
  background: linear-gradient(145deg, #8ab9ff, #4f8ff7);
  color: #081326;
  font-size: 21px;
  font-weight: 850;
  box-shadow: 0 0 0 4px rgb(120 174 252 / 10%), 0 8px 22px rgb(40 91 175 / 22%);
}

.brand-block p {
  margin-top: 3px;
  color: var(--muted);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-actions,
.dialog-actions,
.json-actions,
.empty-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.button {
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgb(23 35 58 / 88%);
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 680;
  line-height: 1;
  text-decoration: none;
  box-shadow: inset 0 1px rgb(255 255 255 / 6%);
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.button:hover:not(:disabled) {
  border-color: rgb(120 174 252 / 68%);
  background: rgb(33 53 86 / 96%);
  box-shadow: 0 8px 20px rgb(2 8 23 / 18%), inset 0 1px rgb(255 255 255 / 8%);
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

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

.button-primary {
  border-color: rgb(120 174 252 / 80%);
  background: var(--accent);
  color: #081326;
  box-shadow: 0 8px 20px rgb(40 91 175 / 22%), inset 0 1px rgb(255 255 255 / 42%);
}

.button-primary:hover:not(:disabled) {
  border-color: #b7d4ff;
  background: #9bc3ff;
  color: #081326;
  box-shadow: 0 10px 26px rgb(40 91 175 / 30%);
}

.button-icon {
  font-size: 16px;
  font-weight: 750;
  line-height: 1;
}

.status-band {
  min-height: 43px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgb(10 25 21 / 70%);
}

.status-inner {
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 11px;
}

.status-dot,
.json-status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 13px rgb(246 200 102 / 55%);
}

.status-dot.online {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgb(98 224 176 / 10%), 0 0 15px rgb(98 224 176 / 70%);
}

.status-dot.error {
  background: var(--danger);
  box-shadow: 0 0 15px rgb(255 113 140 / 65%);
}

.status-dot.warning {
  background: var(--warning);
}

.document-state {
  margin-left: auto;
  padding: 5px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: rgb(16 38 31 / 82%);
  color: var(--muted);
  font-size: 11px;
}

.document-state.dirty {
  border-color: rgb(246 200 102 / 75%);
  background: rgb(246 200 102 / 13%);
  color: #ffd97f;
  box-shadow: 0 0 20px rgb(246 200 102 / 15%);
  animation: unsaved-pulse 1.8s ease-in-out infinite;
}

body.has-unsaved-changes .status-band {
  background: linear-gradient(90deg, rgb(92 68 27 / 29%), rgb(10 25 21 / 76%) 50%, rgb(92 68 27 / 29%));
}

body.has-unsaved-changes #save-button:not(:disabled) {
  box-shadow: 0 0 28px rgb(98 224 176 / 35%), 0 0 0 1px rgb(98 224 176 / 32%);
}

@keyframes unsaved-pulse {
  0%,
  100% { box-shadow: 0 0 0 rgb(246 200 102 / 0%); }
  50% { box-shadow: 0 0 20px rgb(246 200 102 / 25%); }
}

.conflict-banner {
  position: relative;
  min-height: 66px;
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgb(246 200 102 / 48%);
  border-radius: 10px;
  background: rgb(67 51 22 / 58%);
  color: #ffe2a1;
  box-shadow: 0 12px 35px rgb(0 0 0 / 16%);
}

.conflict-banner[hidden],
.empty-state[hidden],
.load-more-button[hidden],
.clear-search[hidden] {
  display: none;
}

.conflict-icon {
  width: 28px;
  height: 28px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgb(246 200 102 / 55%);
  border-radius: 50%;
  background: rgb(246 200 102 / 18%);
  color: var(--warning);
  font-weight: 800;
}

.conflict-copy {
  min-width: 0;
  flex: 1;
}

.conflict-copy strong,
.conflict-copy span {
  display: block;
}

.conflict-copy strong {
  font-size: 13px;
}

.conflict-copy span {
  margin-top: 3px;
  color: #d1b982;
  font-size: 12px;
  line-height: 1.45;
}

.button-conflict {
  min-height: 34px;
  border-color: rgb(246 200 102 / 42%);
  background: rgb(29 29 21 / 72%);
  color: #ffe2a1;
  white-space: nowrap;
}

.button-conflict:hover:not(:disabled) {
  border-color: var(--warning);
  background: rgb(92 69 27 / 70%);
}

.button-conflict-force {
  border-color: rgb(255 113 140 / 45%);
  background: rgb(70 29 39 / 62%);
  color: #ffabbc;
}

.button-conflict-force:hover:not(:disabled) {
  border-color: var(--danger);
  background: rgb(100 37 54 / 72%);
}

.conflict-close {
  width: 30px;
  height: 30px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #d1b982;
  cursor: pointer;
  font-size: 18px;
}

.conflict-close:hover {
  border-color: rgb(246 200 102 / 38%);
  background: rgb(246 200 102 / 13%);
  color: #ffe2a1;
}

.workspace {
  padding: 34px 0 66px;
}

.workspace-intro {
  min-height: 176px;
  margin-bottom: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.78fr);
  align-items: end;
  gap: 30px;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--accent);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.workspace-intro h2 {
  max-width: 680px;
  color: #f3fbf8;
  font-size: clamp(27px, 3.3vw, 43px);
  line-height: 1.12;
}

.intro-copy {
  max-width: 580px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.overview-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgb(140 190 174 / 18%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.overview-stat {
  min-width: 0;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 15px;
  background: rgb(14 32 27 / 78%);
}

.overview-stat + .overview-stat {
  border-left: 1px solid var(--line);
}

.overview-stat strong,
.overview-stat span {
  display: block;
}

.overview-stat strong {
  color: #f2fbf8;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 19px;
  line-height: 1.1;
}

.overview-stat span {
  margin-top: 7px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.tab {
  min-height: 45px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 2px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 680;
}

.tab:hover {
  color: var(--ink);
}

.tab.is-active {
  border-bottom-color: var(--accent);
  color: var(--ink);
  text-shadow: 0 0 16px rgb(98 224 176 / 24%);
}

.tab-icon {
  color: var(--faint);
  font-size: 15px;
}

.tab.is-active .tab-icon {
  color: var(--accent);
}

.panel {
  display: none;
  padding-top: 26px;
}

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

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

.field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field > span:first-child {
  color: #b4c9c1;
  font-size: 12px;
  font-weight: 680;
}

.field input,
.field textarea,
.sort-field select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
  background: rgb(10 25 22 / 80%);
  color: var(--ink);
  box-shadow: inset 0 1px rgb(255 255 255 / 4%);
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.field input {
  height: 42px;
  padding: 0 11px;
}

.field textarea {
  min-height: 130px;
  resize: vertical;
  padding: 11px;
  line-height: 1.55;
}

.field input:hover,
.field textarea:hover,
.sort-field select:hover {
  border-color: rgb(98 224 176 / 48%);
  background: rgb(13 33 27 / 92%);
}

.field input:focus,
.field textarea:focus,
.sort-field select:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgb(121 216 255 / 11%), 0 0 18px rgb(98 224 176 / 8%);
}

.section-heading {
  min-height: 58px;
  margin-top: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid rgb(140 190 174 / 12%);
}

.section-heading > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.section-heading h2 {
  color: #f2fbf8;
}

#icon-count {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid rgb(98 224 176 / 30%);
  border-radius: 6px;
  background: rgb(98 224 176 / 10%);
  color: #a9f4d5;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.list-tools {
  display: flex;
  align-items: center;
  gap: 9px;
}

.search-field {
  width: min(260px, 28vw);
  height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgb(10 25 22 / 80%);
  color: var(--faint);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.search-field:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgb(121 216 255 / 10%);
}

.search-field > span {
  flex: 0 0 auto;
  font-size: 15px;
}

.search-field input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: var(--ink);
}

.search-field input::placeholder {
  color: var(--faint);
}

.search-field input[type="search"]::-webkit-search-cancel-button,
.search-field input[type="search"]::-webkit-search-decoration,
.search-field input[type="search"]::-ms-clear {
  display: none;
  appearance: none;
}

.clear-search {
  width: 25px;
  height: 25px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
}

.clear-search[hidden] {
  display: none !important;
}

.clear-search:hover {
  background: rgb(98 224 176 / 12%);
  color: var(--accent);
}

.sort-field {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.sort-field select {
  width: auto;
  height: 42px;
  padding: 0 29px 0 10px;
  cursor: pointer;
  font-size: 12px;
}

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

.icon-row {
  min-height: 98px;
  display: grid;
  grid-template-columns: 34px 62px minmax(150px, 0.72fr) minmax(260px, 1.28fr) 104px;
  align-items: center;
  gap: 13px;
  padding: 12px 14px 12px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(105deg, rgb(15 34 28 / 88%), rgb(12 25 30 / 82%));
  box-shadow: inset 0 1px rgb(255 255 255 / 4%), 0 12px 30px rgb(0 0 0 / 13%);
  backdrop-filter: blur(12px);
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.icon-row:hover {
  border-color: rgb(98 224 176 / 40%);
  box-shadow: inset 0 1px rgb(255 255 255 / 6%), 0 16px 36px rgb(0 0 0 / 19%), 0 0 22px rgb(98 224 176 / 6%);
  transform: translateY(-1px);
}

.row-index {
  width: 34px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgb(98 224 176 / 36%);
  border-radius: 7px;
  background: linear-gradient(145deg, rgb(98 224 176 / 18%), rgb(31 79 65 / 45%));
  color: #baffdf;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  text-align: center;
  text-shadow: 0 0 12px rgb(98 224 176 / 36%);
  box-shadow: inset 0 1px rgb(255 255 255 / 8%), 0 0 13px rgb(98 224 176 / 6%);
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.row-index::before {
  content: "#";
  margin-right: 1px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 650;
}

.icon-row:hover .row-index,
.icon-row:focus-within .row-index {
  border-color: rgb(98 224 176 / 72%);
  background: linear-gradient(145deg, rgb(98 224 176 / 28%), rgb(31 79 65 / 62%));
  color: #e1fff1;
  box-shadow: 0 0 17px rgb(98 224 176 / 18%);
}

.icon-preview {
  width: 62px;
  height: 62px;
  display: grid;
  position: relative;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: linear-gradient(145deg, rgb(25 53 44 / 92%), rgb(10 22 29 / 92%));
  color: inherit;
  text-decoration: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.icon-preview::before {
  content: "IMG";
  color: var(--faint);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
}

.icon-preview img {
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
  padding: 7px;
  background: transparent;
  object-fit: contain;
}

.icon-preview:hover,
.icon-preview:focus-visible {
  border-color: var(--accent);
  background: rgb(24 66 54 / 85%);
  box-shadow: 0 0 22px rgb(98 224 176 / 20%);
}

.icon-preview.is-empty::before {
  content: "WAIT";
  color: var(--muted);
}

.icon-preview.is-broken {
  border-color: rgb(255 113 140 / 50%);
  background: rgb(74 29 41 / 55%);
}

.icon-preview.is-broken::before {
  content: "ERROR";
  color: var(--danger);
}

.icon-preview.has-image::before {
  display: none;
}

.compact-field input {
  height: 39px;
}

.url-control {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.url-control input {
  min-width: 0;
  flex: 1;
}

.url-control .copy-url {
  width: 39px;
  height: 39px;
  flex: 0 0 39px;
  border-color: rgb(98 224 176 / 34%);
  color: var(--accent);
}

.url-control .copy-url:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgb(24 66 54 / 88%);
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.icon-button {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: rgb(14 35 29 / 86%);
  color: #aec4bb;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.icon-button:hover:not(:disabled) {
  border-color: rgb(98 224 176 / 65%);
  background: rgb(24 66 54 / 88%);
  color: var(--accent);
}

.icon-button.danger {
  color: var(--danger);
}

.icon-button.danger:hover {
  border-color: rgb(255 113 140 / 55%);
  background: rgb(74 29 41 / 65%);
}

.empty-state {
  min-height: 230px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: rgb(12 29 25 / 63%);
  color: var(--muted);
  text-align: center;
}

.empty-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgb(98 224 176 / 30%);
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 22px;
}

.empty-state strong {
  color: var(--ink);
}

.empty-state > span {
  max-width: 320px;
  font-size: 13px;
  line-height: 1.5;
}

.empty-actions {
  margin-top: 2px;
}

.load-more-button {
  width: 100%;
  margin-top: 12px;
}

.json-toolbar {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--accent);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 11px;
}

.json-toolbar > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.json-toolbar .invalid {
  color: var(--danger);
}

.json-toolbar .invalid .json-status-dot {
  background: var(--danger);
  box-shadow: 0 0 12px rgb(255 113 140 / 55%);
}

#json-editor {
  width: 100%;
  min-height: 620px;
  resize: vertical;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  background: #07100e;
  color: #dcf8ed;
  font: 13px/1.65 "Cascadia Code", Consolas, monospace;
  tab-size: 2;
  box-shadow: inset 0 1px rgb(255 255 255 / 4%), var(--shadow);
}

dialog {
  width: min(580px, calc(100% - 32px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: rgb(11 26 22 / 95%);
  color: var(--ink);
  box-shadow: 0 30px 100px rgb(0 0 0 / 52%), 0 0 0 1px rgb(98 224 176 / 6%);
  backdrop-filter: blur(24px) saturate(130%);
}

dialog::backdrop {
  background: rgb(2 7 6 / 74%);
  backdrop-filter: blur(6px);
}

dialog form {
  padding: 24px;
  background: transparent;
}

.dialog-heading {
  margin-bottom: 21px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dialog-lead {
  margin: -9px 0 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.dialog-lead code {
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font: 11px "Cascadia Code", Consolas, monospace;
}

.dialog-error {
  min-height: 20px;
  margin-top: 8px;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.45;
}

.dialog-actions {
  margin-top: 16px;
  justify-content: flex-end;
}

.remote-import-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 18px;
}

.remote-fetch-button {
  min-height: 42px;
  white-space: nowrap;
}

.import-file-field {
  margin-bottom: 18px;
}

.import-file-field input {
  padding: 8px;
}

.import-paste-field textarea {
  min-height: 180px;
  font: 12px/1.6 "Cascadia Code", Consolas, monospace;
}

.secret-input {
  position: relative;
  display: flex;
  align-items: center;
}

.secret-input input {
  padding-right: 64px;
}

/* Keep the password field type stable so Bitwarden does not lose its field anchor. */
.secret-input input.is-visible {
  -webkit-text-security: none;
}

.secret-toggle {
  position: absolute;
  right: 9px;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
}

.secret-toggle:hover {
  color: #a1f4d1;
}

.toast {
  max-width: min(440px, calc(100% - 32px));
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  padding: 14px 17px;
  border: 1px solid rgb(98 224 176 / 46%);
  border-radius: 9px;
  background: rgb(9 28 23 / 96%);
  color: #edfff7;
  font-size: 13px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(9px);
  box-shadow: 0 15px 38px rgb(0 0 0 / 35%), 0 0 26px rgb(98 224 176 / 15%);
  transition: opacity 180ms ease, transform 180ms ease;
}

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

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

@media (max-width: 980px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    padding-block: 16px;
  }

  .header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .header-actions .button {
    min-width: 0;
    width: 100%;
    padding-inline: 9px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 16px;
  }

  .list-tools {
    width: 100%;
  }

  .search-field {
    flex: 1 1 220px;
    width: auto;
  }
}

@media (max-width: 680px) {
  .header-inner,
  .status-inner,
  .workspace,
  .conflict-banner {
    width: calc(100% - 28px);
  }

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

  .status-inner {
    min-height: 48px;
    flex-wrap: wrap;
    padding-block: 8px;
  }

  .workspace {
    padding-top: 27px;
  }

  .workspace-intro {
    grid-template-columns: 1fr;
    gap: 21px;
  }

  .workspace-intro h2 {
    max-width: 100%;
    font-size: 30px;
  }

  .overview-stats {
    width: 100%;
  }

  .metadata-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .list-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(112px, auto);
    gap: 8px;
  }

  .search-field {
    grid-column: 1 / -1;
    width: 100%;
  }

  .sort-field {
    min-width: 0;
    justify-content: space-between;
  }

  .sort-field select {
    min-width: 0;
    max-width: 150px;
  }

  .list-tools > .button {
    width: 100%;
  }

  .icon-row {
    grid-template-columns: 34px 52px minmax(0, 1fr);
    padding: 11px;
    gap: 10px;
  }

  .icon-preview {
    width: 42px;
    height: 42px;
  }

  .row-index {
    width: 34px;
    height: 27px;
    font-size: 10px;
  }

  .icon-row .url-field,
  .icon-row .row-actions {
    grid-column: 1 / -1;
  }

  .icon-row .compact-field:not(.url-field) {
    min-width: 0;
  }

  .icon-row .row-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    padding-top: 9px;
    border-top: 1px solid var(--line);
  }

  .icon-row .row-actions .icon-button {
    width: 100%;
    height: 34px;
  }

  .remote-import-row {
    grid-template-columns: 1fr;
  }

  .remote-fetch-button {
    width: 100%;
  }

  .json-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 8px;
  }

  .json-actions,
  .empty-actions {
    width: 100%;
  }

  .json-actions .button,
  .empty-actions .button {
    flex: 1;
  }

  .conflict-banner {
    align-items: stretch;
    flex-wrap: wrap;
    padding-right: 48px;
  }

  .conflict-copy {
    flex-basis: calc(100% - 42px);
  }

  .conflict-banner .button-conflict {
    flex: 1;
  }

  .conflict-close {
    position: absolute;
    top: 10px;
    right: 10px;
  }

  dialog form {
    padding: 20px;
  }
}

@media (max-width: 420px) {
  .header-inner,
  .status-inner,
  .workspace,
  .conflict-banner {
    width: calc(100% - 20px);
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .header-actions {
    gap: 6px;
  }

  .header-actions .button {
    min-height: 37px;
    padding-inline: 6px;
    font-size: 12px;
  }

  .header-actions .button-icon {
    display: none;
  }

  .workspace-intro h2 {
    font-size: 27px;
  }

  .overview-stat {
    padding-inline: 9px;
  }

  .overview-stat strong {
    font-size: 16px;
  }

  .overview-stat span {
    font-size: 10px;
  }

  .icon-row {
    grid-template-columns: 30px 46px minmax(0, 1fr);
  }

  .row-index {
    width: 30px;
    height: 26px;
    font-size: 10px;
  }

  .icon-row .url-field,
  .icon-row .row-actions {
    grid-column: 1 / -1;
  }

  .url-control .copy-url {
    width: 38px;
    flex-basis: 38px;
  }

  .toast {
    right: 10px;
    bottom: 10px;
  }
}

/* Keep one clear control in the search field across browsers. */
.search-field input[type="search"] {
  appearance: none;
  -webkit-appearance: none;
}

.search-field input[type="search"]::-webkit-search-cancel-button,
.search-field input[type="search"]::-webkit-search-decoration,
.search-field input[type="search"]::-ms-clear {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

.search-delete-results-button[hidden] {
  display: none;
}

.search-delete-dialog {
  width: min(720px, calc(100% - 28px));
  max-height: min(760px, calc(100vh - 28px));
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
}

.search-delete-dialog::backdrop {
  background: rgb(15 23 42 / 28%);
  backdrop-filter: blur(6px);
}

.search-delete-panel {
  max-height: min(760px, calc(100vh - 28px));
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.search-delete-targets {
  display: grid;
  gap: 8px;
  max-height: min(430px, 52vh);
  overflow: auto;
  margin-top: 16px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbfd;
}

.search-delete-target {
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  border: 1px solid #e2edf2;
  border-radius: 8px;
  background: #ffffff;
}

.search-delete-target strong {
  overflow-wrap: anywhere;
  color: #0f172a;
  font-size: 13px;
}

.search-delete-target span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 680px) {
  .list-tools > .search-delete-results-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .search-delete-dialog {
    width: calc(100% - 20px);
    max-height: calc(100vh - 20px);
  }

  .search-delete-panel {
    max-height: calc(100vh - 20px);
    padding: 17px;
  }
}

/* Shared responsive refinements */
@media (max-width: 680px) {
  .app-header {
    position: relative;
  }

  .header-inner {
    gap: 15px;
    padding-top: max(14px, env(safe-area-inset-top));
    padding-bottom: 14px;
  }

  .brand-block {
    width: 100%;
  }

  .brand-block h1 {
    font-size: 17px;
  }

  .header-actions {
    gap: 8px;
  }

  .header-actions .button {
    min-height: 42px;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
  }

  .home-stats {
    gap: 8px;
    margin-top: 22px;
  }

  .home-stat {
    min-width: 0;
    flex: 1 1 140px;
    padding: 12px 13px;
  }

  .home-toolbar {
    margin-top: 26px;
  }

  .home-search {
    width: 100%;
  }

  .home-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    margin-top: 26px;
    line-height: 1.5;
  }

  .icon-card {
    padding: 12px;
  }

  .icon-card img {
    height: 116px;
  }
}

@media (max-width: 360px) {
  .header-actions {
    grid-template-columns: 1fr;
  }

  .header-actions .button {
    width: 100%;
  }

  .home-stat {
    flex-basis: 100%;
  }
}

/* Modern slate theme refinements */
.status-band {
  background: rgb(15 25 43 / 82%);
}

.status-dot.online,
.json-status-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgb(120 174 252 / 10%), 0 0 14px rgb(120 174 252 / 34%);
}

.document-state {
  background: rgb(23 35 58 / 88%);
}

.workspace-intro h2,
.overview-stat strong,
.section-heading h2 {
  color: #f6f8fc;
}

.overview-stats {
  border-color: var(--line-strong);
  background: rgb(148 163 184 / 16%);
  box-shadow: var(--shadow);
}

.overview-stat {
  background: rgb(17 26 43 / 90%);
}

.field input,
.field textarea,
.sort-field select,
.search-field {
  border-color: var(--line-strong);
  background: rgb(11 18 32 / 76%);
}

.field input:hover,
.field textarea:hover,
.sort-field select:hover,
.search-field:hover {
  border-color: rgb(120 174 252 / 54%);
  background: rgb(17 29 50 / 92%);
}

.field input:focus,
.field textarea:focus,
.sort-field select:focus,
.search-field:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgb(125 211 252 / 12%);
}

.icon-row,
.empty-state {
  border-color: var(--line);
  background: linear-gradient(105deg, rgb(17 28 48 / 92%), rgb(14 24 41 / 90%));
  box-shadow: 0 10px 28px rgb(2 8 23 / 18%);
}

.icon-row:hover {
  border-color: rgb(120 174 252 / 46%);
  box-shadow: 0 14px 32px rgb(2 8 23 / 24%);
}

.row-index,
#icon-count {
  border-color: rgb(120 174 252 / 38%);
  background: rgb(120 174 252 / 11%);
  color: #bcd6ff;
  text-shadow: none;
  box-shadow: none;
}

.icon-preview,
.icon-card .home-icon-preview {
  border-color: var(--line-strong);
  background: linear-gradient(145deg, rgb(29 48 80 / 86%), rgb(13 23 40 / 92%));
}

.icon-preview:hover,
.icon-preview:focus-visible {
  border-color: var(--accent);
  background: rgb(31 59 103 / 88%);
  box-shadow: 0 8px 22px rgb(40 91 175 / 22%);
}

.icon-button {
  border-color: var(--line-strong);
  background: rgb(18 31 53 / 90%);
}

.icon-button:hover:not(:disabled) {
  border-color: rgb(120 174 252 / 62%);
  background: rgb(31 59 103 / 88%);
  color: var(--accent);
}

.url-control .copy-url {
  border-color: rgb(120 174 252 / 42%);
  color: var(--accent);
}

.empty-icon {
  border-color: rgb(120 174 252 / 34%);
  background: var(--accent-soft);
  color: var(--accent);
}

.load-more-button,
.home-load-more {
  border-color: rgb(120 174 252 / 42%);
}

#json-editor {
  border-color: var(--line-strong);
  background: #0a1221;
  color: #e0eaff;
  box-shadow: inset 0 1px rgb(255 255 255 / 5%), var(--shadow);
}

dialog {
  border-color: var(--line-strong);
  background: rgb(15 25 43 / 97%);
  box-shadow: 0 26px 80px rgb(2 8 23 / 52%);
}

.toast {
  border-color: rgb(120 174 252 / 50%);
  background: rgb(15 30 54 / 97%);
  box-shadow: 0 14px 34px rgb(2 8 23 / 35%);
}

.home-stat,
.home-metadata-card,
.icon-card {
  border-color: var(--line);
  background: var(--surface-soft);
}

.home-stat strong {
  color: var(--accent);
}

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

/* Glacial cyan theme and spacious control-center layout */
:root {
  color-scheme: dark;
  --canvas: #071a20;
  --surface: #0c252b;
  --surface-raised: #12343a;
  --surface-soft: rgb(15 49 56 / 84%);
  --ink: #e8fbfb;
  --muted: #9bbfc3;
  --faint: #6e969b;
  --line: rgb(139 222 224 / 16%);
  --line-strong: rgb(139 222 224 / 31%);
  --accent: #62e1dc;
  --accent-strong: #16b9bd;
  --accent-soft: rgb(98 225 220 / 13%);
  --warning: #f1c56f;
  --danger: #f7839a;
  --focus: #9bf3f1;
  --shadow: 0 20px 55px rgb(1 14 19 / 40%);
}

body {
  background:
    radial-gradient(58% 42% at 0% 0%, rgb(26 143 153 / 20%), transparent 70%),
    radial-gradient(48% 38% at 100% 10%, rgb(51 112 155 / 17%), transparent 72%),
    linear-gradient(135deg, #071a20 0%, #0b252c 55%, #06171d 100%);
}

body::before {
  background: linear-gradient(120deg, transparent 0 38%, rgb(98 225 220 / 6%) 52%, transparent 68%);
}

.app-header {
  background: rgb(6 24 30 / 91%);
  box-shadow: 0 8px 28px rgb(1 14 19 / 30%);
}

.header-inner,
.status-inner,
.workspace,
.conflict-banner {
  width: min(1280px, calc(100% - 48px));
}

.header-inner {
  min-height: 84px;
  padding-block: 13px;
  align-items: flex-start;
}

.brand-mark {
  border-color: rgb(98 225 220 / 65%);
  background: linear-gradient(145deg, #a6f5ef, #21bfc2);
  color: #052025;
  box-shadow: 0 0 0 4px rgb(98 225 220 / 11%), 0 8px 22px rgb(15 145 153 / 26%);
}

.header-actions {
  max-width: 790px;
  flex: 1 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 2px;
}

.button {
  min-height: 38px;
  border-color: var(--line-strong);
  background: rgb(18 54 61 / 90%);
}

.button:hover:not(:disabled) {
  border-color: rgb(98 225 220 / 72%);
  background: rgb(27 78 84 / 96%);
  box-shadow: 0 8px 20px rgb(1 14 19 / 24%), inset 0 1px rgb(255 255 255 / 9%);
}

.button-primary {
  border-color: rgb(98 225 220 / 82%);
  background: var(--accent);
  color: #052025;
  box-shadow: 0 8px 20px rgb(15 145 153 / 25%), inset 0 1px rgb(255 255 255 / 42%);
}

.button-primary:hover:not(:disabled) {
  border-color: #c4fffb;
  background: #8cf0eb;
  color: #052025;
}

.status-band {
  background: rgb(7 31 37 / 88%);
}

.status-dot.online,
.json-status-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgb(98 225 220 / 11%), 0 0 15px rgb(98 225 220 / 45%);
}

.document-state {
  background: rgb(17 57 64 / 90%);
}

.workspace {
  padding-top: 40px;
}

.workspace-intro {
  min-height: 160px;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.68fr);
  gap: 42px;
  margin-bottom: 34px;
}

.workspace-intro h2,
.overview-stat strong,
.section-heading h2 {
  color: #ecffff;
}

.workspace-intro h2 {
  font-size: clamp(27px, 3vw, 40px);
}

.overview-stats {
  border-color: var(--line-strong);
  background: rgb(91 202 204 / 13%);
}

.overview-stat {
  background: rgb(10 38 45 / 91%);
}

.tabs {
  gap: 30px;
}

.metadata-grid {
  gap: 22px;
}

.section-heading {
  min-height: 0;
  margin-top: 38px;
  padding-top: 20px;
  align-items: flex-start;
}

.list-tools {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.search-field,
.field input,
.field textarea,
.sort-field select {
  border-color: var(--line-strong);
  background: rgb(6 27 33 / 83%);
}

.field input:hover,
.field textarea:hover,
.sort-field select:hover,
.search-field:hover {
  border-color: rgb(98 225 220 / 56%);
  background: rgb(12 45 52 / 94%);
}

.field input:focus,
.field textarea:focus,
.sort-field select:focus,
.search-field:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgb(155 243 241 / 13%), 0 0 18px rgb(98 225 220 / 10%);
}

.icon-row,
.empty-state {
  border-color: var(--line);
  background: linear-gradient(105deg, rgb(12 43 50 / 94%), rgb(8 29 37 / 92%));
  box-shadow: 0 10px 28px rgb(1 14 19 / 22%);
}

.icon-row:hover {
  border-color: rgb(98 225 220 / 50%);
  box-shadow: 0 14px 32px rgb(1 14 19 / 28%), 0 0 24px rgb(98 225 220 / 8%);
}

.row-index,
#icon-count {
  border-color: rgb(98 225 220 / 42%);
  background: rgb(98 225 220 / 12%);
  color: #b9fffb;
}

.icon-preview,
.icon-card .home-icon-preview {
  border-color: var(--line-strong);
  background: linear-gradient(145deg, rgb(21 68 76 / 88%), rgb(7 28 37 / 94%));
}

.icon-preview:hover,
.icon-preview:focus-visible {
  border-color: var(--accent);
  background: rgb(20 78 83 / 92%);
  box-shadow: 0 8px 22px rgb(15 145 153 / 25%);
}

.icon-button {
  border-color: var(--line-strong);
  background: rgb(11 45 52 / 92%);
}

.icon-button:hover:not(:disabled) {
  border-color: rgb(98 225 220 / 68%);
  background: rgb(20 78 83 / 92%);
  color: var(--accent);
}

#json-editor {
  border-color: var(--line-strong);
  background: #061820;
  color: #d9ffff;
}

dialog {
  border-color: var(--line-strong);
  background: rgb(9 35 42 / 98%);
  box-shadow: 0 26px 80px rgb(1 14 19 / 60%);
}

.toast {
  border-color: rgb(98 225 220 / 56%);
  background: rgb(9 39 47 / 98%);
  box-shadow: 0 14px 34px rgb(1 14 19 / 42%);
}

.home-stat,
.home-metadata-card,
.icon-card {
  border-color: var(--line);
  background: var(--surface-soft);
}

.home-stat strong {
  color: var(--accent);
}

@media (max-width: 1100px) and (min-width: 981px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 12px 24px;
  }

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

@media (max-width: 680px) {
  .header-inner,
  .status-inner,
  .workspace,
  .conflict-banner {
    width: calc(100% - 28px);
  }

  .workspace {
    padding-top: 30px;
  }

  .workspace-intro {
    margin-bottom: 24px;
  }
}

/* Responsive layout pass: keep dense controls readable without horizontal scroll. */
@media (max-width: 980px) and (min-width: 681px) {
  .header-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  .header-actions .button {
    width: 100%;
    min-height: 42px;
    padding-inline: 8px;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
  }

  .workspace-intro {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .overview-stats {
    width: min(640px, 100%);
  }

  .section-heading {
    width: 100%;
  }

  .list-tools {
    justify-content: flex-start;
  }

  .icon-row {
    grid-template-columns: 34px 58px minmax(140px, 0.8fr) minmax(210px, 1.2fr) 92px;
    gap: 10px;
    padding-inline: 10px;
  }
}

@media (max-width: 680px) {
  .status-inner {
    align-items: flex-start;
  }

  .document-state {
    width: 100%;
    margin-left: 0;
    text-align: center;
  }

  .workspace-intro {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 24px;
  }

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

  .overview-stat:nth-child(2) {
    border-left: 1px solid var(--line);
  }

  .overview-stat:last-child {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .section-heading > div:first-child {
    width: 100%;
    justify-content: space-between;
  }

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

  .sort-field {
    grid-column: 1;
  }

  .list-tools > .button {
    grid-column: 2;
  }

  .json-actions,
  .empty-actions,
  .dialog-actions {
    flex-wrap: wrap;
  }

  .json-actions .button,
  .empty-actions .button,
  .dialog-actions .button {
    min-width: 0;
    flex: 1 1 140px;
  }

  .conflict-copy {
    min-width: 0;
  }

  .conflict-banner .button-conflict {
    min-width: 0;
    white-space: normal;
  }
}

@media (max-width: 420px) {
  .header-inner,
  .status-inner,
  .workspace,
  .conflict-banner {
    width: calc(100% - 20px);
  }

  .header-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .header-actions .button {
    min-height: 43px;
    padding-inline: 5px;
    font-size: 11px;
  }

  .overview-stat {
    min-height: 74px;
    padding: 11px 10px;
  }

  .overview-stat strong {
    font-size: 16px;
  }

  .overview-stat span {
    font-size: 10px;
  }

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

  .sort-field,
  .list-tools > .button {
    grid-column: 1;
  }

  .sort-field {
    justify-content: space-between;
  }

  .sort-field select {
    max-width: none;
  }

  .icon-row {
    grid-template-columns: 30px 46px minmax(0, 1fr);
    padding: 10px;
  }

  .icon-row .url-field,
  .icon-row .row-actions {
    grid-column: 1 / -1;
  }

  .dialog-actions .button {
    flex-basis: 100%;
  }
}

/* Glacier Cyan light theme */
:root {
  color-scheme: light;
  --canvas: #f8fbfd;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-soft: rgb(255 255 255 / 86%);
  --ink: #0f172a;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #dceff5;
  --line-strong: #c5e4ed;
  --accent: #7dd3fc;
  --accent-strong: #38bdf8;
  --accent-soft: #e8f8fd;
  --warning: #d97706;
  --danger: #e11d48;
  --focus: #22d3ee;
  --shadow: 0 14px 34px rgb(15 23 42 / 8%);
}

body {
  color: var(--ink);
  background:
    radial-gradient(62% 46% at 0% 0%, rgb(125 211 252 / 18%), transparent 70%),
    radial-gradient(48% 38% at 100% 8%, rgb(34 211 238 / 11%), transparent 72%),
    linear-gradient(135deg, #f8fbfd 0%, #f1f9fc 56%, #f8fbfd 100%);
}

body::before {
  background: linear-gradient(120deg, transparent 0 38%, rgb(34 211 238 / 8%) 52%, transparent 68%);
  mask-image: linear-gradient(to bottom, #fff, transparent 85%);
}

::selection {
  background: rgb(34 211 238 / 25%);
  color: #0f172a;
}

.app-header {
  border-bottom-color: var(--line);
  background: rgb(255 255 255 / 82%);
  box-shadow: 0 8px 28px rgb(15 23 42 / 7%);
  backdrop-filter: blur(18px) saturate(125%);
}

.brand-mark {
  border-color: rgb(56 189 248 / 48%);
  background: linear-gradient(145deg, #7dd3fc, #22d3ee);
  color: #0f172a;
  box-shadow: 0 0 0 4px rgb(125 211 252 / 15%), 0 8px 22px rgb(14 165 233 / 16%);
}

.brand-block p,
.status-inner,
.document-state,
.field > span:first-child {
  color: var(--muted);
}

.button {
  border-color: var(--line-strong);
  background: rgb(255 255 255 / 90%);
  color: var(--ink);
  box-shadow: 0 1px 2px rgb(15 23 42 / 4%);
}

.button:hover:not(:disabled) {
  border-color: var(--accent-strong);
  background: #f0fbfe;
  color: #0f172a;
  box-shadow: 0 8px 20px rgb(14 165 233 / 12%);
}

.button-primary {
  border-color: #38bdf8;
  background: linear-gradient(135deg, #7dd3fc, #22d3ee);
  color: #0f172a;
  box-shadow: 0 8px 20px rgb(14 165 233 / 16%);
}

.button-primary:hover:not(:disabled) {
  border-color: #0ea5e9;
  background: linear-gradient(135deg, #93dcfd, #67e8f9);
  color: #0f172a;
}

.status-band {
  border-bottom-color: var(--line);
  background: rgb(240 249 252 / 88%);
}

.status-dot,
.status-dot.online,
.json-status-dot {
  background: var(--accent-strong);
  box-shadow: 0 0 0 4px rgb(56 189 248 / 14%), 0 0 14px rgb(34 211 238 / 32%);
}

.status-dot.error {
  background: var(--danger);
  box-shadow: 0 0 12px rgb(225 29 72 / 28%);
}

.document-state {
  border-color: var(--line-strong);
  background: #ffffff;
}

.workspace-intro h2,
.overview-stat strong,
.section-heading h2 {
  color: #0f172a;
}

.eyebrow,
.tab.is-active,
.tab.is-active .tab-icon,
.home-stat strong {
  color: #0ea5e9;
}

.overview-stats {
  border-color: var(--line-strong);
  background: rgb(220 239 245 / 72%);
  box-shadow: var(--shadow);
}

.overview-stat {
  background: rgb(255 255 255 / 92%);
}

.tabs {
  border-bottom-color: var(--line);
}

.tab {
  color: var(--muted);
}

.tab:hover {
  color: var(--ink);
}

.field input,
.field textarea,
.sort-field select,
.search-field {
  border-color: var(--line-strong);
  background: rgb(255 255 255 / 88%);
  color: var(--ink);
  box-shadow: inset 0 1px rgb(255 255 255 / 80%);
}

.field input:hover,
.field textarea:hover,
.sort-field select:hover,
.search-field:hover {
  border-color: var(--accent-strong);
  background: #ffffff;
}

.field input:focus,
.field textarea:focus,
.sort-field select:focus,
.search-field:focus-within {
  border-color: #22d3ee;
  box-shadow: 0 0 0 3px rgb(34 211 238 / 16%), 0 8px 18px rgb(14 165 233 / 8%);
}

.search-field input,
.search-field input::placeholder {
  color: var(--ink);
}

.search-field input::placeholder {
  color: var(--muted);
}

.section-heading {
  border-top-color: var(--line);
}

#icon-count,
.row-index {
  border-color: rgb(56 189 248 / 40%);
  background: #e8f8fd;
  color: #0369a1;
  text-shadow: none;
  box-shadow: none;
}

.icon-row,
.empty-state {
  border-color: var(--line);
  background: rgb(255 255 255 / 90%);
  box-shadow: 0 10px 28px rgb(15 23 42 / 7%);
}

.icon-row:hover {
  border-color: rgb(56 189 248 / 62%);
  box-shadow: 0 14px 32px rgb(14 165 233 / 13%);
}

.icon-preview,
.icon-card .home-icon-preview {
  border-color: var(--line-strong);
  background: linear-gradient(145deg, #effaff, #dff5fa);
}

.icon-preview:hover,
.icon-preview:focus-visible {
  border-color: var(--accent-strong);
  background: #e8f8fd;
  box-shadow: 0 8px 22px rgb(14 165 233 / 14%);
}

.icon-button {
  border-color: var(--line-strong);
  background: #ffffff;
  color: var(--muted);
}

.icon-button:hover:not(:disabled) {
  border-color: var(--accent-strong);
  background: #e8f8fd;
  color: #0ea5e9;
}

.empty-icon {
  border-color: rgb(56 189 248 / 44%);
  background: var(--accent-soft);
  color: #0ea5e9;
}

#json-editor {
  border-color: var(--line-strong);
  background: #f1f9fc;
  color: #0f172a;
  box-shadow: inset 0 1px #ffffff, var(--shadow);
}

dialog {
  border-color: var(--line-strong);
  background: rgb(255 255 255 / 97%);
  color: var(--ink);
  box-shadow: 0 26px 80px rgb(15 23 42 / 18%);
}

dialog::backdrop {
  background: rgb(15 23 42 / 28%) !important;
  backdrop-filter: blur(5px);
}

.toast {
  border-color: rgb(56 189 248 / 52%);
  background: rgb(255 255 255 / 98%);
  color: #0f172a;
  box-shadow: 0 14px 34px rgb(15 23 42 / 14%);
}

.home-stat,
.home-metadata-card,
.icon-card,
.login-card,
.submission-card,
.review-item,
.moderation-panel,
.telegram-settings {
  border-color: var(--line);
  background: rgb(255 255 255 / 88%);
  box-shadow: var(--shadow);
}

.home-header h1 {
  color: #0f172a !important;
}

.home-header .eyebrow {
  color: #0ea5e9 !important;
}

.home-error,
.standalone-result.error {
  background: rgb(225 29 72 / 7%) !important;
}

.moderation-dialog::backdrop,
.github-proxy-dialog::backdrop {
  background: rgb(15 23 42 / 28%) !important;
}

.moderation-item,
.review-item,
.submission-card {
  background: #ffffff !important;
}

.moderation-item img,
.review-item img {
  background: #effaff !important;
}

.admin-login-card,
.github-proxy-panel {
  background: #ffffff !important;
}

.conflict-banner {
  border-color: rgb(217 119 6 / 35%);
  background: rgb(255 247 237 / 96%);
  color: #92400e;
  box-shadow: 0 12px 35px rgb(15 23 42 / 7%);
}

.conflict-copy span,
.conflict-close {
  color: #a16207;
}

.button-conflict {
  border-color: rgb(217 119 6 / 35%);
  background: #fffaf0;
  color: #92400e;
}

.button-conflict-force {
  border-color: rgb(225 29 72 / 28%);
  background: #fff1f2;
  color: #be123c;
}

body.has-unsaved-changes .status-band {
  background: linear-gradient(90deg, rgb(254 243 199 / 72%), rgb(240 249 252 / 90%) 50%, rgb(254 243 199 / 72%));
}

/* Fine visual tuning */
.button-primary {
  border-color: #bae6fd;
  background: #e0f2fe;
  color: #0369a1;
  box-shadow: 0 1px 2px rgb(14 165 233 / 10%);
}

.button-primary:hover:not(:disabled) {
  border-color: #7dd3fc;
  background: #bae6fd;
  color: #0f172a;
  box-shadow: 0 4px 12px rgb(14 165 233 / 14%);
}

.button-primary:active:not(:disabled) {
  background: #a5defa;
  box-shadow: inset 0 1px 2px rgb(14 165 233 / 10%);
}

body.has-unsaved-changes #save-button:not(:disabled) {
  box-shadow: 0 0 0 3px rgb(125 211 252 / 24%), 0 4px 12px rgb(14 165 233 / 12%);
}

.row-index {
  border-color: #dceff5;
  border-radius: 8px;
  background: #f8fbfd;
  color: #64748b;
  font-weight: 700;
  text-shadow: none;
  box-shadow: none;
}

.row-index::before {
  color: #94a3b8;
}

.icon-row:hover .row-index,
.icon-row:focus-within .row-index {
  border-color: #bae6fd;
  background: #effaff;
  color: #0369a1;
  box-shadow: 0 2px 6px rgb(14 165 233 / 10%);
}

.icon-row:hover .row-index::before,
.icon-row:focus-within .row-index::before {
  color: #0ea5e9;
}

.icon-validity-dialog {
  width: min(980px, calc(100% - 28px));
  max-height: min(820px, calc(100vh - 28px));
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
}

.icon-validity-dialog::backdrop {
  background: rgb(15 23 42 / 28%);
  backdrop-filter: blur(6px);
}

.icon-validity-panel {
  max-height: min(820px, calc(100vh - 28px));
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.icon-validity-heading,
.icon-validity-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.icon-validity-heading h2 {
  margin: 4px 0 6px;
}

.icon-validity-heading p:last-child,
.icon-validity-toolbar p,
.icon-validity-summary {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.icon-validity-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.icon-validity-summary {
  min-height: 22px;
  margin-top: 18px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8fbfd;
}

.icon-validity-summary.is-running {
  border-color: #bae6fd;
  background: #effaff;
  color: #0369a1;
}

.icon-validity-summary.is-success {
  border-color: rgb(16 185 129 / 28%);
  background: rgb(236 253 245 / 80%);
  color: #047857;
}

.icon-validity-summary.is-error {
  border-color: rgb(225 29 72 / 24%);
  background: #fff1f2;
  color: #be123c;
}

.icon-validity-toolbar {
  align-items: center;
  margin-top: 12px;
}

.icon-validity-toolbar p {
  margin: 0;
}

.icon-validity-toolbar .button[hidden] {
  display: none;
}

.icon-validity-note.is-success {
  color: #047857;
}

.icon-validity-note.is-error {
  color: #be123c;
}

.button-danger {
  border-color: rgb(225 29 72 / 28%);
  background: #fff1f2;
  color: #be123c;
}

.button-danger:hover:not(:disabled) {
  border-color: rgb(225 29 72 / 48%);
  background: #ffe4e6;
  color: #9f1239;
}

.icon-validity-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.icon-validity-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px;
  border: 1px solid rgb(225 29 72 / 22%);
  border-radius: 10px;
  background: #fffafa;
}

.icon-validity-item img,
.icon-validity-preview {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 8px;
  background: #effaff;
}

.icon-validity-preview {
  display: grid;
  place-items: center;
  border: 1px solid #fecdd3;
  color: #be123c;
  font-size: 24px;
  font-weight: 800;
}

.icon-validity-item-content {
  min-width: 0;
}

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

.icon-validity-item-actions .is-disabled {
  cursor: not-allowed;
  opacity: 0.55;
  pointer-events: none;
}

.icon-validity-item h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.icon-validity-item p {
  margin: 3px 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.icon-validity-reason {
  color: #be123c;
}

.icon-validity-url {
  color: var(--muted);
}

.icon-validity-empty {
  display: grid;
  justify-items: center;
  gap: 7px;
  margin-top: 16px;
  padding: 28px 16px;
  border: 1px dashed #bae6fd;
  border-radius: 10px;
  background: #f8fdff;
  color: var(--muted);
  text-align: center;
}

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

.icon-validity-empty strong {
  color: #0369a1;
}

@media (max-width: 700px) {
  .icon-validity-dialog {
    width: calc(100% - 20px);
    max-height: calc(100vh - 20px);
  }

  .icon-validity-panel {
    max-height: calc(100vh - 20px);
    padding: 17px;
  }

  .icon-validity-heading,
  .icon-validity-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .icon-validity-actions {
    width: 100%;
  }

  .icon-validity-actions .button,
  .icon-validity-toolbar .button {
    flex: 1;
  }

  .icon-validity-item {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 10px;
    padding: 11px;
  }

  .icon-validity-item img,
  .icon-validity-preview {
    width: 48px;
    height: 48px;
  }

  .icon-validity-item .button {
    width: 100%;
  }

  .icon-validity-item-actions {
    grid-column: 1 / -1;
    width: 100%;
    flex-direction: column;
  }
}

@media (max-width: 680px) {
  .header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .header-actions > .button {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding-inline: 6px;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
  }
}

@media (max-width: 420px) {
  .header-actions {
    gap: 6px;
  }

  .header-actions > .button {
    min-height: 40px;
    padding-inline: 4px;
    font-size: 11px;
  }
}
