:root {
  color-scheme: light;
  font: 16px/1.55 system-ui, sans-serif;
  color: #16302b;
  background: #edf5f0;
  --surface: #fff;
  --field: #f7faf8;
  --line: #b8ccc3;
  --accent: #205b43;
  --mint: #c4efd4;
  --muted: #47615a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 16px max(20px, calc((100vw - 1220px) / 2));
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 1.2rem; white-space: nowrap; }
.brand span, .eyebrow { color: var(--accent); }
.brand small, .badge {
  font-size: .72rem; letter-spacing: .08em; color: var(--accent);
  border: 1px solid var(--line); border-radius: 20px; padding: 4px 9px;
}
#identity { display: flex; align-items: center; gap: 10px; overflow-wrap: anywhere; }
main { max-width: 1260px; margin: auto; padding: 24px 20px 60px; }
h1, h2, h3, p { margin: 0 0 .65rem; }
h1 { font-size: clamp(2.3rem, 5vw, 3.8rem); line-height: 1.05; letter-spacing: -.055em; }
h2 { font-size: 1.35rem; line-height: 1.2; }
h3 { font-size: 1.05rem; }
.eyebrow { letter-spacing: .16em; font-size: .76rem; font-weight: 800; }
.muted { color: var(--muted); }
.intro { padding: 16px 0 10px; }
.panel { background: var(--surface); padding: 22px; border: 1px solid var(--line); border-radius: 16px; }
.auth { max-width: 475px; margin: 7vh auto; padding: clamp(22px, 5vw, 42px); }
.auth .buttons { margin: 24px 0 12px; }
.auth-guide-link { margin-top: 16px; }
.owner-guide { max-width: 780px; margin: 30px auto; scroll-margin-top: 16px; }
.owner-guide ol { padding-left: 22px; }
.owner-guide li + li { margin-top: 6px; }
.owner-guide a, .auth-guide-link a { color: var(--accent); }
.dashboard { display: grid; grid-template-columns: 250px minmax(0, 1fr); align-items: start; gap: 18px; }
.content { display: grid; gap: 18px; min-width: 0; }
.projects form, .inline-form { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.project-pick { display: block; width: 100%; text-align: left; margin: 6px 0; overflow-wrap: anywhere; }
.project-pick small { display: block; color: var(--muted); }
.project-pick[aria-current="true"] { border-color: var(--accent); background: #e8f6ed; }
form, .result { display: grid; gap: 10px; }
button, input, textarea, select { font: inherit; }
label { display: grid; gap: 4px; color: var(--muted); font-size: .87rem; min-width: 0; }
.check-label { display: flex; align-items: center; gap: 8px; }
.check-label input { width: auto; margin: 0; accent-color: var(--accent); }
input, textarea, select {
  display: block; width: 100%; min-width: 0; color: #16302b; background: var(--field);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
}
input[type=file] { font-size: .8rem; }
input[type=color] { min-height: 40px; padding: 4px; }
textarea { resize: vertical; }
button {
  justify-self: start; padding: 7px 12px; border: 1px solid transparent; border-radius: 8px;
  color: #10251b; background: var(--mint); cursor: pointer; font-weight: 700;
}
button.secondary { background: var(--field); border-color: var(--line); color: #16302b; }
button:hover:not(:disabled) { filter: brightness(.95); }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid #997221; outline-offset: 2px; }
.buttons, .toolbar, .section-heading, .inline-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.section-heading { justify-content: space-between; margin-bottom: 10px; }
.section-heading h2, .section-heading h3 { margin: 0; }
.toolbar, .inline-form { align-items: end; }
.toolbar label, .inline-form label { flex: 1 1 190px; }
.toolbar { margin: 12px 0; }
.message { color: var(--accent); overflow-wrap: anywhere; }
.message:empty, .result:empty { display: none; }
.error { color: #9e2922; }
input[aria-invalid="true"] { border-color: #9e2922; }
.preview-empty, #preview-stage {
  background: var(--field); border: 1px dashed var(--line); border-radius: 10px;
  margin-bottom: 14px;
}
.preview-empty { display: grid; place-items: center; min-height: 130px; color: var(--muted); padding: 20px; }
#preview-stage { position: relative; width: fit-content; max-width: 100%; }
#preview { display: block; max-width: 100%; max-height: 450px; border-radius: 9px; }
#anchor {
  position: absolute; transform: translate(-50%, -50%); border: 2px solid #152121;
  width: 21px; height: 21px; border-radius: 50%; padding: 0; cursor: grab; touch-action: none;
  box-shadow: 0 0 0 1px var(--mint);
}
#anchor:active { cursor: grabbing; }
.hint { font-size: .85rem; }
.layer { margin-bottom: 10px; border: 1px solid var(--line); border-radius: 9px; padding: 12px; }
.layer.selected { border-color: var(--accent); }
.layer-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); margin-top: 8px; }
.layer-font { grid-column: span 2; display: grid; align-content: start; gap: 6px; }
.editor-actions { margin-top: 16px; }
#project-design { min-width: 0; margin: 0; border: 0; padding: 0; }
.result { margin-top: 12px; overflow-wrap: anywhere; }
.result a, .banner-list a { color: var(--accent); }
.result img { max-width: 100%; max-height: 230px; object-fit: contain; justify-self: start; border-radius: 8px; }
.project-code-input { max-width: 310px; }
#profile-link-pattern { overflow-wrap: anywhere; white-space: pre-line; margin-top: 6px; }
.listing-tools { margin: 8px 0; }
#listing-code-dialog { width: min(720px, calc(100% - 24px)); color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
#listing-code-dialog::backdrop { background: #10251bac; }
#listing-code { font: .86rem/1.5 ui-monospace, monospace; }
#listing-code-context { margin-top: 8px; }
.icon-button { display: inline-grid; place-items: center; padding: 7px; }
.icon-button svg { width: 19px; height: 19px; }
#previous-profile-link-list { margin: 4px 0 12px; padding-left: 22px; overflow-wrap: anywhere; }
#previous-profile-link-list a { color: var(--accent); }
.banner-overview { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; }
.banner-search { max-width: 310px; margin-bottom: 10px; }
.banner-list { list-style: none; padding: 0; margin: 0; }
.banner-list li { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); }
.banner-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.banner-row-actions button { color: #9e2922; }
.home-link { color: inherit; text-decoration: none; }
.not-found { max-width: 630px; margin: 7vh auto; padding: clamp(22px, 5vw, 42px); }
.not-found-invite { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 20px; }
.action-link { display: inline-block; padding: 8px 14px; border-radius: 8px; background: var(--mint); color: #10251b; font-weight: 700; text-decoration: none; }
#admin { margin-bottom: 18px; }
.admin-staker-settings { margin-bottom: 14px; }
#admin-accounts { margin-bottom: 14px; }
#admin-accounts .pending-activation { background: #fff0cf; color: #644300; }
.table-scroll { overflow-x: auto; }
.admin-table { border-collapse: collapse; width: 100%; }
.admin-table td, .admin-table th { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); }
.admin-links { min-width: 170px; display: grid; gap: 4px; }
.admin-links div { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 10px; }
.admin-links button { padding: 3px 6px; font-size: .82rem; color: #9e2922; }
@media (max-width: 720px) {
  .dashboard { grid-template-columns: 1fr; }
  .panel { padding: 16px; }
  .topbar { align-items: start; }
  #identity { flex-wrap: wrap; justify-content: end; }
}
