/* Controls keep readable chrome while imported tokens preview on the page
   and embedded panel. A low-contrast draft remains easy to cancel. */
.af-appearance {
  background: #121923;
  border: 1px solid #67717e;
  border-radius: 16px;
  box-shadow: 0 24px 80px #0008;
  box-sizing: border-box;
  color: #fffaf2;
  color-scheme: dark;
  font: 15px/1.5 system-ui, sans-serif;
  max-height: calc(100dvh - 32px);
  max-width: 600px;
  overflow: auto;
  padding: 24px;
  text-align: start;
  width: calc(100% - 24px);
}
.af-appearance::backdrop {
  background: #050a1166;
}
.af-appearance[open] {
  display: flex;
  flex-direction: column;
}
.af-theme-body {
  min-height: 0;
  overflow: auto;
  padding: 4px;
}
.af-appearance * {
  box-sizing: border-box;
}
.af-appearance h2 {
  color: #fffaf2;
  font: 600 24px/1.2 system-ui, sans-serif;
  margin: 0 0 12px;
}
.af-appearance p,
.af-appearance li {
  color: inherit;
  font-size: 14px;
  line-height: 1.5;
  margin: 10px 0;
}
.af-appearance button {
  align-items: center;
  background: #263443;
  border: 1px solid #78828e;
  border-radius: 8px;
  color: #fffaf2;
  cursor: pointer;
  display: inline-flex;
  font: 500 14px/1.4 system-ui, sans-serif;
  justify-content: center;
  min-height: 40px;
  padding: 8px 12px;
}
.af-appearance button:hover {
  border-color: #f4d89b;
}
.af-appearance button:disabled {
  cursor: default;
  opacity: .55;
}
.af-appearance :focus-visible {
  outline: 2px solid #f4d89b;
  outline-offset: 3px;
}
.af-theme-controls {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  margin-block: 18px;
}
.af-theme-controls > button {
  align-self: end;
  justify-self: start;
}
.af-theme-field {
  color: #fffaf2;
  display: grid;
  font-size: 14px;
  gap: 6px;
  min-width: 0;
}
.af-theme-field input,
.af-theme-json textarea {
  background: #263443;
  border: 1px solid #78828e;
  border-radius: 6px;
  color: #fffaf2;
  font: 14px/1.5 system-ui, sans-serif;
  height: 38px;
  max-width: 100%;
  min-width: 0;
  padding: 5px 8px;
  width: 100%;
}
.af-theme-field input[type="color"] {
  padding: 3px;
  cursor: pointer;
}
.af-theme-transfer,
.af-theme-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.af-theme-actions {
  border-top: 1px solid #526170;
  padding-top: 18px;
  flex-shrink: 0;
}
.af-appearance .af-theme-primary {
  background: #f4d89b;
  color: #17130f;
  border-color: #f4d89b;
  flex: 1;
}
.af-theme-json {
  margin-top: 18px;
}
.af-theme-json summary {
  cursor: pointer;
  color: #f4d89b;
}
.af-theme-json label {
  color: #fffaf2;
  display: block;
  font-size: 14px;
  margin-top: 12px;
}
.af-theme-json textarea {
  display: block;
  font-family: ui-monospace, monospace;
  height: auto;
  margin-block: 8px;
  resize: vertical;
}
.af-theme-json a {
  color: #f4d89b;
  display: inline-block;
  font-size: 14px;
  margin-inline-start: 12px;
}
.af-appearance .af-theme-error,
#af-theme-warnings {
  color: #ffb199;
}
.af-appearance-scope {
  color: #9fe7d0 !important;
}
#af-theme-status:empty,
#af-theme-warnings:empty {
  display: none;
}
.af-appearance [hidden] {
  display: none !important;
}

.af-appearance.account-settings-editor {
  background: rgb(from var(--af-panel) calc(r + 1) calc(g + 4) calc(b + 6) /
    calc(alpha + 0.04));
  border-color: var(--panel-line);
  border-radius: var(--af-radius-panel);
  box-shadow: var(--af-shadow-panel);
  color: var(--paper);
  font: inherit;
  margin: 0;
  max-height: none;
  max-width: none;
  min-width: 0;
  overflow: visible;
  width: 100%;
}
.af-appearance.account-settings-editor[hidden] {
  display: none;
}

.af-appearance.account-settings-editor .af-theme-body {
  overflow: visible;
}

.af-appearance.account-settings-editor h2 {
  color: var(--gold);
  font-family: var(--af-font-heading);
  font-size: 1.125rem;
  font-weight: var(--af-font-weight-semibold);
  line-height: 1.15;
}

.af-appearance.account-settings-editor .af-theme-field,
.af-appearance.account-settings-editor .af-theme-json label {
  color: inherit;
}
