* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body { display: flex; flex-direction: column; height: 100dvh; }
.craft-bar { flex: 0 0 auto; background: var(--cloud-white); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.craft-bar nav { display: flex; align-items: center; gap: 16px; height: 44px; padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
.craft-bar a { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px; border-radius: 8px; color: var(--ink); font-size: 12px; text-decoration: none; white-space: nowrap; }
.craft-bar a:hover { background: var(--selection); }
.home-link { font-weight: 600; }
.home-link .subnet-wordmark { font-size: 15px; }
.home-link img { display: block; width: 30px; height: auto; }
.craft-bar .icon { width: 16px; height: 16px; color: var(--action); }
.divider { width: 1px; height: 16px; background: var(--line); }
.craft-bar h1 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 500; color: var(--muted); }
.files-link { margin-left: auto; }
.craft-bar .app-version { min-height: 26px; padding: 3px 8px; font-size: 11px; color: var(--muted); background: transparent; border-color: transparent; white-space: nowrap; }
.craft-bar .app-version:hover { background: var(--selection); color: var(--action); }
.craft-bar .app-version.has-update { color: var(--action); background: var(--selection); }
.release-versions { display: flex; gap: 24px; margin: 22px 0 16px; }
.release-versions > div { flex: 1; min-width: 0; }
.release-versions p, .release-details { font-size: 12px; color: var(--muted); line-height: 1.6; }
.release-versions p { margin: 0 0 6px; }
.release-versions strong { font-size: 20px; font-weight: 500; }
.release-versions small { display: block; margin-top: 5px; font-size: 11px; color: var(--muted); }
#update-dialog h3 { margin: 24px 0 10px; font-size: 14px; font-weight: 600; }
#update-dialog .dialog-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 36px; min-height: 36px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 24px; line-height: 1; }
#update-dialog .dialog-close:hover { background: var(--selection); color: var(--ink); }
#update-actions[hidden] { display: none; }
#release-notes { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
#release-notes p { margin: 0 0 10px; }
#release-source { display: inline-block; margin-top: 8px; font-size: 13px; }
#release-source[hidden] { display: none; }
.update-status { color: var(--action); font-size: 13px; line-height: 1.6; }
.update-status:empty { display: none; }
#update-progress { width: 100%; height: 5px; accent-color: var(--action); }
button:disabled { cursor: default; opacity: .55; }
.editor-area { flex: 1 1 auto; min-height: 0; position: relative; background: #202122; }
#craft-editor { display: block; border: 0; width: 100%; height: 100%; }
.craft-loading { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; overflow: auto; padding: 32px 24px; background: radial-gradient(ellipse at 65% 15%, #CFE0F555, transparent 60%), var(--cloud-white); }
.loading-card { width: min(100%, 420px); margin: auto; text-align: center; }
.loading-mark { display: block; width: 80px; height: auto; margin: 0 auto 28px; }
.loading-eyebrow { margin: 0 0 12px; font-size: 10px; font-weight: 500; line-height: 1.6; letter-spacing: .14em; color: var(--action); }
.loading-card h2 { margin: 0; font: 600 clamp(23px, 4vw, 30px)/1.3 var(--font-heading); letter-spacing: -.7px; }
.loading-description { margin: 16px 0 28px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.loading-progress { height: 5px; overflow: hidden; border-radius: 10px; background: var(--mist-gray); }
.loading-progress span { display: block; height: 100%; width: 40%; border-radius: inherit; background: linear-gradient(90deg, var(--sky-blue), var(--estonian-blue)); animation: loading-travel 1.8s ease-in-out infinite; }
.loading-progress[data-determinate] span { width: var(--loading-percent, 0%); animation: none; transform: none; background: var(--estonian-blue); opacity: 1; }
.loading-details { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 12px 0 24px; }
.loading-status, .loading-amount { margin: 0; color: var(--action); font-size: 12px; line-height: 1.6; }
.loading-amount { color: var(--muted); font-variant-numeric: tabular-nums; }
.loading-explanation { margin: 0 auto; max-width: 360px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.loading-help { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.loading-help p { margin: 0 0 14px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.craft-loading[data-state="error"] .loading-status { color: var(--error-text); }
@keyframes loading-travel { from { transform: translateX(-110%); } to { transform: translateX(360%); } }
@media(prefers-reduced-motion:reduce) { .loading-progress span { animation: none; width: 100%; opacity: .55; } }
noscript { position: absolute; inset: 0; z-index: 2; padding: 24px; background: var(--paper); }
noscript a { color: var(--action); }
dialog { width: min(440px, calc(100vw - 32px)); padding: 32px; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); color: var(--ink); box-shadow: 0 24px 80px #0F274724; }
dialog::backdrop { background: #0F274766; }
.dialog-eyebrow { margin: 0 0 12px; color: var(--action); font-size: 12px; font-weight: 500; }
dialog h2 { margin: 0 0 16px; font-family: var(--font-heading); font-size: 22px; line-height: 1.4; font-weight: 600; letter-spacing: -.5px; }
#leave-description { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; margin-top: 24px; }
button { min-height: 42px; padding: 10px 14px; border: 1px solid var(--action); border-radius: var(--radius-small); background: var(--action); color: var(--surface); font: 500 14px var(--font-ui); cursor: pointer; }
button:hover { background: var(--action-hover); }
.leave-button { background: var(--surface); color: var(--ink); border-color: var(--line); }
.leave-button:hover { background: var(--surface-secondary); }
@media(max-width:480px) {
  .craft-bar nav { gap: 8px; padding-left: max(6px, env(safe-area-inset-left)); padding-right: max(6px, env(safe-area-inset-right)); }
  .craft-bar a { padding: 0 5px; }
  .home-link .subnet-wordmark { display: none; }
  dialog { padding: 24px; }
}
