:root {
  color-scheme: dark;
  --bg: #07101d;
  --bg-deep: #050b14;
  --panel: rgba(14, 27, 44, 0.76);
  --panel-solid: #101d2e;
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #f5f8fc;
  --muted: #91a0b4;
  --soft: #c5cfdb;
  --lime: #b7f36b;
  --danger: #ff6c75;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.32);
  font-family: Inter, Pretendard, "Noto Sans KR", "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(6, 13, 24, 0.4), rgba(5, 11, 20, 0.92)),
    radial-gradient(circle at 50% 0%, #12243a 0, var(--bg) 42%, var(--bg-deep) 100%);
  color: var(--text);
  min-height: 100vh;
}

button,
input,
a {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  left: 1rem;
  top: -4rem;
  padding: 0.75rem 1rem;
  border-radius: 0.7rem;
  background: var(--text);
  color: var(--bg);
  transition: top 160ms ease;
}

.skip-link:focus {
  top: 1rem;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 44rem;
  height: 44rem;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.12;
  pointer-events: none;
}

.ambient-one {
  top: -20rem;
  right: -15rem;
  background: #4f9dff;
}

.ambient-two {
  top: 45rem;
  left: -25rem;
  background: #7df0bb;
}

.site-header,
main,
footer {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.24em;
}

.brand-mark {
  width: 1.95rem;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  transform: rotate(45deg);
}

.brand-mark i {
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 2px;
}

.brand-mark i:first-child {
  background: var(--lime);
  border-color: var(--lime);
}

.admin-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 42px;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.admin-trigger:hover,
.admin-trigger:focus-visible {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.admin-trigger svg,
.icon-button svg,
.refresh-button svg,
.chat-refresh-button svg,
.password-field svg {
  width: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-trigger span {
  font-size: 0.77rem;
  font-weight: 650;
}

.hero {
  position: relative;
  padding: clamp(5.5rem, 10vw, 9rem) 0 clamp(6rem, 11vw, 9rem);
  text-align: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 11% 14% 8%;
  z-index: -1;
  background: radial-gradient(circle, rgba(78, 146, 211, 0.12), transparent 68%);
}

.hero-kicker,
.dialog-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: #9eafc4;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.22em;
}

.hero-kicker span {
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 15px rgba(183, 243, 107, 0.8);
}

.hero h1 {
  margin: 1.35rem 0 1.5rem;
  font-size: clamp(3.4rem, 8vw, 7.4rem);
  font-weight: 760;
  line-height: 0.96;
  letter-spacing: -0.07em;
  white-space: nowrap;
}

.hero h1 em {
  color: transparent;
  background: linear-gradient(95deg, #f5f8fc 15%, #94b6d8 74%, #b7f36b 130%);
  background-clip: text;
  -webkit-background-clip: text;
  font-style: normal;
}

.hero > p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.97rem, 1.7vw, 1.1rem);
  line-height: 1.85;
}

.status-dot,
.secure-badge i {
  width: 0.48rem;
  height: 0.48rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #6f7c8f;
}

.status.online .status-dot,
.admin-state.online i,
.secure-badge i {
  background: var(--lime);
  box-shadow: 0 0 12px rgba(183, 243, 107, 0.5);
}

.portal-section {
  padding: 2rem 0 7rem;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

.section-heading > div {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.2rem);
  letter-spacing: -0.04em;
}

.section-index {
  color: var(--lime);
  font-family: Consolas, monospace;
  font-size: 0.65rem;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.site-card {
  --accent: #80b9ff;
  --accent-rgb: 128, 185, 255;
  position: relative;
  min-height: 350px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: clamp(1.45rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 1.35rem;
  background:
    linear-gradient(145deg, rgba(var(--accent-rgb), 0.08), transparent 38%),
    rgba(14, 27, 44, 0.68);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.025) inset;
  isolation: isolate;
  transition: transform 250ms ease, border-color 250ms ease, box-shadow 250ms ease;
}

.site-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 19rem;
  height: 19rem;
  top: -10rem;
  right: -8rem;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.15);
  filter: blur(50px);
  opacity: 0.55;
}

.site-card:hover {
  transform: translateY(-4px);
  border-color: rgba(var(--accent-rgb), 0.36);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
}

.theme-emerald { --accent: #69e5b2; --accent-rgb: 105, 229, 178; }
.theme-amber { --accent: #ffc568; --accent-rgb: 255, 197, 104; }
.theme-crimson { --accent: #ff747d; --accent-rgb: 255, 116, 125; }
.theme-blue { --accent: #73adff; --accent-rgb: 115, 173, 255; }
.theme-violet { --accent: #bc91ff; --accent-rgb: 188, 145, 255; }

.card-top,
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 760;
  letter-spacing: 0.19em;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #7f8c9f;
  font-size: 0.67rem;
  font-weight: 650;
}

.status.offline .status-dot {
  background: #667286;
}

.card-art {
  position: relative;
  width: 7.5rem;
  height: 7.5rem;
  margin: auto;
  display: grid;
  place-items: center;
}

.art-ring,
.art-ring::before {
  position: absolute;
  inset: 0;
  content: "";
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 50%;
}

.art-ring::before {
  inset: 1rem;
  border-style: dashed;
  transform: rotate(27deg);
}

.art-symbol {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 4.1rem;
  height: 4.1rem;
  border: 1px solid rgba(var(--accent-rgb), 0.56);
  border-radius: 1.25rem;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  box-shadow: 0 0 35px rgba(var(--accent-rgb), 0.12);
  transform: rotate(-7deg);
}

.card-copy h3 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.35rem, 2.5vw, 1.7rem);
  letter-spacing: -0.045em;
}

.card-copy p {
  max-width: 30rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.7;
}

.card-footer {
  margin-top: 1.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  justify-content: flex-end;
}

.open-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex: 0 0 auto;
  width: min(100%, 12.5rem);
  min-height: 3.25rem;
  padding: 0.55rem 0.55rem 0.55rem 1rem;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 0.85rem;
  background: rgba(var(--accent-rgb), 0.07);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.open-link span {
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: var(--accent);
  color: #09111c;
  transition: transform 180ms ease;
}

.open-link:hover span,
.open-link:focus-visible span {
  transform: translate(2px, -2px);
}

.open-link:hover,
.open-link:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.52);
  background: rgba(var(--accent-rgb), 0.13);
  transform: translateY(-1px);
}

.tool-section {
  padding-top: 0;
}

.tool-grid .site-card {
  min-height: 260px;
}

.tool-grid .tool-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  column-gap: 3rem;
}

.tool-card .card-top,
.tool-card .card-copy,
.tool-card .card-footer {
  grid-column: 1;
}

.tool-card .card-art {
  grid-column: 2;
  grid-row: 1 / 4;
  width: 10rem;
  height: 10rem;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--line);
  color: #657287;
  font-size: 0.72rem;
}

footer span {
  color: #9aa7b9;
  font-weight: 800;
  letter-spacing: 0.2em;
}

footer p {
  margin: 0;
}

dialog {
  padding: 0;
  border: 0;
  color: var(--text);
}

dialog::backdrop {
  background: rgba(2, 7, 13, 0.72);
  backdrop-filter: blur(8px);
}

.admin-dialog {
  width: min(520px, calc(100% - 24px));
  max-height: min(860px, calc(100dvh - 24px));
  margin: auto 12px auto auto;
  border: 1px solid var(--line-strong);
  border-radius: 1.5rem;
  background: rgba(10, 20, 34, 0.97);
  box-shadow: var(--shadow);
  overflow-y: auto;
}

.admin-dialog[open] {
  animation: drawer-in 260ms cubic-bezier(.2, .7, .2, 1);
}

@keyframes drawer-in {
  from { opacity: 0; transform: translateX(1.5rem); }
  to { opacity: 1; transform: translateX(0); }
}

.dialog-shell {
  min-height: min(720px, calc(100dvh - 26px));
  display: flex;
  flex-direction: column;
  padding: clamp(1.4rem, 5vw, 2rem);
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
}

.dialog-header h2 {
  margin: 0.35rem 0 0;
  font-size: 1.8rem;
  letter-spacing: -0.05em;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.admin-loading {
  flex: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.loader {
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--line);
  border-top-color: var(--lime);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.login-view {
  margin: auto 0;
  padding: 2rem 0;
  text-align: center;
}

.security-graphic {
  position: relative;
  width: 6rem;
  height: 6rem;
  margin: 0 auto 1.5rem;
  display: grid;
  place-items: center;
}

.security-graphic span {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(183, 243, 107, 0.3);
  border-radius: 50%;
  box-shadow: 0 0 40px rgba(183, 243, 107, 0.08) inset;
}

.security-graphic svg {
  width: 2rem;
  fill: none;
  stroke: var(--lime);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-view h3,
.control-intro h3 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.035em;
}

.login-view > p {
  margin: 0.65rem 0 2rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.login-view form {
  text-align: left;
}

.login-view label {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--soft);
  font-size: 0.74rem;
  font-weight: 650;
}

.password-field {
  position: relative;
}

.password-field input {
  width: 100%;
  height: 3.25rem;
  padding: 0 3.25rem 0 1rem;
  border: 1px solid var(--line-strong);
  outline: 0;
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.password-field input:focus {
  border-color: rgba(183, 243, 107, 0.6);
  box-shadow: 0 0 0 3px rgba(183, 243, 107, 0.08);
}

.password-field button {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transform: translateY(-50%);
}

.password-field .eye-slash {
  display: none;
}

.password-field button.is-visible .eye-slash {
  display: block;
}

.form-message {
  min-height: 1.35rem;
  margin: 0.55rem 0;
  color: var(--danger);
  font-size: 0.74rem;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 3.2rem;
  border-radius: 0.8rem;
  font-weight: 720;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  border: 0;
  background: var(--lime);
  color: #0a121b;
}

button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.setup-notice {
  margin-top: 1.4rem;
  padding: 1rem;
  border: 1px solid rgba(255, 197, 104, 0.24);
  border-radius: 0.8rem;
  background: rgba(255, 197, 104, 0.07);
  text-align: left;
}

.setup-notice strong {
  color: #ffd38d;
  font-size: 0.8rem;
}

.setup-notice p {
  margin: 0.4rem 0 0.7rem;
  color: var(--muted);
  font-size: 0.74rem;
}

.setup-notice code {
  display: block;
  padding: 0.7rem;
  border-radius: 0.55rem;
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  font-size: 0.76rem;
}

.control-view {
  margin-top: 2.3rem;
}

.control-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
  color: var(--lime);
  font-size: 0.66rem;
  font-weight: 720;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  cursor: pointer;
}

.control-note {
  margin: 1rem 0 1.25rem;
  padding: 0.8rem 0.9rem;
  border-left: 2px solid #ffc568;
  background: rgba(255, 197, 104, 0.05);
  color: #aeb8c6;
  font-size: 0.73rem;
  line-height: 1.55;
}

.admin-service-list {
  display: grid;
  gap: 0.65rem;
}

.admin-service {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.025);
}

.admin-state {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.045);
}

.admin-state i {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: #657287;
}

.admin-service-copy {
  min-width: 0;
}

.admin-service-copy strong {
  display: block;
  overflow: hidden;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-service-copy span {
  color: var(--muted);
  font-size: 0.65rem;
}

.restart-button {
  min-width: 4.3rem;
  min-height: 2.15rem;
  padding: 0 0.75rem;
  border: 1px solid rgba(255, 108, 117, 0.27);
  border-radius: 0.62rem;
  background: rgba(255, 108, 117, 0.07);
  color: #ff9ba1;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
}

.refresh-button {
  width: 100%;
  min-height: 2.7rem;
  margin-top: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  cursor: pointer;
}

.admin-chat {
  margin-top: 2rem;
  padding-top: 1.7rem;
  border-top: 1px solid var(--line);
}

.chat-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.chat-heading h3 {
  margin: 0.35rem 0 0;
  font-size: 1.2rem;
  letter-spacing: -0.035em;
}

.chat-heading-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.chat-refresh-button {
  min-height: 2rem;
  padding: 0 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 680;
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.chat-refresh-button:hover,
.chat-refresh-button:focus-visible {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.volatile-badge {
  padding: 0.35rem 0.55rem;
  border: 1px solid rgba(188, 145, 255, 0.25);
  border-radius: 999px;
  background: rgba(188, 145, 255, 0.07);
  color: #c9a9ff;
  font-size: 0.62rem;
  font-weight: 720;
}

.chat-note {
  margin: 0.65rem 0 1rem;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.55;
}

.chat-messages {
  height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: rgba(2, 8, 15, 0.34);
  scrollbar-color: rgba(145, 160, 180, 0.38) transparent;
}

.chat-empty {
  margin: auto;
  color: #68768a;
  font-size: 0.72rem;
  text-align: center;
}

.chat-message {
  position: relative;
  padding: 0.75rem 3.25rem 0.75rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.035);
}

.chat-message header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.chat-message header strong {
  color: var(--soft);
  font-size: 0.69rem;
}

.chat-message time {
  color: #68768a;
  font-size: 0.6rem;
}

.chat-message p {
  margin: 0.42rem 0 0;
  color: #d7dee8;
  font-size: 0.76rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.chat-delete {
  position: absolute;
  top: 0.62rem;
  right: 0.62rem;
  min-width: 2.4rem;
  min-height: 1.8rem;
  padding: 0 0.45rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  background: transparent;
  color: #78869a;
  font-size: 0.62rem;
  cursor: pointer;
}

.chat-delete:hover,
.chat-delete:focus-visible {
  border-color: rgba(255, 108, 117, 0.25);
  background: rgba(255, 108, 117, 0.07);
  color: #ff9ba1;
}

.chat-form {
  margin-top: 0.7rem;
}

.chat-form textarea {
  width: 100%;
  min-height: 4.6rem;
  resize: vertical;
  padding: 0.8rem;
  border: 1px solid var(--line-strong);
  outline: 0;
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  line-height: 1.5;
}

.chat-form textarea::placeholder {
  color: #647287;
}

.chat-form textarea:focus {
  border-color: rgba(183, 243, 107, 0.55);
  box-shadow: 0 0 0 3px rgba(183, 243, 107, 0.07);
}

.chat-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.55rem;
}

.chat-form-footer span {
  color: #68768a;
  font-size: 0.62rem;
}

.chat-form-footer button {
  min-width: 5.2rem;
  min-height: 2.35rem;
  border: 0;
  border-radius: 0.65rem;
  background: var(--lime);
  color: #0a121b;
  font-size: 0.7rem;
  font-weight: 750;
  cursor: pointer;
}

.chat-error {
  margin-bottom: 0;
}

.confirm-dialog {
  width: min(440px, calc(100% - 32px));
  margin: auto;
  border: 1px solid var(--line-strong);
  border-radius: 1.35rem;
  background: #0d1929;
  box-shadow: var(--shadow);
}

.confirm-dialog[open] {
  animation: confirm-in 180ms ease-out;
}

@keyframes confirm-in {
  from { opacity: 0; transform: translateY(0.7rem) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.confirm-shell {
  padding: 2rem;
  text-align: center;
}

.warning-mark {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 108, 117, 0.42);
  border-radius: 50%;
  background: rgba(255, 108, 117, 0.1);
  color: #ff8f96;
  font-weight: 800;
}

.confirm-shell h2 {
  margin: 0.55rem 0 0.75rem;
  font-size: 1.45rem;
  letter-spacing: -0.04em;
}

.confirm-shell > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.65;
}

.specific-warning {
  margin-top: 1rem;
  padding: 0.8rem;
  border: 1px solid rgba(255, 197, 104, 0.22);
  border-radius: 0.7rem;
  background: rgba(255, 197, 104, 0.06);
  color: #e6c38b;
  font-size: 0.72rem;
  line-height: 1.55;
  text-align: left;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-top: 1.5rem;
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--soft);
}

.danger-button {
  border: 0;
  background: #ff7079;
  color: #1e0a0d;
}

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: max(1.5rem, env(safe-area-inset-bottom));
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 0.8rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.75rem;
  background: #15243a;
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 0.78rem;
  transform: translateX(-50%);
}

.toast.error {
  border-color: rgba(255, 108, 117, 0.38);
}

noscript {
  position: fixed;
  inset: auto 1rem 1rem;
  padding: 1rem;
  border-radius: 0.7rem;
  background: #fff;
  color: #111;
  text-align: center;
}

@media (max-width: 720px) {
  .site-header,
  main,
  footer {
    width: min(100% - 28px, 1180px);
  }

  .site-header {
    min-height: 78px;
  }

  .admin-trigger span {
    display: none;
  }

  .admin-trigger {
    width: 2.6rem;
    justify-content: center;
    padding: 0;
  }

  .hero {
    padding-top: 4.6rem;
  }

  .hero h1 {
    font-size: clamp(3.15rem, 17vw, 5.3rem);
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 0.45rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .site-card {
    min-height: 330px;
  }

  .tool-grid .tool-card {
    display: flex;
  }

  .tool-card .card-art {
    width: 7.5rem;
    height: 7.5rem;
  }

  footer {
    align-items: start;
    flex-direction: column;
  }

  .admin-dialog {
    width: calc(100% - 16px);
    max-height: calc(100dvh - 16px);
    margin: auto 8px 8px;
    border-radius: 1.35rem;
  }

  .dialog-shell {
    min-height: min(740px, calc(100dvh - 18px));
  }
}

@media (max-width: 410px) {
  .card-footer {
    align-items: start;
    flex-direction: column;
  }

  .open-link {
    align-self: flex-end;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
