:root {
  --ink: #18203a;
  --ink-2: #232c4b;
  --smile: #f28c28;
  --smile-ink: #1b1205;
  --bg: #edf0f4;
  --surface: #ffffff;
  --text: #18202c;
  --muted: #5a6374;
  --line: #d5dae2;
  --field: #ffffff;
  --focus: #2f6fd6;
  --err: #b42318;
  --err-bg: #fdecea;
  --warn: #8a5300;
  --warn-bg: #fff3dc;
  --erp: #2f6fd6;
  --d2c: #e07a12;
  --ret: #1f9d6b;
  --on-ink: #f4f6fb;
  --on-ink-muted: #aeb6cc;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1320;
    --surface: #171c2b;
    --text: #e8ebf2;
    --muted: #a3abbd;
    --line: #2e3548;
    --field: #11162a;
    --focus: #7aa7f0;
    --err: #ff8e84;
    --err-bg: #3a1c1a;
    --warn: #f2c170;
    --warn-bg: #3a2c12;
    --erp: #7aa7f0;
    --d2c: #f2a24c;
    --ret: #5cc99a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1320;
  --surface: #171c2b;
  --text: #e8ebf2;
  --muted: #a3abbd;
  --line: #2e3548;
  --field: #11162a;
  --focus: #7aa7f0;
  --err: #ff8e84;
  --err-bg: #3a1c1a;
  --warn: #f2c170;
  --warn-bg: #3a2c12;
  --erp: #7aa7f0;
  --d2c: #f2a24c;
  --ret: #5cc99a;
}
:root {
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
*,
*::before,
*::after {
  box-sizing: inherit;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hanken Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
button,
input {
  font: inherit;
  color: inherit;
}
a {
  color: var(--focus);
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}

.shell {
  display: grid;
  grid-template-columns: minmax(320px, 42%) 1fr;
  min-height: 100%;
}

.brand {
  background: var(--ink);
  color: var(--on-ink);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 36px 44px;
  position: relative;
  overflow: hidden;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--on-ink);
  text-decoration: none;
}
.logo svg {
  flex: none;
}
.frame {
  position: relative;
  margin: auto 0;
  padding: 28px 0;
}
.frame::before,
.frame::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 26px;
  border: 5px solid var(--on-ink);
  opacity: 0.9;
}
.frame::before {
  left: -6px;
  border-right: 0;
}
.frame::after {
  right: -6px;
  border-left: 0;
}
.frame-inner {
  padding: 6px 44px;
}
.frame h1 {
  margin: 0;
  font-size: clamp(28px, 3.1vw, 42px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.02em;
  max-width: 15ch;
}
.smile {
  display: block;
  width: 120px;
  height: 22px;
  margin: 22px 0 0;
}
.mods {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--on-ink-muted);
  font-size: 15px;
}
.mods li {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mods i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
}
.brand-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 13px;
  color: var(--on-ink-muted);
}
.brand-foot a {
  color: var(--on-ink);
}
.env {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--ink-2);
  color: var(--on-ink);
  font-weight: 600;
}
.env::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3ccb7f;
}

.main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}
.panel {
  width: 100%;
  max-width: 440px;
}
.panel.wide {
  max-width: 620px;
}
h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.015em;
}
.sub {
  margin: 4px 0 20px;
  color: var(--muted);
}

.userbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  margin-bottom: 18px;
  font-size: 14px;
  color: var(--muted);
}
.userbar a {
  font-weight: 600;
  text-decoration: none;
}
.userbar a:hover {
  text-decoration: underline;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.field label {
  font-weight: 600;
  font-size: 14px;
}
.control {
  position: relative;
}
.control input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--field);
}
.control input:focus-visible {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent);
}
.control input[aria-invalid="true"] {
  border-color: var(--err);
}
.control.pw input {
  padding-right: 70px;
}
.reveal {
  position: absolute;
  right: 6px;
  top: 6px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--focus);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
}
.reveal:hover {
  background: color-mix(in srgb, var(--focus) 10%, transparent);
}
.ferr {
  font-size: 13px;
  color: var(--err);
}
.caps {
  font-size: 13px;
  color: var(--warn);
  background: var(--warn-bg);
  padding: 4px 10px;
  border-radius: 6px;
  align-self: flex-start;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 4px 0 22px;
  font-size: 14px;
  flex-wrap: wrap;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.check input {
  width: 17px;
  height: 17px;
  accent-color: var(--smile);
  margin: 0;
}

.alert {
  background: var(--err-bg);
  color: var(--err);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 16px;
}
.alert.ok {
  background: color-mix(in srgb, var(--ret) 14%, var(--surface));
  color: var(--ret);
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  font-weight: 700;
  font-size: 15.5px;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary {
  background: var(--smile);
  color: var(--smile-ink);
}
.btn-primary:hover {
  filter: brightness(0.96);
}
.btn-primary[disabled] {
  opacity: 0.75;
  cursor: progress;
}
.btn-quiet {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}
.btn-quiet:hover {
  border-color: var(--muted);
}
.spin {
  width: 16px;
  height: 16px;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: sp 0.7s linear infinite;
}
@keyframes sp {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .spin {
    animation-duration: 2s;
  }
}
.help {
  margin: 26px 0 0;
  font-size: 13.5px;
  color: var(--muted);
  text-align: center;
}

.proj {
  border: 0;
  margin: 0 0 18px;
  padding: 0;
}
.proj legend {
  font-weight: 600;
  font-size: 14px;
  padding: 0;
  margin-bottom: 6px;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  min-height: 64px;
  color: inherit;
  text-decoration: none;
}
.tile input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.tile .ic {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--c) 14%, transparent);
  color: var(--c);
}
.tile .nm {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
}
.tile:hover {
  border-color: var(--muted);
}
.tile:has(input:checked),
.tile.is-selected {
  border-color: var(--c);
  background: color-mix(in srgb, var(--c) 8%, var(--surface));
  box-shadow: inset 0 0 0 1px var(--c);
}
.tile:has(input:focus-visible),
.tile:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--on-ink);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 20;
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .brand {
    padding: 16px 20px;
    flex-direction: row;
    align-items: center;
  }
  .frame,
  .brand-foot .hide-sm {
    display: none;
  }
  .brand-foot {
    font-size: 12px;
  }
  .main {
    align-items: flex-start;
    padding: 28px 20px;
  }
  .tiles {
    grid-template-columns: 1fr;
  }
}
@media (max-height: 700px) and (min-width: 861px) {
  .frame h1 {
    font-size: 30px;
  }
  .mods {
    margin-top: 16px;
    gap: 6px;
  }
  .sub {
    margin-bottom: 18px;
  }
}
