:root {
  --bg: #f6f6f9;
  --surface: #fff;
  --side: #f0f0f5;
  --text: #272535;
  --muted: #91909e;
  --line: #ecebf1;
  --accent: #7754d8;
  --soft: #f1edfb;
  --hover: #faf9fd;
  --input: #f8f8fb;
  --green: #568a70;
  --shadow: 0 8px 32px #28214305;
  color-scheme: light;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 13px;
  white-space: nowrap;
  transition:
    background 0.15s,
    box-shadow 0.15s;
}
button:hover {
  background: var(--hover);
  border-color: #d5cdea;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #b5a2eb;
  outline-offset: 2px;
}
input,
select,
textarea {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  min-width: 0;
}
input[type="checkbox"] {
  appearance: none;
  width: 15px;
  height: 15px;
  padding: 0;
  vertical-align: middle;
  border: 1.5px solid #cecbd9;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
}
input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
input[type="checkbox"]:checked:after {
  content: "✓";
  color: white;
  position: absolute;
  left: 2px;
  top: -3px;
  font-size: 13px;
}
input[type="checkbox"]:indeterminate {
  background: var(--accent);
}
[hidden] {
  display: none !important;
}
.sidebar {
  width: 210px;
  background: var(--side);
  position: fixed;
  inset: 0 auto 0 0;
  padding: 30px 18px 15px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  padding: 0 6px;
}
.brand img {
  width: 37px;
  height: 37px;
  border-radius: 11px;
  box-shadow: 0 4px 8px #55427d17;
}
.brand > span {
  font-weight: 750;
  font-size: 22px;
  letter-spacing: -0.8px;
}
.brand small {
  display: block;
  font-weight: 400;
  font-size: 9px;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-top: 1px;
}
.workspace {
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  margin: 29px 0 28px;
  padding: 12px 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.avatar,
.user-avatar {
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 650;
  background: #e9e2f8;
  color: var(--accent);
  border-radius: 9px;
  width: 29px;
  height: 29px;
}
.workspace > span:nth-child(2) {
  font-size: 12px;
  font-weight: 600;
}
.workspace small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}
.chevrons {
  margin-left: auto;
  color: var(--muted);
}
.nav-label {
  color: #a19caa;
  font-size: 10px;
  letter-spacing: 1.6px;
  padding: 0 13px;
  margin-bottom: 9px;
}
nav button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  margin: 3px 0;
  background: none;
  border-color: transparent;
  padding: 11px 13px;
  text-align: left;
  color: #767180;
  font-size: 12px;
}
nav button.active {
  background: #e8e1f8;
  color: #6d48c4;
  font-weight: 600;
}
nav button b {
  font-weight: 400;
  margin-left: auto;
  font-size: 10px;
  opacity: 0.7;
}
.nav-icon {
  font-size: 16px;
  width: 18px;
  text-align: center;
}
.sidebar-note {
  margin: 30px 2px 15px;
  padding: 16px 12px 13px;
  border: 1px solid #dfdbe8;
  border-radius: 11px;
}
.note-icon {
  font-size: 21px;
  color: var(--accent);
  display: block;
  margin-bottom: 8px;
}
.sidebar-note strong {
  font-size: 11px;
  font-weight: 600;
}
.sidebar-note p {
  font-size: 10px;
  line-height: 1.9;
  color: var(--muted);
  margin: 6px 0 13px;
}
.sidebar-note button {
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 11px;
  padding: 0;
  display: flex;
  width: 100%;
  justify-content: space-between;
}
.sidebar-bottom {
  margin-top: auto;
}
.sidebar-bottom > button {
  display: flex;
  gap: 10px;
  border: 0;
  background: none;
  color: #827b8d;
  width: 100%;
  font-size: 12px;
  text-align: left;
  padding: 9px 12px;
}
.version {
  margin: 15px 4px 0;
  font-size: 9px;
  color: #a29baa;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.version span {
  border: 1px solid #dcd7e5;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 9px;
}
.shell {
  margin-left: 210px;
}
.topbar {
  height: 69px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 35px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.breadcrumb {
  font-size: 11px;
  color: var(--muted);
}
.breadcrumb span {
  margin: 0 12px;
  color: #cdc8d4;
}
.breadcrumb strong {
  font-weight: 500;
  color: #635c70;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 17px;
}
.privacy {
  font-size: 10px;
  color: #83858b;
  display: flex;
  align-items: center;
  gap: 7px;
}
.privacy i {
  width: 5px;
  height: 5px;
  background: #73a78c;
  border-radius: 50%;
}
.top-actions button {
  border: 0;
  background: transparent;
  font-size: 11px;
  color: #736a83;
  padding: 5px;
}
.top-actions button span {
  padding-left: 6px;
}
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eeebf3;
  font-size: 10px;
  color: #847991;
}
main {
  max-width: 1660px;
  margin: auto;
  padding: 34px 34px 18px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}
.eyebrow {
  color: #a29bad;
  font-size: 9px;
  letter-spacing: 2px;
  font-weight: 600;
  margin-bottom: 10px;
}
h1 {
  font-size: 25px;
  letter-spacing: -0.8px;
  font-weight: 650;
  margin: 0 0 8px;
  line-height: 1.5;
}
.heading-dot {
  color: var(--accent);
  padding-left: 4px;
}
.page-heading p {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}
.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 3px 8px #7854d619;
  font-weight: 500;
  padding: 10px 15px;
  font-size: 12px;
}
.primary:hover {
  background: #6743c5;
  border-color: #6743c5;
}
.primary > span {
  margin-right: 5px;
}
.welcome {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(95deg, #efebf8, #f4f0fb 70%, #f1edf7);
  border: 1px solid #e6dff4;
  border-radius: 11px;
  padding: 16px 20px;
  margin-bottom: 25px;
}
.welcome-symbol {
  width: 36px;
  height: 38px;
  color: var(--accent);
  font-size: 26px;
  background: #e7def8;
  border-radius: 9px;
  display: grid;
  place-items: center;
}
.welcome strong {
  font-weight: 550;
  font-size: 12px;
  color: #675084;
}
.welcome p {
  margin: 3px 0 0;
  color: #9a89af;
  font-size: 10px;
}
.welcome button {
  margin-left: 15px;
  color: #7b58b0;
  font-size: 11px;
  background: #ffffff80;
  border-color: #dfd3ef;
  padding: 7px 12px;
}
.welcome button span {
  margin-left: 12px;
}
.demo-label {
  margin-left: auto;
  font-size: 10px;
  color: #a998ba;
  white-space: nowrap;
}
.editor {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.editor-top {
  height: 66px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}
.tabs {
  display: flex;
  gap: 23px;
  align-items: stretch;
}
.tabs button {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #938b9e;
  font-size: 12px;
  padding: 0 0;
  position: relative;
}
.tabs button.active {
  color: var(--accent);
  font-weight: 600;
}
.tabs button.active:after {
  content: "";
  height: 2px;
  background: var(--accent);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  border-radius: 2px;
}
.tabs span {
  font-size: 10px;
  border-radius: 5px;
  background: var(--input);
  color: #99909f;
  margin-left: 6px;
  padding: 2px 5px;
  font-weight: 400;
}
.tabs .active span {
  background: var(--soft);
  color: var(--accent);
}
.tools {
  display: flex;
  align-items: center;
  gap: 10px;
}
.search {
  display: flex;
  align-items: center;
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 7px;
  height: 31px;
  padding: 0 9px;
  gap: 6px;
  color: var(--muted);
}
.search > span {
  font-size: 19px;
}
.search input {
  font-size: 10px;
  width: 158px;
  border: 0;
  outline: none;
  padding: 3px 0;
  background: none;
}
.search input:focus-visible {
  outline: 0;
}
.search:focus-within {
  outline: 2px solid #b5a2eb;
}
kbd {
  font-family: inherit;
  font-size: 9px;
  color: #a9a0b2;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0 4px;
  border-radius: 3px;
}
.icon-btn {
  font-size: 17px;
  line-height: 1;
  width: 31px;
  height: 31px;
  padding: 0;
  color: #867d93;
}
.editor-body {
  display: flex;
  min-height: 485px;
}
.table-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.table-scroll {
  overflow: auto;
  max-height: 590px;
  scrollbar-width: thin;
}
.table-area table {
  border-collapse: collapse;
  width: 100%;
  white-space: nowrap;
  table-layout: auto;
}
.table-area th {
  font-size: 10px;
  font-weight: 400;
  text-align: left;
  color: #96909f;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--hover);
  position: sticky;
  top: 0;
  z-index: 1;
}
.table-area td {
  font-size: 11px;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  height: 59px;
}
.table-area tr {
  cursor: pointer;
}
.table-area tr:hover {
  background: var(--hover);
}
.table-area tr.current {
  background: #f8f5fe;
}
.table-area tr.current td:first-child {
  box-shadow: inset 2px 0 0 var(--accent);
}
.table-area tr.dirty .record-name:after {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
  margin: 0 0 2px 5px;
}
.check {
  width: 36px;
  padding-left: 20px !important;
  padding-right: 0 !important;
}
.name-column {
  min-width: 156px;
}
.record-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--logo-bg, #f0eef7);
  color: var(--logo-color, #686275);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.record-name {
  font-size: 11px;
  font-weight: 550;
}
.record-sub {
  font-size: 9px;
  color: #a29aa9;
  margin-top: 1px;
}
.pill {
  font-size: 9px;
  padding: 3px 7px;
  background: var(--input);
  color: #8e859c;
  border-radius: 5px;
}
.region {
  color: #817a89;
  font-size: 10px;
}
.region > span {
  padding-right: 5px;
}
.star-col {
  width: 40px;
  text-align: center !important;
}
.star {
  font-size: 18px;
  background: transparent;
  padding: 0;
  border: 0;
  color: #d7d1df;
  line-height: 1;
  width: 26px;
  height: 26px;
}
.star.on {
  color: #ab8a56;
}
.star:hover {
  background: transparent;
  color: #ab8a56;
}
.usage-cell {
  font-size: 10px !important;
  color: #89818f;
  min-width: 83px;
}
.status {
  font-size: 10px;
  color: var(--green);
  display: flex;
  gap: 6px;
  align-items: center;
}
.status:before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}
.status.wait {
  color: #b39764;
}
.inline-input {
  width: 100%;
  min-width: 70px;
  padding: 5px;
  font-size: 11px;
}
.add-row {
  border: 0;
  border-radius: 0;
  padding: 14px 20px;
  text-align: left;
  color: var(--accent);
  background: none;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.add-row span {
  font-size: 11px;
}
.add-row small {
  font-size: 10px;
  color: #b4a9bf;
  margin-left: 5px;
}
.table-footer {
  display: flex;
  justify-content: space-between;
  color: #a89faf;
  font-size: 9px;
  margin-top: auto;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
}
.key-hint {
  border: 1px solid var(--line);
  padding: 0 3px;
  border-radius: 3px;
  margin-left: 4px;
}
.detail {
  width: 276px;
  flex-shrink: 0;
  background: var(--hover);
  border-left: 1px solid var(--line);
  padding: 21px 21px 14px;
}
.detail-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: #a69bb0;
  margin-bottom: 22px;
}
.detail-title button {
  border: 0;
  background: none;
  padding: 0;
  font-size: 16px;
  color: var(--muted);
}
.detail-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.detail-brand .logo {
  width: 41px;
  height: 41px;
  border-radius: 11px;
  font-size: 12px;
}
.detail-brand h2 {
  font-size: 15px;
  line-height: 1.3;
  margin: 0 0 4px;
  font-weight: 650;
}
.detail-brand small {
  font-size: 9px;
  color: #a094ad;
}
.detail label {
  display: block;
  font-size: 10px;
  color: #96889e;
  margin-bottom: 14px;
}
.detail input:not([type="checkbox"]),
.detail select,
.detail textarea {
  width: 100%;
  display: block;
  margin-top: 6px;
  font-size: 11px;
  padding: 8px 10px;
  background: var(--surface);
  border-color: #e6e0ec;
  border-radius: 6px;
  line-height: 1.5;
}
.field-pair {
  display: flex;
  gap: 10px;
}
.field-pair label {
  width: 50%;
}
.detail .checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  color: #74647f;
}
.detail textarea {
  resize: vertical;
  min-height: 65px;
}
.detail-divider {
  border-top: 1px solid var(--line);
  margin: 21px 0 17px;
}
.local-note {
  display: flex;
  gap: 8px;
  color: #a097ac;
  font-size: 9px;
  line-height: 1.8;
  margin: 10px 0 19px;
}
.local-note strong {
  display: block;
  color: #91839e;
  font-weight: 500;
}
.detail-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.detail-actions button {
  font-size: 10px;
  padding: 7px 9px;
  flex: 1;
}
.detail-actions .primary {
  box-shadow: none;
}
.savebar {
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  gap: 12px;
  background: var(--surface);
}
.savebar > div:first-child {
  position: relative;
  padding-left: 15px;
}
.save-dot {
  position: absolute;
  top: 6px;
  left: 0;
  border-radius: 50%;
  width: 5px;
  height: 5px;
  background: #b1a6bc;
}
.save-dot.pending {
  background: #b79461;
}
.save-dot.saved {
  background: #71a189;
}
.savebar strong {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: #7b6f87;
}
.savebar small {
  display: block;
  font-size: 9px;
  color: #ac9eb6;
  margin-top: 3px;
}
.save-actions {
  display: flex;
  gap: 8px;
}
.save-actions > button:not(.primary) {
  border: 0;
  background: none;
  font-size: 11px;
  color: #988da4;
}
.savebar .primary {
  font-size: 11px;
  padding: 8px 13px;
}
.savebar .primary span {
  margin-left: 13px;
  margin-right: 0;
}
.bottom-caption {
  display: flex;
  justify-content: space-between;
  color: #a59baa;
  font-size: 9px;
  margin-top: 16px;
  padding: 0 3px;
}
.batch-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--soft);
  padding: 8px 20px;
  font-size: 11px;
  color: var(--accent);
  border-bottom: 1px solid var(--line);
}
.batch-bar select,
.batch-bar button {
  padding: 4px 9px;
  font-size: 10px;
}
.batch-bar #deselect {
  margin-left: auto;
  background: none;
  border: 0;
}
#empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--muted);
}
#empty > div {
  font-size: 32px;
}
#empty h3 {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}
#empty p {
  font-size: 11px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 0;
  width: min(740px, calc(100vw - 40px));
  max-height: 85vh;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 28px 100px #1e153b2b;
}
dialog::backdrop {
  background: #22153338;
  backdrop-filter: blur(4px);
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 25px 28px 17px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 {
  font-size: 20px;
  letter-spacing: -0.5px;
  margin: 0 0 6px;
}
.modal-head p {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}
.modal-close {
  border: 0;
  background: none;
  padding: 0 4px;
  font-size: 23px;
  color: var(--muted);
}
.modal-body {
  padding: 22px 28px;
  max-height: 60vh;
  overflow: auto;
}
.modal-body label {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-bottom: 15px;
}
.modal-body input,
.modal-body select {
  display: block;
  margin-top: 6px;
  width: 100%;
  font-size: 12px;
}
.modal-body textarea {
  width: 100%;
  resize: vertical;
  min-height: 160px;
  font-size: 12px;
  line-height: 1.8;
  font-family: ui-monospace, monospace;
  padding: 13px;
}
.modal-footer {
  padding: 16px 28px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}
.modal-footer small {
  margin-right: auto;
  color: var(--muted);
  font-size: 10px;
}
.modal-note {
  background: var(--soft);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 11px;
  color: #9278af;
  line-height: 1.9;
  margin-bottom: 18px;
}
.sample-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 10px;
}
.sample-line button {
  font-size: 10px;
  padding: 4px 9px;
}
.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin-top: 12px;
}
.preview-table th,
.preview-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}
.preview-table th {
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}
.preview-table td:first-child {
  color: var(--muted);
}
.summary-pills {
  display: flex;
  gap: 12px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}
.summary-pills span {
  background: var(--input);
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 11px;
  color: var(--muted);
}
.summary-pills b {
  color: var(--accent);
  font-size: 15px;
  padding-right: 5px;
}
.warn {
  color: #ac8056;
  font-size: 11px;
}
.connection-option {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 12px;
  display: flex;
  gap: 14px;
}
.connection-option .connection-icon {
  font-size: 23px;
  color: var(--accent);
  width: 32px;
}
.connection-option strong {
  font-size: 13px;
  font-weight: 600;
}
.connection-option p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.9;
  margin: 7px 0 0;
}
.connection-option small {
  display: inline-block;
  margin-top: 10px;
  background: var(--soft);
  color: var(--accent);
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 9px;
}
.help-step {
  display: flex;
  gap: 14px;
  margin: 6px 0 25px;
}
.help-step > b {
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--accent);
  border-radius: 50%;
  height: 28px;
  width: 28px;
  flex-shrink: 0;
}
.help-step strong {
  font-size: 13px;
}
.help-step p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.9;
  margin: 5px 0 0;
}
#toast {
  position: fixed;
  bottom: 28px;
  left: calc(50% + 100px);
  transform: translateX(-50%) translateY(20px);
  padding: 12px 20px;
  background: #38303f;
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 30px #0002;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  font-size: 12px;
  z-index: 10;
  max-width: 80vw;
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.error-message {
  color: #bc6868;
  font-size: 11px;
  margin: 10px 0;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.form-grid .wide {
  grid-column: 1/-1;
}
.modal-body .primary-choice {
  display: flex;
  gap: 8px;
  align-items: center;
}
.modal-body .primary-choice input {
  display: inline-block;
  width: 15px;
  margin: 0;
}
.dirty-note {
  color: var(--accent);
  font-size: 10px;
}
.diff-before {
  color: var(--muted);
  text-decoration: line-through;
  margin-right: 7px;
}
.diff-after {
  color: var(--accent);
}
body.dark {
  --bg: #17161c;
  --side: #1c1b23;
  --surface: #211f29;
  --text: #e4dfec;
  --muted: #898092;
  --line: #322d3e;
  --accent: #a88be8;
  --soft: #342940;
  --hover: #26222f;
  --input: #292431;
  --green: #8abca5;
  color-scheme: dark;
}
body.dark .welcome {
  background: linear-gradient(100deg, #30263e, #27212f);
  border-color: #3c2f4a;
}
body.dark .welcome strong {
  color: #d4bfea;
}
body.dark .welcome-symbol {
  background: #403054;
}
body.dark .welcome button {
  background: #3b2c4c;
  border-color: #534065;
  color: #cfb7ea;
}
body.dark nav button.active {
  background: #342b46;
  color: #c4a7ef;
}
body.dark .table-area tr.current {
  background: #302637;
}
body.dark .detail input,
body.dark .detail select,
body.dark .detail textarea {
  border-color: var(--line);
}
body.dark .primary {
  background: #8d68cb;
  color: white;
  border-color: #8d68cb;
}
body.dark .logo {
  filter: brightness(0.8);
}
@media (min-width: 1500px) {
  .detail {
    width: 310px;
  }
  .table-area td {
    padding-top: 14px;
    padding-bottom: 14px;
  }
  .record-name {
    font-size: 12px;
  }
  .sidebar {
    width: 228px;
  }
  .shell {
    margin-left: 228px;
  }
  main {
    padding: 40px 45px;
  }
  .table-scroll {
    max-height: 640px;
  }
}
@media (max-width: 1180px) {
  .sidebar {
    width: 180px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .shell {
    margin-left: 180px;
  }
  main {
    padding: 25px 22px;
  }
  .topbar {
    padding: 0 22px;
  }
  .detail {
    width: 245px;
    padding: 18px 16px;
  }
  .table-area th,
  .table-area td {
    padding-left: 7px;
    padding-right: 7px;
  }
  .name-column {
    min-width: 135px;
  }
  .record-cell {
    gap: 6px;
  }
  .record-cell .logo {
    width: 25px;
    height: 25px;
    font-size: 8px;
  }
  h1 {
    font-size: 22px;
  }
  .search input {
    width: 130px;
  }
  .demo-label {
    display: none;
  }
  .table-area td:nth-child(6),
  .table-area th:nth-child(6) {
    display: none;
  }
  .table-footer > span:last-child {
    display: none;
  }
  .welcome button {
    margin-left: auto;
  }
}
@media (max-width: 950px) {
  .detail {
    width: 265px;
    position: fixed;
    right: 0;
    top: 69px;
    bottom: 0;
    overflow: auto;
    z-index: 3;
    box-shadow: -10px 0 60px #21143820;
  }
  .editor-body {
    min-height: 430px;
  }
  .sidebar {
    width: 170px;
  }
  .shell {
    margin-left: 170px;
  }
  .welcome {
    padding: 13px;
  }
  .welcome p {
    font-size: 9px;
  }
  .page-heading {
    gap: 15px;
  }
  .page-heading h1 {
    font-size: 20px;
  }
  .tools {
    gap: 5px;
  }
  .search input {
    width: 108px;
  }
  .search kbd {
    display: none;
  }
  .tabs {
    gap: 15px;
  }
  .privacy {
    display: none;
  }
  .bottom-caption > span:last-child {
    display: none;
  }
  .savebar small {
    max-width: 220px;
  }
  .table-area td:nth-child(6),
  .table-area th:nth-child(6) {
    display: table-cell;
  }
}
@media (max-width: 650px) {
  .sidebar {
    width: 62px;
    padding: 20px 6px;
  }
  .brand {
    padding: 0;
    justify-content: center;
  }
  .brand > span,
  .workspace,
  .nav-label,
  .sidebar-note,
  .sidebar-bottom {
    display: none;
  }
  nav {
    margin-top: 25px;
  }
  nav button {
    padding: 12px;
    justify-content: center;
  }
  nav button > span:not(.nav-icon),
  nav button b {
    display: none;
  }
  .shell {
    margin-left: 62px;
  }
  .topbar {
    height: 57px;
    padding: 0 15px;
  }
  .breadcrumb {
    font-size: 10px;
  }
  .top-actions {
    gap: 9px;
  }
  main {
    padding: 23px 14px;
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .page-heading h1 {
    font-size: 20px;
  }
  .eyebrow {
    font-size: 8px;
  }
  .page-heading p {
    font-size: 10px;
  }
  .page-heading > .primary {
    align-self: flex-end;
    margin-top: -6px;
    font-size: 10px;
  }
  .welcome {
    gap: 9px;
  }
  .welcome-symbol {
    display: none;
  }
  .welcome strong {
    font-size: 10px;
  }
  .welcome p {
    display: none;
  }
  .welcome button {
    font-size: 10px;
    padding: 6px;
  }
  .welcome button span {
    display: none;
  }
  .editor-top {
    padding: 0 12px;
    height: auto;
    min-height: 98px;
    flex-wrap: wrap;
  }
  .tabs {
    height: 45px;
  }
  .tools {
    width: 100%;
    padding-bottom: 10px;
  }
  .search {
    flex: 1;
  }
  .search input {
    width: 100%;
  }
  .table-area table {
    min-width: 550px;
  }
  .table-footer {
    padding: 10px 12px;
  }
  .add-row small {
    display: none;
  }
  .savebar {
    padding: 12px;
    flex-wrap: wrap;
  }
  .save-actions {
    margin-left: auto;
  }
  .savebar small {
    max-width: none;
  }
  .detail {
    top: 57px;
    width: min(310px, calc(100vw - 65px));
  }
  .batch-bar {
    flex-wrap: wrap;
    padding: 10px;
  }
  .modal-body,
  .modal-head,
  .modal-footer {
    padding: 18px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .bottom-caption {
    font-size: 8px;
  }
  #toast {
    left: 50%;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* Keep the save action visible on laptop displays; panes scroll independently. */
@media (min-width: 651px) {
  main {
    padding-top: 24px;
  }
  .page-heading {
    margin-bottom: 19px;
  }
  .eyebrow {
    margin-bottom: 6px;
  }
  .welcome {
    padding-top: 12px;
    padding-bottom: 12px;
    margin-bottom: 20px;
  }
  .editor {
    height: calc(100dvh - 330px);
    min-height: 355px;
    display: flex;
    flex-direction: column;
  }
  .editor-top,
  .savebar,
  .batch-bar {
    flex-shrink: 0;
  }
  .editor-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }
  .table-scroll {
    flex: 1;
    min-height: 0;
    max-height: none;
  }
  .detail {
    overflow-y: auto;
    scrollbar-width: thin;
  }
  .add-row,
  .table-footer {
    flex-shrink: 0;
  }
  .table-footer {
    margin-top: 0;
  }
  .bottom-caption {
    margin-top: 12px;
  }
}
.record-name {
  font-size: 12px;
}
.record-sub {
  font-size: 10px;
}
.usage-cell {
  font-size: 11px !important;
}
.region,
.status {
  font-size: 11px;
}
.table-area th {
  font-size: 11px;
}
.detail label {
  font-size: 11px;
}
.detail input:not([type="checkbox"]),
.detail select,
.detail textarea {
  font-size: 12px;
}
.page-heading p {
  color: #847c8e;
}
.table-footer {
  color: #827789;
}
.detail label {
  color: #82738e;
}
.record-sub {
  color: #8c8097;
}
.savebar small {
  color: #8d8198;
}
.welcome p {
  color: #8c77a4;
}

@media (min-width: 651px) {
  main {
    padding-top: 19px;
  }
  .eyebrow {
    display: none;
  }
  .page-heading {
    margin-bottom: 16px;
  }
  h1 {
    font-size: 25px;
    margin-bottom: 5px;
  }
  .welcome {
    margin-bottom: 18px;
    padding: 10px 16px;
  }
  .welcome-symbol {
    height: 33px;
    width: 33px;
  }
  .editor {
    height: calc(100dvh - 285px);
    min-height: 355px;
  }
  .editor-top {
    height: 53px;
  }
  .table-area td {
    height: 50px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .table-area th {
    padding-top: 9px;
    padding-bottom: 9px;
  }
  .add-row {
    padding: 8px 20px;
  }
  .table-footer {
    padding: 8px 20px;
  }
  .savebar {
    padding-top: 11px;
    padding-bottom: 11px;
  }
}
@media (max-height: 800px) and (min-width: 651px) {
  .sidebar-note {
    display: none;
  }
}

.file-drop {
  display: flex;
  position: relative;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 36px 20px;
  border: 2px dashed var(--line);
  border-radius: 16px;
  background: var(--surface);
  cursor: pointer;
  text-align: center;
}
.file-drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.file-drop:focus-within,
.file-drop.dragging {
  outline: 2px solid #7958cf;
  outline-offset: 3px;
  background: #7958cf12;
}
.file-drop-symbol {
  font-size: 32px;
  color: #7958cf;
}
.file-drop > span:last-of-type {
  font-size: 13px;
  color: var(--muted);
}
.file-sample {
  margin: 20px 0;
}
.file-sample summary {
  cursor: pointer;
  padding: 8px 0;
}
.file-sample .table-scroll {
  max-height: 200px;
}
.file-sample td {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sample-line a {
  font-size: 13px;
  color: #7958cf;
  text-decoration: none;
}

.pair-login { display:flex; align-items:center; gap:32px; padding:12px 0 24px; }
.pair-visual { text-align:center; flex:none; }
.pair-qr { width:218px; height:218px; display:grid; place-items:center; background:#fff; border:1px solid #e6e3de; border-radius:16px; overflow:hidden; }
.pair-qr svg { width:100%; height:100%; }
.pair-qr.expired svg { opacity:.12; }
#pairExpiry { display:block; margin-top:10px; font-size:12px; color:#817b72; }
.pair-instructions { flex:1; min-width:0; }
.pair-instructions p { font-size:13px; line-height:1.7; }
.pair-caption { display:block; font-size:12px; color:#817b72; margin-top:22px; }
.pair-code { display:block; font-family:monospace; letter-spacing:3px; font-size:27px; margin:8px 0; user-select:all; }
#pairDevice { color:#817b72; }
#pairStatus { color:#75624b; min-height:22px; }
@media(max-width:600px) { .pair-login { flex-direction:column; gap:20px; } .pair-instructions { text-align:center; } }

/* All App sections remain reachable even on shorter desktop windows. */
.sidebar #categories { min-height: 100px; overflow-y: auto; flex: 1; }
.catalog-status { color: var(--muted); font-size: 12px; margin: 0; }
.template-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-height: 150px; overflow-y: auto; padding: 2px; }
.template-option { text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 12px; min-height: 67px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--text); overflow-wrap: anywhere; }
.template-option strong { font-size: 13px; }
.template-option small { font-size: 11px; color: var(--muted); }
.template-option.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.template-option:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 650px) { .template-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
