/* Atlas administration controls, 1.4 */
:root {
  color-scheme: light;
  --ink: #17263b;
  --muted: #536579;
  --line: #ccd6e2;
  --surface: #fff;
  --paper: #fff;
  --bg: #f4f6f9;
  --sidebar: #17263b;
  --hover: #edf3fe;
  --teal: #2754cb;
  --green: #008a20;
  --wash: #edf3fe;
  --form-border: #a8b6c6;
  --control-height: 36px;
  --control-gap: 8px;
  --field-gap: 16px;
  --panel-gap: 20px;
  --panel-padding: clamp(16px, 1.7vw, 24px);
  font: 15px/1.6 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
*, ::before, ::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p, dl, ul { margin-top: 0; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.35; overflow-wrap: anywhere; }
h1 { font-size: clamp(26px, 2vw, 32px); font-weight: 580; margin-bottom: 18px; letter-spacing: -.02em; }
h2 { font-size: 21px; font-weight: 600; margin-bottom: 14px; }
h3 { font-size: 17px; margin-bottom: 10px; }
p { margin-bottom: 14px; }
a { color: var(--teal); text-underline-offset: .18em; }
a:hover { color: #183ca0; }
svg { flex: none; vertical-align: middle; }
small, .muted, .empty, .section-intro { color: var(--muted); }
small, .muted, .empty { font-size: .91rem; }
code, kbd, pre { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; }
code, pre { overflow-wrap: anywhere; }
code { font-size: .9em; }
pre { white-space: pre-wrap; }
hr { border: 0; border-block-start: 1px solid var(--line); }
:where(a, summary, button, [tabindex], input, textarea, select):focus-visible {
  outline: 2px solid #2754cb; outline-offset: 2px;
}

button, input, textarea, select { font: inherit; }
button, .btn, input[type=submit] {
  display: inline-flex; justify-content: center; align-items: center;
  gap: 6px; max-inline-size: 100%; min-block-size: var(--control-height);
  padding: 5px 13px; border: 1px solid #2754cb; border-radius: 6px;
  color: #fff; background: #2754cb;
  font-size: .94rem; font-weight: 580; line-height: 1.45; text-align: center;
  text-decoration: none; overflow-wrap: anywhere; cursor: pointer; touch-action: manipulation;
}
button:hover, .btn:hover, input[type=submit]:hover {
  color: #fff; background: #183ca0; border-color: #183ca0;
}
button.secondary, .btn.secondary, input.secondary[type=submit] {
  color: #2754cb; background: #f7f9fc; border-color: #2754cb;
}
button.secondary:hover, .btn.secondary:hover, input.secondary[type=submit]:hover {
  background: #edf3fe; color: #183ca0; border-color: #183ca0;
}
button.danger, .btn.danger { color: #b32d2e; border-color: #b32d2e; background: #fff; }
button.danger:hover, .btn.danger:hover { color: #fff; background: #b32d2e; border-color: #b32d2e; }
button:disabled, input:disabled, select:disabled { opacity: .58; cursor: not-allowed; }
.plain, .icon-btn { padding: 5px; color: var(--muted); border-color: transparent; background: transparent; }
.plain:hover, .icon-btn:hover { color: var(--ink); border-color: transparent; background: var(--hover); }
.icon-btn { inline-size: var(--control-height); block-size: var(--control-height); }
.btn svg, button svg { max-inline-size: 1.25em; max-block-size: 1.25em; }
label { display: block; min-width: 0; font-size: .96rem; font-weight: 560; line-height: 1.55; }
input:where(:not([type=checkbox],[type=radio],[type=submit],[type=button],[type=color],[type=hidden],[type=range])), textarea, select {
  display: block; inline-size: 100%; min-inline-size: 0; max-inline-size: 100%; min-height: var(--control-height);
  padding: 6px 10px; color: #2c3338; background: #fff; border: 1px solid var(--form-border);
  border-radius: 6px; font-size: 1rem; font-weight: 400; line-height: 1.45;
}
select { padding-inline-end: 5px; }
textarea { min-height: 90px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #55677b; opacity: 1; }
input[readonly], textarea[readonly] { background: #f7f9fc; }
:where(input:not([type=checkbox],[type=radio]), select, textarea):focus {
  border-color: #2754cb; box-shadow: 0 0 0 1px #2754cb; outline: none;
}
input[type=checkbox], input[type=radio] {
  width: 17px; height: 17px; margin: 0 5px 0 0;
  vertical-align: -.18em; accent-color: #2754cb; cursor: pointer;
}
input[type=checkbox]:only-child { margin: 0; }
input[type=color] { width: min(180px, 100%); height: var(--control-height); padding: 3px; border: 1px solid var(--form-border); border-radius: 6px; background: #fff; }
input[type=file] { font-size: .9rem; padding: 4px; }
input[type=file]::file-selector-button { margin-inline-end: 10px; padding: 5px 10px; border: 1px solid #a8b6c6; border-radius: 6px; background: #f7f9fc; color: #2c3338; cursor: pointer; }
label > :where(input:not([type=checkbox],[type=radio],[type=hidden]),select,textarea) { margin-block-start: 5px; }
label > :where(input,select,textarea) + small { display: block; margin-top: 5px; font-weight: 400; }

.section-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 18px; }
.section-heading h1 { margin: 0; }
.section-heading p, .section-intro { color: var(--muted); }
.section-heading p { margin: 4px 0 0; }
.section-intro { margin: -8px 0 20px; }
.heading-actions, .actions, .toolbar, .tablinks { display: flex; align-items: center; flex-wrap: wrap; gap: var(--control-gap); }
.actions, .toolbar, .tablinks { margin: 14px 0; }
.toolbar:first-child, .actions:first-child { margin-block-start: 0; }
.toolbar:last-child, .actions:last-child { margin-block-end: 0; }
.toolbar:empty, .actions:empty { display: none; }
.toolbar > :where(h1,h2,h3) { margin: 0 auto 0 0; }
form.toolbar { align-items: end; }
.toolbar > :where(input:not([type=hidden],[type=checkbox],[type=radio]),select) {
  width: auto; min-width: 0; max-width: min(100%, 320px);
}
.toolbar > :where(input[type=search], input[name=q]) { flex: 1 1 190px; }
.toolbar > label { margin: 0; max-width: 100%; }
.toolbar > label:has(>select,>input:not([type=checkbox],[type=radio],[type=hidden])) { min-width: min(115px, 100%); }
.toolbar > label:has(>input[name=q]) { flex: 1 1 190px; max-width: 330px; }
.toolbar > form:not(.toolbar), .inline { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--control-gap); margin: 0; }
.toolbar > :where(button,.btn) { flex: 0 0 auto; }

.card, .panel {
  min-inline-size: 0; margin-block-end: var(--panel-gap); padding: var(--panel-padding);
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
  box-shadow: 0 1px 1px rgb(0 0 0 / 4%);
}
.card > :where(h2,h3):nth-child(1 of :not(input[type=hidden],script,style)), .panel > h2:first-of-type, .panel-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px;
  margin: calc(-1 * var(--panel-padding)) calc(-1 * var(--panel-padding)) 16px;
  padding: 12px var(--panel-padding); border-block-end: 1px solid #dbe2eb;
}
.card > :where(h2,h3):nth-child(1 of :not(input[type=hidden],script,style)), .panel > h2:first-of-type, .panel-head :where(h2,h3) { font-size: 1.06rem; font-weight: 620; }
.panel-head { justify-content: space-between; }
.panel-head :where(h2,h3) { margin: 0; }
.panel-head > a, .text-link { font-size: .92rem; }
.text-link { display: inline-flex; align-items: center; gap: 4px; }
.card > :last-child, .panel > :last-child { margin-block-end: 0; }
.form-stack { display: grid; align-items: start; gap: var(--field-gap); }
.form-stack.card > :where(h2,h3):nth-child(1 of :not(input[type=hidden],script,style)) { margin-block-end: 0; }
.form-stack > label, .card.form-stack > label { margin: 0; }
.form-stack > :where(button,.btn) { justify-self: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(225px,100%),1fr)); gap: var(--field-gap) 20px; align-items: start; }
.grid > * { min-width: 0; }
.grid > label { align-self: end; }
.card > label, .card > form:not(.toolbar,.form-stack) > label { margin: 0 0 var(--field-gap); }
.card > label:last-child { margin-block-end: 0; }
:where(.card,.card > form,.canvas > form) > :is(.grid,fieldset,details) + :is(.grid,label,fieldset,details,.table-wrap,button,.btn,p) { margin-block-start: var(--field-gap); }
.card > form + form, .card > form + p, .card > form + table { margin-block-start: var(--field-gap); }
.card :where(button,.btn) + small { display: inline-block; margin: 4px 0 4px 8px; font-weight: 400; }
.card form > small + button { margin-inline-start: 8px; }
fieldset { min-width: 0; margin: 15px 0; border: 1px solid #dbe2eb; padding: 12px 15px 16px; border-radius: 6px; }
legend { padding: 0 6px; color: #2c3338; font-size: .94rem; font-weight: 600; }
fieldset .toolbar:has(>label>input:is([type=checkbox],[type=radio])) {
  display: grid; grid-template-columns: repeat(auto-fill,minmax(min(148px,100%),1fr)); gap: 5px 12px; margin: 7px 0;
}
fieldset .toolbar > label:has(>input:is([type=checkbox],[type=radio])), .grid > label:has(>input[type=checkbox]:only-child), .check-line {
  display: flex; align-items: center; gap: 7px; min-height: 32px; font-weight: 480;
}
fieldset .toolbar label input, .check-line input { flex: none; margin: 0; }
details { min-inline-size: 0; }
summary { font-weight: 560; cursor: pointer; }
details[open] > summary { margin-bottom: 12px; }
details.card > summary { font-size: 1.03rem; }
summary::marker { color: #55677b; }
.empty { padding: 14px 0; }
.notice {
  margin-block: 12px 17px; padding: 10px 13px; color: #17263b; background: #fff;
  border: 1px solid var(--line); border-inline-start: 4px solid #2754cb; box-shadow: 0 1px 1px rgb(0 0 0 / 4%);
}
.notice.error { border-inline-start-color: #d63638; }
.notice.success { border-inline-start-color: #00a32a; }
.notice.warning { border-inline-start-color: #dba617; }
progress { accent-color: #2754cb; width: min(480px, 100%); height: 12px; }

/* Adjacent module screens use the same raised tabs as the settings screens. */
:is(.module-tabs,.content-tabs,.canvas > nav.toolbar,.canvas > h1 + div.toolbar:has(>a.btn)) {
  display: flex; align-items: stretch; flex-wrap: wrap; gap: 4px;
  margin: 0 0 20px; padding: 0 0 0 4px; border-block-end: 1px solid var(--line);
}
:is(.module-tabs,.content-tabs,.canvas > nav.toolbar,.canvas > h1 + div.toolbar:has(>a.btn)) > a.btn {
  margin-block-end: -1px; padding: 7px 13px; min-height: 36px;
  border: 1px solid var(--line); border-radius: 6px 3px 0 0;
  color: var(--ink); background: var(--bg); border-block-end-color: var(--bg);
  text-decoration: none; font-weight: 650;
}
:is(.module-tabs,.content-tabs,.canvas > nav.toolbar,.canvas > h1 + div.toolbar:has(>a.btn)) > a.secondary {
  background: #dbe2eb; color: #40464b; border-color: var(--line); font-weight: 480;
}
:is(.module-tabs,.content-tabs,.canvas > nav.toolbar,.canvas > h1 + div.toolbar:has(>a.btn)) > a.secondary:hover {
  background: #fff; color: #183ca0;
}
.table-wrap { max-inline-size: 100%; overflow-x: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; }
table {
  width: 100%; border-collapse: collapse; border: 1px solid var(--line);
  background: #fff; text-align: start; font-size: .94rem;
}
th, td { text-align: start; vertical-align: middle; padding: 10px 12px; }
th { color: #2c3338; font-weight: 570; background: #fff; white-space: nowrap; border-block-end: 1px solid var(--line); }
tfoot th { border-block-start: 1px solid var(--line); border-block-end: 0; }
td { overflow-wrap: anywhere; }
tbody tr:nth-child(odd) > td { background-color: #f7f9fc; }
tbody tr:has(input[type=checkbox]:checked) > td { background-color: #edf5fb; }
td > small { font-size: .86rem; }
td > form { margin: 0; }
td :where(button,.btn) { min-height: 29px; padding: 3px 9px; line-height: 1.5; font-size: .89rem; }
td :where(input:not([type=checkbox],[type=radio],[type=hidden]),select) { min-width: 5.5rem; }
td:has(>input[type=checkbox]:only-child), th:has(>input[type=checkbox]) { width: 38px; padding-inline-end: 3px; }
.badge, .status-pill { display: inline-block; padding: 2px 7px; border-radius: 6px; color: #3c434a; background: #f4f6f9; font-size: .82rem; line-height: 1.5; white-space: nowrap; }
.status-pill.published { color: #006b1b; background: #edfaef; }
.status-pill.draft { color: #765408; background: #fcf5df; }
.status-pill.hidden { background: #ededee; color: #536579; }
.table-empty { text-align: center; padding: 22px; color: var(--muted); }
.table-empty p { margin: 6px 0; }

/* Settings and publication tools share one field rhythm. */
.settings-links { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(230px,100%),1fr)); gap: 8px 14px; }
.setting-tile {
  display: flex; align-items: center; gap: 8px; min-height: 39px; padding: 7px 10px;
  border: 1px solid #dbe2eb; text-decoration: none; background: #f7f9fc;
}
.setting-tile:hover { border-color: #a8b6c6; background: #fff; }
.setting-tile span { flex: 1; }
.setting-tile svg { width: 16px; }
.canvas > label:has(> select) { max-width: 24rem; margin: 0 0 var(--panel-gap); }
.canvas:is([data-section=account],[data-section=settings]) form > label:has(>input:not([type=checkbox],[type=radio])) { max-width: 48rem; }
.canvas[data-section=appearance] .card details + details { margin-block-start: 14px; padding-block-start: 14px; border-block-start: 1px solid #dbe2eb; }
.canvas[data-section=content]:is([data-view=terms],[data-view=nav]) td:has(form) { min-width: 116px; }
.canvas[data-section=content]:is([data-view=terms],[data-view=nav]) td > form { display: inline-flex; align-items: center; margin-inline-start: 7px; }
.publish-policy { display: grid; align-items: start; gap: var(--panel-gap); }
.publish-policy > .card { margin: 0; }
.publish-policy .grid { align-items: start; }
.publish-policy .grid > fieldset { margin: 0; }
.publish-policy .publish-choices:not([hidden]) { grid-template-columns: repeat(auto-fill,minmax(min(118px,100%),1fr)); }

@media (min-width: 1000px) {
  .canvas:is([data-section=settings],[data-section=account]) form.form-stack > label:has(>input:not([type=checkbox],[type=radio])) {
    display: grid; grid-template-columns: minmax(145px, 13rem) minmax(0, 32rem);
    align-items: center; gap: 3px 18px; max-width: 100%;
  }
  .canvas:is([data-section=settings],[data-section=account]) form.form-stack > label > input { margin-top: 0; }
  .canvas:is([data-section=settings],[data-section=account]) form.form-stack > label > small { grid-column: 2; }
}
@media (min-width: 1280px) {
  .publish-policy { grid-template-columns: minmax(0,1.65fr) minmax(320px,1fr); }
}
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(auto-fit,minmax(min(175px,100%),1fr)); }
}
@media (max-width: 782px) {
  :root { --control-height: 42px; --panel-padding: 16px; --panel-gap: 16px; --field-gap: 14px; }
  .table-wrap table:has(tr > :nth-child(5)) { min-width: 540px; }
  .table-wrap table:has(tr > :nth-child(7)) { min-width: 650px; }
  td :where(.btn,button) { min-height: 36px; }
  input:where(:not([type=checkbox],[type=radio],[type=file])), select, textarea { font-size: max(16px,1rem); }
}
@media (max-width: 600px) {
  :root { --control-height: 44px; }
  h1 { font-size: 26px; margin-bottom: 15px; }
  h2 { font-size: 19px; }
  .grid { grid-template-columns: 1fr; }
  .section-heading { justify-content: flex-start; align-items: flex-start; }
  form.toolbar:has(>label>input[name=q]), .canvas[data-section=jobs] form.toolbar:has(>input[name=q]) {
    display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: end;
  }
  form.toolbar:has(>label>input[name=q]) > label { min-width: 0; }
  form.toolbar:has(>label>input[name=q]) > label:has(input[name=q]), .canvas[data-section=jobs] form.toolbar > input[name=q] {
    width: 100%; max-width: none; grid-column: 1/-1;
  }
  form.toolbar:has(>label>input[name=q]) > :is(.btn,button), .canvas[data-section=jobs] form.toolbar > button { justify-self: start; }
  .toolbar > :is(select[name=op],select[name=operation]) { flex: 1 1 115px; max-width: 100%; }
  .card :where(button,.btn) + small, .card form > small + button { display: block; margin: 8px 0 0; }
  fieldset { padding: 10px 12px 13px; }
  fieldset .toolbar:has(>label>input:is([type=checkbox],[type=radio])) { grid-template-columns: repeat(2,minmax(0,1fr)); }
  fieldset .toolbar label { overflow-wrap: anywhere; }
  th, td { padding: 9px; }
  :is(.module-tabs,.content-tabs,.canvas > nav.toolbar,.canvas > h1 + div.toolbar:has(>a.btn)) {
    display: flex; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-inline-start: 0;
  }
  :is(.module-tabs,.content-tabs,.canvas > nav.toolbar,.canvas > h1 + div.toolbar:has(>a.btn)) > a.btn {
    flex: 0 0 auto; min-height: 42px; margin-bottom: 0; padding: 6px 11px;
  }
}
