/* Preserve the original palette and type system; refine task feedback and layout. */
[hidden] { display: none !important; }
.page-shell { max-width: 1280px; margin: 28px auto; padding: 28px 40px; }
.page-shell main.home { margin: 0; padding: 0; max-width: none; }
.site-header { min-height: 44px; }
.site-header .brand { text-decoration: none; }
.site-header nav { gap: 20px; }
.site-header nav a { text-decoration: none; }
.site-footer { border-top: 1px solid var(--border); padding-top: 24px; margin-top: 36px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; color: var(--small); }
.site-footer div { display: flex; flex-wrap: wrap; gap: 20px; }
.workspace { align-items: start; }
.editor-panel { animation: settle-in 240ms ease both; }
.editor-tools { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.editor-tools label { margin-bottom: 10px; }
button.quiet-action { background: var(--surface); color: var(--link); border: 1px solid var(--border); padding: 9px 12px; margin: 0; font-size: 13px; }
.editor-tools .quiet-action { margin-top: 14px; }
#submit { transition: transform 160ms ease, filter 160ms ease; }
#submit:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.04); }
#submit:active { transform: translateY(0); }
.publish-progress { padding-top: 20px; }
.publish-progress p { margin: 12px 0; font-size: 14px; }
.progress-line { display: block; height: 3px; background: var(--link); transform-origin: left; animation: waiting 1.6s ease-in-out infinite; }
.error-message { border-left: 3px solid var(--link); padding-left: 12px; }
.publication-result { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border); animation: settle-in 220ms ease both; scroll-margin-top: 24px; }
.link-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; overflow-wrap: anywhere; }
.link-row a { font-size: 15px; }
.secret-card { margin-top: 24px; border-top: 1px solid var(--border); padding-top: 8px; }
.secret-card h3 { margin-bottom: 10px; }
.secret-card p { font-size: 14px; }
.secret-card label { font-size: 14px; margin-top: 16px; }
.secret-card input { font-family: monospace; font-size: 14px; }
.button-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
#secret-warning { color: var(--small); font-size: 13px; }
#copy-prompt { width: 100%; }
.retention-note { max-width: 850px; margin: 24px 0 0; }
.document-page { margin: 36px auto; padding: 0; }
.document-page h1 { margin-top: 36px; }
.document-page nav { display: flex; gap: 20px; flex-wrap: wrap; margin: 24px 0; }
.document-page section { scroll-margin-top: 24px; }
.document-page table { width: 100%; border-collapse: collapse; font-size: 14px; }
.document-page th, .document-page td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.document-page.narrow { max-width: 650px; }
.check-label { display: flex; align-items: center; gap: 10px; font-weight: 400; }
.check-label input { width: auto; }
.skip-link { position: absolute; left: 16px; top: -80px; background: var(--surface); border: 1px solid var(--border); padding: 12px; z-index: 5; }
.skip-link:focus { top: 12px; }
@keyframes settle-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes waiting { 50% { opacity: 0.4; transform: scaleX(0.55); } }
@media (max-width: 900px) {
  .page-shell { margin: 16px auto; padding: 24px; }
}
@media (max-width: 640px) {
  .page-shell { margin: 0 auto; padding: 20px 16px 28px; }
  .site-header { flex-wrap: nowrap; gap: 10px; }
  .site-header nav { gap: 12px; flex-wrap: nowrap; font-size: 13px; }
  .site-header .developers-link { display: none; }
  .site-header .theme-toggle { min-height: 44px; min-width: 76px; }
  .home h1 { font-size: clamp(32px, 8.5vw, 48px); line-height: 1.12; letter-spacing: -1.5px; margin: 36px 0 16px; }
  .editor-tools .quiet-action { font-size: 12px; padding: 8px 10px; }
  button.quiet-action { min-height: 44px; }
  .site-footer { flex-direction: column; gap: 16px; }
  .document-page { margin: 28px auto; }
  .document-page table { font-size: 12px; }
  .document-page th, .document-page td { padding: 10px 4px; overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.page-shell main.home { height: auto; min-height: 0; display: block; overflow: visible; }
.workspace .editor-panel, .workspace #upload { display: block; overflow: visible; }
.workspace #html { height: clamp(240px, 32vh, 360px); min-height: 240px; flex: none; }
#cordium-prompt { height: 190px; min-height: 160px; }
.site-header .brand { font-size: 26px; font-weight: 700; letter-spacing: -1px; color: var(--text); gap: 1px; }
.site-header .brand > .brand-tail { display: inline-flex; align-items: baseline; gap: 0; margin: 0; color: var(--text); }
.site-header .brand-tail span { margin: 0; }
.site-header .brand img { width: 28px; height: 28px; }
@media (max-width: 640px) {
  .site-header .brand { font-size: 25px; }
  .site-header .brand img { width: 26px; height: 26px; }
}

/* Quiet controls share the existing palette and keep a comfortable touch target. */
.page-shell button {
  border-radius: 12px;
  transition: background-color 160ms ease, border-color 160ms ease,
    box-shadow 160ms ease, transform 160ms ease;
}
.page-shell button:hover:not(:disabled) {
  transform: translateY(-1px);
}
.page-shell button:active:not(:disabled) {
  transform: translateY(0);
}
.page-shell button:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 4px;
}
.site-header button.theme-toggle {
  min-height: 44px;
  min-width: 84px;
  margin: 0;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  gap: 9px;
  white-space: nowrap;
}
.site-header button.theme-toggle:hover,
.site-header button.theme-toggle:focus-visible {
  background: var(--surface);
  border-color: var(--border);
  color: var(--link);
}
.site-header .theme-icon {
  width: 16px;
  height: 16px;
}
.page-shell button.quiet-action {
  padding: 10px 14px;
  font-weight: 500;
}
.page-shell button.quiet-action:hover:not(:disabled) {
  background: var(--input);
  border-color: var(--link);
}
@media (prefers-reduced-motion: reduce) {
  .page-shell button { transition: none; }
  .page-shell button:hover:not(:disabled),
  .page-shell button:active:not(:disabled) { transform: none; }
}

.editor-tools {
  min-height: 44px;
  margin: 12px 0 8px;
}
.editor-tools label { margin: 0; }
.editor-tools button#example {
  min-height: 44px;
  margin: 0;
  padding: 10px 15px;
  border-color: transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
}
.editor-tools button#example:hover,
.editor-tools button#example:focus-visible {
  background: var(--surface);
  border-color: var(--border);
  color: var(--link);
}

.error-page { max-width: 740px; margin: 0 auto; padding: clamp(48px, 10vh, 100px) 0; text-align: center; }
.error-orbit { position: relative; display: grid; place-items: center; width: 140px; height: 140px; margin: 0 auto 32px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); }
.error-orbit::before { content: ""; position: absolute; inset: 12px; border: 1px dashed var(--border); border-radius: 50%; }
.error-orbit::after { content: ""; position: absolute; top: 20px; right: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--link); box-shadow: 0 0 0 6px var(--bg); }
.error-orbit span { font-size: 38px; letter-spacing: -2px; font-weight: 600; color: var(--link); }
.error-eyebrow { color: var(--small); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.error-page h1 { margin: 16px 0; font-size: clamp(34px, 6vw, 56px); line-height: 1.1; letter-spacing: -.045em; }
.error-description { max-width: 46ch; margin: 0 auto; color: var(--muted); font-size: 16px; line-height: 1.8; }
.error-actions { display: flex; align-items: center; justify-content: center; gap: 24px; flex-wrap: wrap; margin-top: 32px; }
.error-actions a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; font-size: 14px; text-decoration: none; }
.error-actions .error-primary { gap: 24px; background: var(--button); color: var(--button-text); border-radius: 12px; padding: 14px 20px; font-weight: 600; }
.error-actions a:focus-visible { outline: 2px solid var(--link); outline-offset: 5px; }
.error-footnote { margin-top: 48px; color: var(--small); font-size: 12px; }

.status-page { max-width: 1000px; margin: 52px auto; }
.status-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.status-heading h1 { margin: 12px 0; font-size: clamp(32px, 5vw, 48px); letter-spacing: -.04em; line-height: 1.12; }
.status-heading p { color: var(--muted); }

.public-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 28px; }
.public-stats > div { padding: 24px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.public-stats span, .public-stats small { display: block; color: var(--muted); font-size: 12px; line-height: 1.6; }
.public-stats strong { display: block; margin: 14px 0; color: var(--text); font-size: clamp(26px, 4vw, 36px); letter-spacing: -.04em; }
.health-card { padding: 28px; border: 1px solid var(--border); border-radius: 16px; }
.health-summary { display: flex; align-items: flex-start; gap: 16px; }
.health-summary h2 { margin: 0; font-size: 20px; }
.health-summary p { color: var(--muted); margin-bottom: 20px; font-size: 14px; line-height: 1.8; }
.health-dot { display: block; flex: none; width: 9px; height: 9px; margin-top: 8px; border-radius: 50%; background: var(--link); box-shadow: 0 0 0 5px var(--surface); }
.health-warning { outline: 1px dashed var(--link); outline-offset: 5px; }
.health-checks { margin: 0; }
.health-checks > div { display: flex; justify-content: space-between; gap: 20px; padding: 16px 0; border-top: 1px solid var(--border); font-size: 14px; }
.health-checks dd { margin: 0; color: var(--link); text-align: right; }
.health-time, .status-note { color: var(--small); font-size: 12px; line-height: 1.8; }
.health-time { margin-bottom: 0; }
.status-note { margin: 24px 0; }
@media (max-width: 640px) {
  .status-page { margin: 36px auto; }
  .status-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .public-stats { grid-template-columns: 1fr; gap: 12px; }
  .public-stats > div { padding: 20px; }
  .public-stats strong { margin: 8px 0; }
  .health-card { padding: 22px 20px; }
}






@media (prefers-reduced-motion: reduce) {
  
  
}

:root[data-theme="light"] {
  --bg: #f6f4ef;
  --surface: #fffefa;
  --input: #f0ede6;
  --text: #29251f;
  --muted: #665f54;
  --border: #d7d0c3;
  --link: #87500f;
  --button: #87500f;
  --button-text: #fff;
  --small: #6d6457;
}
:root[data-theme="light"] .workspace > section,
:root[data-theme="light"] .developer-sidebar > section,
:root[data-theme="light"] .public-stats > div,
:root[data-theme="light"] .health-card {
  box-shadow: 0 6px 24px rgb(65 47 19 / 4%);
}
:root[data-theme="light"] input,
:root[data-theme="light"] textarea { border-color: var(--border); }

/* Suppress mobile tap flash; focus-visible styles remain available. */
a, button, input, select, textarea, summary, [role="button"] {
  -webkit-tap-highlight-color: transparent;
}
