:root {
  --ink: #173f3b;
  --ink-strong: #0e2c29;
  --muted: #70817e;
  --paper: #f8f6ef;
  --surface: #fffefa;
  --surface-soft: #f0eee5;
  --line: #deddd5;
  --accent: #ec7357;
  --accent-dark: #d45e43;
  --mint: #d6e6df;
  --danger: #bd463c;
  --shadow: 0 18px 60px rgba(23, 63, 59, 0.12);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--paper);
}

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

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(236, 115, 87, 0.28);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink-strong);
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input,
select {
  min-height: 46px;
  padding: 0 14px;
}

textarea {
  padding: 14px;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.6;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(236, 115, 87, 0.1);
}

.muted {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: var(--ink);
  font-family: Georgia, serif;
  font-size: 25px;
  font-style: italic;
  box-shadow: 5px 5px 0 var(--mint);
}

.brand-mark.small {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 20px;
  box-shadow: 4px 4px 0 var(--mint);
}

.primary-button,
.secondary-button,
.danger-button,
.ghost-button,
.icon-button,
.text-button,
.file-button,
.row-icon-button,
.add-row-button {
  border: 0;
  cursor: pointer;
}

.primary-button,
.secondary-button,
.danger-button,
.ghost-button,
.file-button {
  min-height: 40px;
  border-radius: 10px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 750;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.primary-button {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 7px 18px rgba(236, 115, 87, 0.22);
}

.primary-button:hover:not(:disabled) {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.secondary-button,
.file-button {
  border: 1px solid var(--line);
  background: var(--surface);
}

.secondary-button:hover,
.file-button:hover {
  border-color: #b9c3bf;
  background: #fff;
}

.danger-button {
  color: #fff;
  background: var(--danger);
  box-shadow: 0 7px 18px rgba(189, 70, 60, 0.2);
}

.danger-button:hover:not(:disabled) {
  background: #a83831;
  transform: translateY(-1px);
}

.ghost-button {
  color: var(--ink);
  background: transparent;
}

.ghost-button:hover {
  background: var(--surface-soft);
}

.text-button {
  padding: 6px;
  color: var(--accent-dark);
  background: transparent;
  font-size: 12px;
  font-weight: 750;
}

.full-width {
  width: 100%;
  min-height: 48px;
}

.danger-text {
  color: var(--danger);
}

.icon-button,
.row-icon-button {
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  background: transparent;
}

.icon-button {
  width: 38px;
  height: 38px;
  font-size: 21px;
}

.icon-button:hover,
.row-icon-button:hover:not(:disabled) {
  background: var(--surface-soft);
}

.icon-button.accent {
  color: #fff;
  background: var(--accent);
}

.field-label {
  display: block;
  margin: 22px 0 8px;
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: 750;
}

.form-error {
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Login */
.login-page {
  display: grid;
  place-items: center;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 18%, rgba(214, 230, 223, 0.92) 0 14%, transparent 40%),
    radial-gradient(circle at 92% 85%, rgba(236, 115, 87, 0.12) 0 12%, transparent 37%),
    var(--paper);
}

.login-page::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(rgba(23, 63, 59, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(23, 63, 59, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  content: "";
  mask-image: linear-gradient(to bottom right, black, transparent 70%);
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  width: min(1040px, calc(100% - 48px));
  min-height: 620px;
  border: 1px solid rgba(23, 63, 59, 0.08);
  border-radius: 28px;
  overflow: hidden;
  background: rgba(255, 254, 250, 0.84);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.login-intro {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 72px;
  overflow: hidden;
  color: #fff;
  background: var(--ink);
}

.login-intro::after {
  position: absolute;
  right: -120px;
  bottom: -130px;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  box-shadow: 0 0 0 46px rgba(255,255,255,0.035), 0 0 0 92px rgba(255,255,255,0.025);
  content: "";
}

.login-intro .eyebrow {
  color: #f3a28d;
}

.login-intro h1 {
  position: relative;
  z-index: 1;
  margin: 22px 0;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: clamp(45px, 5vw, 68px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.12;
}

.login-description {
  max-width: 380px;
  margin: 0;
  color: rgba(255,255,255,0.7);
  font-size: 16px;
  line-height: 1.8;
}

.signal-row {
  display: flex;
  align-items: end;
  gap: 8px;
  height: 44px;
  margin-top: 54px;
}

.signal-row span {
  width: 5px;
  border-radius: 8px;
  background: var(--accent);
}

.signal-row span:nth-child(1) { height: 14px; }
.signal-row span:nth-child(2) { height: 31px; }
.signal-row span:nth-child(3) { height: 21px; }
.signal-row span:nth-child(4) { height: 39px; }
.signal-row span:nth-child(5) { height: 26px; }

.login-card {
  align-self: center;
  padding: 60px 64px;
}

.login-card .section-kicker {
  margin-top: 36px;
}

.login-card h2 {
  margin: 8px 0 6px;
  color: var(--ink-strong);
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 34px;
  font-weight: 550;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 64px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
}

.captcha-panel {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7f5ed;
}

.captcha-panel .field-label {
  margin-top: 0;
}

.captcha-image-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.captcha-image-row img {
  display: block;
  width: 132px;
  height: 48px;
  border: 1px solid rgba(23, 63, 59, 0.16);
  border-radius: 9px;
  background: #f7f5ed;
}

.captcha-image-row .secondary-button {
  flex: 1;
}

.login-card .primary-button {
  margin-top: 22px;
}

/* Admin */
.admin-page {
  height: 100vh;
  overflow: hidden;
}

.app-shell {
  display: flex;
  height: 100vh;
  flex-direction: column;
}

.topbar {
  z-index: 20;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 254, 250, 0.94);
  backdrop-filter: blur(12px);
}

.brand-lockup,
.topbar-actions,
.editor-actions,
.title-line,
.modal-header,
.modal-actions,
.file-row {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 13px;
}

.brand-title {
  margin: 0;
  color: var(--ink-strong);
  font-weight: 800;
}

.brand-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.topbar-actions {
  gap: 4px;
}

.save-state {
  margin-right: 14px;
  color: #548472;
  font-size: 12px;
  font-weight: 700;
}

.save-state::before {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #65a287;
  content: "";
}

.save-state.dirty {
  color: var(--accent-dark);
}

.save-state.dirty::before {
  background: var(--accent);
}

.workspace {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: 278px minmax(0, 1fr);
}

.sidebar {
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: 28px 18px 18px;
  border-right: 1px solid var(--line);
  background: #f1efe7;
}

.device-panel {
  margin: 0 8px 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(23, 63, 59, 0.12);
}

.device-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 14px;
}

.device-heading h2 {
  margin: 5px 0 0;
  color: var(--ink-strong);
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 25px;
  font-weight: 550;
}

.device-picker {
  position: relative;
}

.device-select {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink-strong);
  background: var(--surface);
  font-weight: 750;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.device-select:hover,
.device-select[aria-expanded="true"] {
  border-color: var(--accent);
}

.device-chevron {
  margin-left: 12px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  transition: transform 150ms ease;
}

.device-select[aria-expanded="true"] .device-chevron {
  transform: rotate(180deg);
}

.device-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  left: 0;
  z-index: 10;
  display: grid;
  max-height: 240px;
  gap: 3px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 16px 34px rgba(23, 63, 59, 0.16);
}

.device-option {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.device-option:hover,
.device-option:focus-visible,
.device-option[aria-selected="true"] {
  color: var(--ink-strong);
  background: var(--surface-soft);
}

.device-option[aria-selected="true"] {
  color: var(--accent-dark);
  font-weight: 800;
}

.device-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
}

.device-status {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: 0 8px 20px;
}

.sidebar-heading h2 {
  margin: 5px 0 0;
  color: var(--ink-strong);
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 25px;
  font-weight: 550;
}

.category-list {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

.category-item {
  display: grid;
  width: 100%;
  min-height: 54px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.category-item:hover {
  background: rgba(255,255,255,0.54);
}

.category-item.active {
  border-color: rgba(23, 63, 59, 0.08);
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(23, 63, 59, 0.06);
}

.category-initial {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  color: var(--ink);
  background: var(--mint);
  font-family: Georgia, serif;
  font-weight: 700;
}

.category-item.active .category-initial {
  color: #fff;
  background: var(--accent);
}

.category-label {
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-badge {
  min-width: 25px;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(23, 63, 59, 0.06);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.sidebar-footer {
  margin: 16px 8px 0;
  color: var(--muted);
  font-size: 11px;
}

.editor {
  min-width: 0;
  overflow: auto;
  padding: 42px clamp(24px, 5vw, 72px) 64px;
}

.editor-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

.editor-header h1 {
  margin: 0;
  color: var(--ink-strong);
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 550;
  letter-spacing: -0.03em;
}

.title-line {
  gap: 12px;
}

.badge {
  border-radius: 999px;
  padding: 5px 9px;
  color: #39715e;
  background: var(--mint);
  font-size: 11px;
  font-weight: 800;
}

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

.table-card {
  max-width: 1180px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 12px 40px rgba(23, 63, 59, 0.06);
}

.button-table-head,
.button-row {
  display: grid;
  grid-template-columns: 100px minmax(170px, 0.9fr) minmax(200px, 1.1fr) 82px 48px;
  align-items: center;
  gap: 14px;
}

.button-table-head {
  min-height: 46px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: #f4f2eb;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.button-row {
  min-height: 70px;
  padding: 11px 18px;
  border-bottom: 1px solid #ebe9e1;
  background: var(--surface);
  transition: opacity 120ms ease, background 120ms ease;
}

.button-row:hover {
  background: #fff;
}

.button-row.dragging {
  opacity: 0.38;
}

.button-row input {
  min-width: 0;
  background: #fbfaf6;
}

.reorder-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.drag-handle {
  padding: 6px;
  color: #97a5a1;
  cursor: grab;
  font-size: 20px;
}

.arrow-buttons {
  display: grid;
  grid-template-columns: repeat(2, 26px);
}

.row-icon-button {
  width: 28px;
  height: 28px;
  color: var(--muted);
  font-size: 14px;
}

.remove-row {
  color: var(--danger);
  font-size: 20px;
}

.is-new-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.is-new-toggle input {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.is-new-toggle:has(input:checked) {
  color: var(--accent-dark);
}

.add-row-button {
  width: 100%;
  min-height: 52px;
  color: var(--accent-dark);
  background: transparent;
  font-weight: 750;
}

.add-row-button:hover {
  background: #fdf3ef;
}

.empty-state {
  padding: 58px 24px 48px;
  text-align: center;
}

.empty-state h3 {
  margin: 17px 0 7px;
  color: var(--ink-strong);
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 22px;
  font-weight: 550;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.empty-orbit {
  display: grid;
  width: 58px;
  height: 58px;
  margin: auto;
  place-items: center;
  border: 1px dashed #9bb5aa;
  border-radius: 50%;
}

.empty-orbit span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--ink);
  font-size: 20px;
}

.loading-state {
  display: flex;
  min-height: 50vh;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--mint);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Modals and toast */
.modal {
  width: min(640px, calc(100% - 28px));
  padding: 0;
  border: 0;
  border-radius: 20px;
  color: var(--ink);
  background: transparent;
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgba(9, 35, 32, 0.52);
  backdrop-filter: blur(3px);
}

.modal-card {
  padding: 28px;
  border-radius: 20px;
  background: var(--surface);
}

.modal-card.compact {
  max-width: 480px;
  margin: auto;
}

.modal-header {
  justify-content: space-between;
  gap: 24px;
}

.modal-header h2 {
  margin: 5px 0 0;
  color: var(--ink-strong);
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 27px;
  font-weight: 550;
}

.danger-kicker {
  color: var(--danger);
}

.danger-confirmation {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  padding: 16px;
  border: 1px solid rgba(189, 70, 60, 0.18);
  border-radius: 13px;
  background: rgba(189, 70, 60, 0.06);
}

.unsaved-confirmation {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  padding: 16px;
  border: 1px solid rgba(23, 63, 59, 0.12);
  border-radius: 13px;
  background: rgba(214, 230, 223, 0.45);
}

.unsaved-confirmation p {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12px;
}

.unsaved-confirmation strong {
  color: var(--ink-strong);
  font-size: 18px;
}

.unsaved-symbol {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  font-size: 28px;
  line-height: 1;
}

.danger-confirmation p {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12px;
}

.danger-confirmation strong {
  color: var(--ink-strong);
  font-size: 18px;
}

.danger-symbol {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--danger);
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 700;
}

.clear-summary {
  margin: 18px 2px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.clear-summary strong {
  color: var(--danger);
  font-size: 18px;
}

.modal-actions {
  justify-content: flex-end;
  gap: 9px;
  margin-top: 24px;
}

.file-row {
  min-height: 46px;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.file-row input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.file-button {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.example-link {
  margin-left: auto;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.example-link:hover {
  text-decoration: underline;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 10px;
}

.toast {
  max-width: min(380px, calc(100vw - 44px));
  padding: 13px 17px;
  border-radius: 11px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 10px 30px rgba(14, 44, 41, 0.24);
  font-size: 13px;
  animation: toast-in 180ms ease-out;
}

.toast.error {
  background: var(--danger);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

.mobile-only {
  display: none;
}

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

  .editor-actions {
    justify-content: start;
  }

  .button-table-head,
  .button-row {
    grid-template-columns: 82px minmax(130px, 0.9fr) minmax(160px, 1.1fr) 70px 38px;
    gap: 9px;
  }
}

@media (max-width: 820px) {
  .admin-page {
    overflow: auto;
  }

  .app-shell {
    min-height: 100vh;
  }

  .topbar {
    position: sticky;
    top: 0;
    padding: 0 14px;
  }

  .mobile-only {
    display: inline-grid;
  }

  .brand-mark.small,
  .brand-subtitle,
  .save-state,
  .topbar-actions .ghost-button:first-of-type {
    display: none;
  }

  .workspace {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 72px;
    bottom: 0;
    left: 0;
    z-index: 30;
    width: min(310px, 86vw);
    transform: translateX(-102%);
    box-shadow: 20px 0 50px rgba(14, 44, 41, 0.2);
    transition: transform 180ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .editor {
    overflow: visible;
    padding: 28px 14px 52px;
  }

  .table-card {
    border-radius: 14px;
    overflow: visible;
  }

  .button-table-head {
    display: none;
  }

  .button-row {
    grid-template-columns: 1fr 36px;
    padding: 14px;
  }

  .button-row input {
    grid-column: 1;
  }

  .reorder-controls {
    grid-row: 1 / span 3;
    grid-column: 2;
    align-self: stretch;
    flex-direction: column;
    justify-content: center;
  }

  .drag-handle {
    display: none;
  }

  .arrow-buttons {
    grid-template-columns: 28px;
  }

  .remove-row {
    position: absolute;
    right: 8px;
    margin-top: -10px;
  }

  .button-row {
    position: relative;
  }

  .is-new-toggle {
    grid-column: 1;
    justify-self: start;
  }
}

@media (max-width: 720px) {
  .login-shell {
    display: block;
    width: min(470px, calc(100% - 28px));
    min-height: 0;
    margin: 24px 0;
  }

  .login-intro {
    min-height: 270px;
    padding: 38px;
  }

  .login-intro h1 {
    margin: 14px 0;
    font-size: 40px;
  }

  .login-description {
    font-size: 14px;
  }

  .signal-row {
    display: none;
  }

  .login-card {
    padding: 38px;
  }

  .login-card .brand-mark {
    display: none;
  }

  .login-card .section-kicker {
    margin-top: 0;
  }

  .editor-header h1 {
    font-size: 32px;
  }

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

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

@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;
  }
}
