:root {
  --bg: #ececec;
  --panel: #ffffff;
  --line: #111111;
  --soft-line: #d7d7d7;
  --text: #111111;
  --muted: #4a4a4a;
  --danger: #b00020;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Mono", "DejaVu Sans Mono", monospace;
  min-height: 100vh;
}
.wrap {
  max-width: 1150px;
  margin: 0 auto;
  padding: 16px;
}
.center-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}
.card {
  width: min(560px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
}
h1 { margin: 0 0 12px; font-size: 1.3rem; }
p { margin: 0 0 16px; color: #222; }
.bar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.path {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 230px;
  flex: 1;
  color: #111;
}
input, select, button, .download-link, .link-btn {
  border: 1px solid #111;
  border-radius: 8px;
  background: #fff;
  color: #111;
  padding: 8px 11px;
  font: inherit;
}
button, .download-link, .link-btn {
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.stack input, .stack select, .stack textarea {
  width: 100%;
}
.primary { background: #111; color: #fff; }
.danger { background: #111; color: #fff; }
.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.layout {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 12px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  min-height: 50vh;
  display: flex;
  flex-direction: column;
}
.panel h2 {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
  background: #f7f7f7;
}
.scroll { overflow: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th, td {
  padding: 8px 10px;
  border-bottom: 1px dashed var(--soft-line);
  text-align: left;
  vertical-align: top;
}
.name-btn {
  border: 0;
  background: transparent;
  color: #111;
  text-decoration: underline;
  font: inherit;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.small { color: var(--muted); font-size: 0.86rem; }
.muted { color: var(--muted); }
.error { color: var(--danger); font-weight: 700; }
.meta {
  margin-top: 8px;
  background: #fff;
  border: 1px solid #111;
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 0.9rem;
}
.meta-actions {
  display: inline-flex;
  gap: 6px;
  margin-left: auto;
  flex-wrap: wrap;
}
.dropzone {
  margin-top: 8px;
  border: 1px dashed #111;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  font-size: 0.9rem;
}
.dropzone.active {
  background: #f5f5f5;
  border-style: solid;
}
pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.9rem;
  line-height: 1.35;
  background: #fafafa;
  border: 1px solid #111;
  border-radius: 8px;
  padding: 10px;
  max-height: 62vh;
  overflow: auto;
}
img, video {
  max-width: 100%;
  max-height: 62vh;
  border-radius: 8px;
  border: 1px solid #111;
  background: #fff;
}
.stack { display: grid; gap: 10px; }
.pill {
  border: 1px solid #111;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.8rem;
  display: inline-block;
}
.lock {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.shell {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 22px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0 18px;
}
.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.brand h1 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.1;
}
.brand span {
  color: var(--muted);
  font-size: 0.92rem;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.button {
  min-height: 38px;
  font-weight: 600;
}
.button.ghost {
  background: transparent;
}
.site-mark {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 22px 0 0;
  padding: 0;
}
.site-mark a {
  display: inline-block;
  line-height: 0;
}
.site-mark img {
  width: min(220px, 58vw);
  height: auto;
  display: block;
  max-height: none;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.site-mark span {
  color: var(--text);
  font-size: 0.95rem;
}
.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.85fr);
  gap: 18px;
  align-items: start;
}
.surface {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.surface-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #f7f7f7;
}
.surface-head h2 {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 0.98rem;
}
.count {
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
}
.file-list {
  display: grid;
}
.file-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 120px 140px 180px;
  gap: 14px;
  align-items: center;
  padding: 13px 16px;
  border-bottom: 1px dashed var(--soft-line);
}
.file-row:last-child {
  border-bottom: 0;
}
.file-row:hover {
  background: #fafafa;
}
.file-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}
.file-icon {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}
.file-icon img {
  width: 34px;
  height: 34px;
  display: block;
}
.file-name {
  overflow-wrap: anywhere;
  line-height: 1.3;
  font-weight: 650;
}
.file-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.84rem;
}
.lock-pill {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  background: #fafafa;
  font-size: 0.78rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.pin-input {
  width: 100%;
  min-width: 0;
  padding: 8px 9px;
}
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.actions .button {
  justify-content: center;
  padding: 8px;
  min-width: 0;
}
.empty,
.status-line {
  padding: 24px 16px;
  color: var(--muted);
}
.preview-body {
  min-height: 360px;
  max-height: 690px;
  overflow: auto;
  padding: 16px;
}
.preview-placeholder {
  display: grid;
  place-items: center;
  min-height: 330px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--soft-line);
  border-radius: 8px;
  background: #fafafa;
}
.preview-title {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}
.preview-body pre {
  max-height: none;
}
.preview-body img,
.preview-body video,
.preview-body iframe {
  display: block;
  width: 100%;
  max-height: 610px;
}
.preview-body iframe {
  height: 610px;
}
.upload-panel {
  margin-top: 18px;
}
.upload-form {
  padding: 16px;
  display: grid;
  gap: 14px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}
.field label,
.option-label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
}
.field input {
  min-width: 0;
}
.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
}
.option-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.option-label input,
.auto-width {
  width: auto;
}
.progress {
  width: 100%;
  height: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}
.progress-bar {
  width: var(--progress, 0%);
  height: 100%;
  background: #111;
  transition: width 160ms ease;
}
.notice {
  display: none;
  padding: 10px 12px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #fafafa;
  color: var(--muted);
  font-size: 0.9rem;
}
.notice.active {
  display: block;
}
.notice.error {
  border-color: #b00020;
  background: #fff7f8;
  color: #9b1c31;
}
.request-dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #111;
}
.request-dialog::backdrop,
dialog::backdrop {
  background: rgba(0, 0, 0, 0.3);
}
.request-dialog .upload-panel {
  margin-top: 0;
  border: 0;
}
.dialog-close {
  min-height: 34px;
  padding: 6px 9px;
}
.dashboard {
  padding-top: 28px;
}
.dashboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.dashboard-head h1 {
  margin-bottom: 0;
}
.kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.86rem;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.dashboard-tile {
  min-height: 170px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
}
.dashboard-tile:hover {
  background: #f7f7f7;
}
.dashboard-tile strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.05rem;
}
.dashboard-tile small {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}
.tile-mark {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111;
  color: #fff;
  font-weight: 700;
}
.about-shell {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 28px 18px;
  min-height: 100vh;
  display: grid;
  align-content: center;
}
.about-mark {
  display: inline-grid;
  gap: 10px;
  justify-items: start;
  margin-bottom: 24px;
}
.about-mark img,
.missing-logo {
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  max-height: none;
}
.about-mark img {
  width: 112px;
}
.about-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}
.about-title {
  margin: 0 0 14px;
  font-size: clamp(2rem, 7vw, 4rem);
  line-height: 0.95;
}
.social-links {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0 0 20px;
}
.social-links a {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.social-links img {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.about-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--soft-line);
}
.about-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  font-size: 0.95rem;
}
.about-label {
  color: var(--muted);
  font-weight: 700;
}
.about-value {
  color: var(--text);
}
.missing-shell {
  min-height: 100vh;
  width: min(640px, 100%);
  margin: 0 auto;
  padding: 24px 18px;
  display: grid;
  place-items: center;
}
.missing-card {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
}
.missing-logo {
  width: 118px;
  display: block;
  margin: 0 0 22px;
}
.missing-title {
  margin: 0 0 10px;
  font-size: clamp(1.7rem, 6vw, 2.6rem);
  line-height: 1.05;
}
.missing-card p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}
.home-link {
  min-height: 38px;
  border: 1px solid #151515;
  border-radius: 6px;
  background: #151515;
  color: #fff;
  padding: 8px 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  font-weight: 700;
}
.maintenance-card {
  text-align: center;
}
.maintenance-logo {
  width: 72px;
  height: 72px;
  border: 1px solid #111;
  border-radius: 8px;
  margin-bottom: 16px;
}
.maintenance-card h1 {
  font-size: 1.5rem;
}
.maintenance-card p {
  margin-bottom: 0;
  line-height: 1.5;
}
.centered-image {
  display: block;
  margin: 0 auto;
}
.otp-input {
  text-align: center;
  letter-spacing: 0.2em;
}
.admin-shell {
  min-height: 100vh;
  max-width: none;
  padding: 12px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
}
.admin-shell .panel {
  min-height: 0;
}
.admin-shell .scroll {
  min-height: 0;
  flex: 1;
}
.admin-tabs,
.admin-actions,
.compact-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.align-right {
  margin-left: auto;
}
.admin-tabs button.active,
.config-list button.active {
  background: #111;
  color: #fff;
}
.admin-page {
  min-height: 0;
  display: none;
}
.admin-page.active {
  display: grid;
  gap: 12px;
}
.admin-main,
.min-h-0 {
  min-height: 0;
}
.work-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 12px;
}
.work-grid.single {
  grid-template-columns: 1fr;
}
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-content: start;
}
.settings-wide {
  min-height: min(560px, calc(100vh - 220px));
}
.panel-body {
  padding: 12px;
  min-height: 0;
  overflow: auto;
  flex: 1;
}
.compact-actions button {
  padding: 6px 8px;
}
.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.stat {
  background: #fff;
  border: 1px solid #111;
  border-radius: 8px;
  padding: 10px 12px;
}
.stat strong {
  display: block;
  font-size: 1.15rem;
  margin-top: 4px;
}
.preview-box {
  min-height: 0;
  overflow: auto;
  padding: 12px;
  flex: 1;
}
dialog {
  width: min(980px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  border: 1px solid #111;
  border-radius: 8px;
  padding: 0;
  background: #fff;
  color: #111;
}
.dialog-head {
  padding: 10px 12px;
  border-bottom: 1px solid #111;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.dialog-body {
  padding: 12px;
  max-height: calc(100vh - 105px);
  overflow: auto;
}
.config-editor {
  display: grid;
  grid-template-columns: minmax(180px, 0.32fr) minmax(0, 1fr);
  gap: 12px;
  min-height: 360px;
}
.config-list {
  display: grid;
  align-content: start;
  gap: 6px;
}
.config-list button {
  justify-content: flex-start;
  width: 100%;
}
.text-config-editor {
  min-height: 300px;
  resize: vertical;
  font-family: inherit;
}
.notice-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.28fr) auto minmax(180px, 1fr);
  gap: 8px;
  align-items: center;
}
.short-number {
  width: 120px;
}
.uses-input {
  max-width: 110px;
}
.timer-fields {
  max-width: 260px;
}
.full-width-media {
  width: 100%;
}
.pdf-frame {
  width: 100%;
  height: 62vh;
}
.hidden {
  display: none !important;
}
.palette-page main {
  width: min(1500px, calc(100% - 24px));
  margin: 0 auto;
  padding: 16px 0;
}
.palette-page header {
  margin-bottom: 12px;
}
.palette-page h1 {
  margin: 0;
  max-width: 760px;
  font-size: 1.15rem;
  line-height: 1.15;
}
.tagline {
  margin: 8px 0 0;
  max-width: 620px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}
.workspace {
  display: grid;
  gap: 12px;
  align-items: start;
}
.controls,
.preview-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
}
.controls {
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
}
.control-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--soft-line);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fcfcfc 100%);
}
.control-card h2 {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.control-card-wide {
  grid-column: 1 / -1;
}
.control-card .control-block {
  padding-top: 14px;
  padding-left: 0;
  border-top: 1px solid var(--soft-line);
  border-left: 0;
}
.control-card .control-block:first-of-type {
  padding-top: 0;
  border-top: 0;
}
.palette-page .dropzone {
  display: grid;
  min-height: 128px;
  place-items: center;
  padding: 14px;
  border: 1px dashed var(--line);
  background: #fff;
  text-align: center;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}
.palette-page .dropzone:hover,
.palette-page .dropzone.dragging {
  background: #f5f5f5;
  transform: translateY(-1px);
}
.palette-page .dropzone strong {
  display: block;
  margin-bottom: 5px;
  font-size: 0.95rem;
}
.palette-page .dropzone span {
  color: var(--muted);
  line-height: 1.3;
  font-size: 0.82rem;
}
.palette-page input[type="file"] {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.control-block {
  min-width: 0;
  padding-left: 10px;
  border-left: 1px solid var(--soft-line);
}
.palette-page label,
.label-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-weight: 800;
}
.value {
  min-width: 3ch;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
}
.palette-page input[type="range"] {
  width: 100%;
  margin: 10px 0 2px;
  accent-color: #111;
}
.palette-page select {
  width: 100%;
  min-height: 36px;
  margin-top: 8px;
  padding-block: 6px;
}
.palette-page .control-block select,
.palette-page .control-block textarea {
  margin-top: 8px;
}
.color-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.color-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.color-field {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #fff;
  font-size: 0.8rem;
}
.color-launcher {
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.color-field span {
  font-weight: 800;
}
.color-preview {
  width: 100%;
  height: 28px;
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}
.color-code {
  color: var(--muted);
  font-family: "IBM Plex Mono", "DejaVu Sans Mono", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  font-weight: 600;
}
.palette-page input[type="color"] {
  width: 100%;
  height: 34px;
  padding: 2px;
  cursor: pointer;
}
.palette-page textarea {
  min-height: 72px;
  margin-top: 8px;
  resize: vertical;
  font-size: 0.82rem;
}
.custom-picker-row {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.custom-picker-button {
  min-height: 36px;
}
.custom-picker-row button {
  min-height: 36px;
  justify-content: center;
}
.color-picker-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.65fr);
  gap: 10px;
  align-items: start;
}
.picker-wheel-wrap {
  position: relative;
  width: min(100%, 250px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
}
.picker-wheel-wrap canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid var(--soft-line);
  display: block;
}
.picker-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}
.picker-side {
  display: grid;
  gap: 8px;
}
.picker-hex {
  padding: 8px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #fff;
  font-family: "IBM Plex Mono", "DejaVu Sans Mono", monospace;
  font-size: 0.82rem;
}
.picker-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.scale-panel {
  display: grid;
  gap: 8px;
  padding-top: 8px;
}
.wide-toggle {
  width: 100%;
  margin-top: 8px;
}
[hidden] {
  display: none !important;
}
.hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}
.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
}
.toggle input {
  width: 22px;
  height: 22px;
  accent-color: #111;
  flex: 0 0 auto;
}
.buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.palette-page .buttons button,
.palette-page .buttons .download {
  width: 100%;
  min-height: clamp(34px, 2vw, 42px);
  justify-content: center;
  padding-inline: clamp(10px, 0.8vw, 14px);
  font-size: clamp(0.86rem, 0.62vw, 0.95rem);
}
.download {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  font: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  cursor: pointer;
}
.download[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}
.preview-panel {
  overflow: hidden;
}
.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: #f7f7f7;
}
.preview-toolbar strong {
  white-space: nowrap;
}
.file-info {
  color: var(--muted);
  font-size: 0.8rem;
  text-align: right;
  overflow-wrap: anywhere;
}
.canvases {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 0;
}
.canvas-wrap {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  background:
    linear-gradient(45deg, #ddd 25%, transparent 25%),
    linear-gradient(-45deg, #ddd 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ddd 75%),
    linear-gradient(-45deg, transparent 75%, #ddd 75%),
    #fff;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}
.canvas-wrap + .canvas-wrap {
  border-left: 1px solid var(--line);
  border-top: 0;
}
.canvas-label {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}
.canvas-stage {
  display: grid;
  place-items: center;
  min-height: 240px;
  padding: 10px;
}
.palette-page canvas {
  display: block;
  max-width: 100%;
  max-height: 32vh;
  height: auto;
  image-rendering: pixelated;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.16);
}
.palette-empty {
  max-width: 360px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: center;
  color: var(--muted);
  line-height: 1.5;
}
.palette-spaced {
  margin-top: 14px;
}
img.borderless,
img[src$="/neh.svg"],
img[src$="/working.svg"],
img[src$="/404-error.svg"],
img[src$="/default.svg"] {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}
.work-notice {
  position: fixed !important;
  top: 14px !important;
  right: 14px !important;
  z-index: 1000 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  max-width: min(320px, calc(100vw - 28px)) !important;
  padding: 8px 10px !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  background: var(--panel) !important;
  color: var(--text) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08) !important;
  font-size: 0.88rem !important;
  line-height: 1.25 !important;
}
.work-notice img {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
  flex: 0 0 28px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  object-fit: contain !important;
}
.work-notice span {
  overflow-wrap: anywhere !important;
}
@media (max-width: 980px) {
  .layout,
  .grid-2,
  .settings-grid,
  .status-strip,
  .notice-row,
  .config-editor { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .settings-wide { min-height: 0; }
  .panel { min-height: 40vh; }
  .workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1050px) {
  .page-grid,
  .work-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 14px;
  }
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .toolbar {
    width: 100%;
  }
  .toolbar .button {
    flex: 1 1 auto;
    justify-content: center;
  }
  .file-row {
    grid-template-columns: 1fr;
    gap: 9px;
  }
  .actions {
    grid-template-columns: 1fr 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .dashboard-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .dashboard-head form,
  .dashboard-head button {
    width: 100%;
  }
  .dashboard-head button {
    justify-content: center;
  }
  .about-shell {
    align-content: start;
  }
  .about-panel,
  .missing-card {
    padding: 22px;
  }
  .about-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

@media (max-width: 560px) {
  .palette-page main {
    width: min(100% - 16px, 1160px);
    padding: 12px 0;
  }
  .controls,
  .buttons {
    grid-template-columns: 1fr;
  }
  .color-grid-3,
  .custom-picker-row {
    grid-template-columns: 1fr;
  }
  .color-picker-panel {
    grid-template-columns: 1fr;
  }
  .picker-actions {
    grid-template-columns: 1fr;
  }
  .preview-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .file-info {
    text-align: left;
  }
}

@media (min-width: 1110px) {
  .workspace {
    grid-template-columns: minmax(380px, 0.95fr) minmax(0, 1.05fr);
  }

  .palette-page main {
    width: min(1600px, calc(100% - 20px));
    padding: 12px 0;
  }

  .palette-page .buttons button,
  .palette-page .buttons .download {
    min-height: clamp(34px, 1.8vw, 42px);
  }
}

@media (max-width: 980px) {
  .canvases {
    grid-template-columns: 1fr 1fr;
    min-height: 0;
  }
  .canvas-wrap + .canvas-wrap {
    border-top: 0;
    border-left: 1px solid var(--line);
  }
}
