@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700;800;900&display=swap");

:root {
  --page-bg: #212121;
  --header-bg: #1a1a1a;
  --panel-bg: #252525;
  --panel-inner: #2f2f2f;
  --line: #3e3e3e;
  --text: #ececec;
  --muted: #c8c8dc;
  --faint: #8e8ea0;
  --blue: #c9bcf0;
  --blue-soft: #ded6ff;
  --red: #f4b8c8;
  --green: #a8d9c0;
  --gold: #f4d8a8;
  --violet: #b8aee8;
  --accent-text: #1c1c2e;
  --shadow: rgba(0, 0, 0, 0.28);
}

:root[data-theme="light"],
body[data-theme="light"] {
  --page-bg: #f9f9f7;
  --header-bg: #ffffff;
  --panel-bg: #ffffff;
  --panel-inner: #f5f5f2;
  --line: #dcdcd8;
  --text: #1a1a1a;
  --muted: #4a4a60;
  --faint: #787890;
  --blue: #8b7bc8;
  --blue-soft: #7666b5;
  --red: #d9829a;
  --green: #5b9b80;
  --gold: #bd8752;
  --violet: #8b7bc8;
  --accent-text: #ffffff;
  --shadow: rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-width: 320px;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--blue) 6%, transparent) 0, transparent 280px),
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(255, 255, 255, 0.018) 31px 32px),
    var(--page-bg);
  color: var(--text);
  font-family: "Noto Sans KR", "Malgun Gothic", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
textarea {
  font: inherit;
}

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

button {
  cursor: pointer;
}

svg {
  width: 18px;
  height: 18px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 28px;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  padding: 0 max(22px, calc((100vw - 1320px) / 2));
}

.brand,
.logo {
  display: inline-flex;
  min-width: 224px;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark,
.logo-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--blue) 42%, transparent);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: var(--accent-text);
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 10%, transparent);
}

.main-nav {
  display: flex;
  flex: 1;
  justify-content: center;
  gap: 8px;
}

.main-nav a {
  color: var(--muted);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  padding: 8px 11px;
}

.main-nav a:hover {
  background: var(--panel-inner);
  color: var(--text);
}

.main-nav a.active {
  background: color-mix(in srgb, var(--blue) 14%, transparent);
  color: var(--blue);
  text-decoration: none;
}

.header-actions {
  display: flex;
  min-width: 220px;
  justify-content: flex-end;
  gap: 10px;
}

.makeron-link,
.theme-button,
.model-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-bg) 92%, transparent);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.makeron-link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  border-color: color-mix(in srgb, var(--blue) 36%, var(--line));
  color: var(--blue);
  padding: 0 14px;
  font-size: 14px;
}

.theme-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--blue);
}

.theme-icon {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: transparent;
  box-shadow:
    0 -7px 0 -6px currentColor,
    0 7px 0 -6px currentColor,
    7px 0 0 -6px currentColor,
    -7px 0 0 -6px currentColor,
    5px 5px 0 -6px currentColor,
    -5px 5px 0 -6px currentColor,
    5px -5px 0 -6px currentColor,
    -5px -5px 0 -6px currentColor;
}

.theme-icon::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: currentColor;
}

:root[data-theme="light"] .theme-icon,
body[data-theme="light"] .theme-icon,
.theme-button[data-theme-mode="light"] .theme-icon {
  border: 0;
  background: currentColor;
  box-shadow: inset -6px -3px 0 var(--panel-bg);
}

:root[data-theme="light"] .theme-icon::after,
body[data-theme="light"] .theme-icon::after,
.theme-button[data-theme-mode="light"] .theme-icon::after {
  display: none;
}

.theme-button[data-theme-mode="dark"] .theme-icon {
  border: 2px solid currentColor;
  background: transparent;
  box-shadow:
    0 -7px 0 -6px currentColor,
    0 7px 0 -6px currentColor,
    7px 0 0 -6px currentColor,
    -7px 0 0 -6px currentColor,
    5px 5px 0 -6px currentColor,
    -5px 5px 0 -6px currentColor,
    5px -5px 0 -6px currentColor,
    -5px -5px 0 -6px currentColor;
}

.theme-button[data-theme-mode="dark"] .theme-icon::after {
  display: block;
}

.speller-page {
  width: min(1250px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 26px 0 150px;
}

body.input-mode .speller-page {
  padding-bottom: 118px;
}

.top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.top-meta p {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-bg) 74%, transparent);
  color: var(--muted);
  font-size: 14px;
  padding: 8px 11px;
}

.model-picker {
  position: relative;
}

.model-button {
  display: inline-flex;
  min-width: 222px;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-color: color-mix(in srgb, var(--blue) 28%, var(--line));
  padding: 8px 13px 8px 16px;
  text-align: left;
}

.model-button small {
  display: block;
  margin-bottom: 3px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 800;
}

.model-button strong {
  font-size: 16px;
}

.model-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  display: grid;
  width: 284px;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-bg);
  box-shadow: 0 18px 48px var(--shadow);
  padding: 8px;
}

.model-menu button {
  display: grid;
  gap: 3px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 10px;
  text-align: left;
}

.model-menu button:hover,
.model-menu button.active {
  background: color-mix(in srgb, var(--blue) 14%, transparent);
}

.model-menu span {
  color: var(--muted);
  font-size: 13px;
}

.work-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 168px;
  gap: 18px;
  align-items: start;
}

.work-layout.no-side-ad {
  grid-template-columns: 1fr;
}

.speller-card {
  position: relative;
  min-height: 610px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-bg);
  box-shadow: 0 16px 44px var(--shadow);
}

body.input-mode .speller-card {
  min-height: 610px;
}

.speller-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--green), var(--red));
  content: "";
}

.card-head {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
}

.card-head h1,
.result-head h1 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
}

.clear-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--muted);
}

#sourceText {
  display: block;
  width: calc(100% - 64px);
  min-height: 440px;
  margin: 0 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  resize: none;
  background: var(--panel-inner);
  color: var(--text);
  font-size: 16px;
  line-height: 1.8;
  padding: 24px 26px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

body.input-mode #sourceText {
  min-height: clamp(280px, calc(100svh - 430px), 440px);
}

#sourceText:focus {
  border-color: color-mix(in srgb, var(--blue) 56%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 12%, transparent);
}

#sourceText::placeholder {
  color: var(--faint);
}

.input-footer {
  display: flex;
  min-height: 86px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 32px;
}

.input-footer span {
  color: var(--faint);
}

.check-button {
  min-width: 136px;
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: var(--accent-text);
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 12px 24px color-mix(in srgb, var(--blue) 18%, transparent);
}

.check-button:hover {
  background: var(--blue-soft);
}

.submit-row,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.recaptcha-slot {
  display: grid;
  width: 238px;
  min-width: 238px;
  min-height: 62px;
  align-items: start;
  justify-items: start;
  overflow: hidden;
}

.recaptcha-slot.captcha-rendered {
  height: 62px;
}

.recaptcha-slot.captcha-rendered > div {
  transform: scale(0.78);
  transform-origin: 0 0;
}

.recaptcha-slot.captcha-error {
  border-radius: 8px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 16%, transparent);
}

.recaptcha-slot.captcha-missing-key {
  width: auto;
  min-width: 196px;
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--red) 38%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--red) 8%, var(--panel-inner));
  padding: 8px 10px;
}

.recaptcha-placeholder {
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
}

.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.ghost-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-bg);
  color: var(--text);
  font-weight: 800;
  padding: 0 18px;
}

.result-view {
  position: relative;
  display: grid;
  min-height: 610px;
  grid-template-columns: minmax(260px, 1fr) minmax(360px, 0.95fr);
  grid-template-rows: 1fr auto;
  gap: 18px;
  padding: 26px 24px 34px;
}

.document-pane {
  min-width: 0;
  padding-right: 0;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 42px;
}

.scroll-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  user-select: none;
}

.scroll-toggle input {
  position: absolute;
  opacity: 0;
}

.toggle-ui {
  position: relative;
  width: 56px;
  height: 29px;
  border-radius: 999px;
  background: var(--blue);
  transition: background 0.16s ease;
}

.toggle-ui::after {
  position: absolute;
  top: 4px;
  right: 5px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--header-bg);
  content: "";
  transition: left 0.16s ease, right 0.16s ease, background 0.16s ease;
}

.scroll-toggle input:not(:checked) + .toggle-ui {
  background: var(--line);
}

.scroll-toggle input:not(:checked) + .toggle-ui::after {
  right: auto;
  left: 5px;
  background: var(--faint);
}

.corrected-doc {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  line-height: 2.05;
  white-space: pre-wrap;
}

.underlined-error {
  display: inline-flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 1px;
  vertical-align: baseline;
  border-radius: 5px;
  background: color-mix(in srgb, var(--red) 18%, transparent);
  color: var(--red);
  font-weight: 800;
  text-decoration: none;
  line-height: 1.2;
  margin: 0 1px;
  padding: 2px 5px 3px;
}

.underlined-error::before {
  content: attr(data-original);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
  user-select: none;
}

.error-current {
  color: var(--red);
  font-size: 15px;
}

.underlined-error.active {
  outline: 2px solid color-mix(in srgb, var(--red) 44%, transparent);
  outline-offset: 2px;
}

.detail-pane {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-inner) 70%, var(--panel-bg));
  padding: 18px;
}

.detail-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.detail-topline {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--blue) 35%, var(--line));
  border-radius: 999px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 14px;
  padding: 0 10px;
  text-align: left;
}

.detail-pane h2 {
  margin: 0;
  color: var(--faint);
  font-size: 17px;
  font-weight: 800;
}

.detail-pane h2 strong {
  color: var(--red);
}

.detail-pane.no-issue h2 strong {
  color: var(--green);
}

.detail-pane.no-issue .error-dot {
  background: var(--green);
}

.detail-pane.no-issue .round-tool,
.detail-pane.no-issue .report-button {
  cursor: not-allowed;
  opacity: 0.45;
}

.detail-table {
  display: grid;
  gap: 18px;
  margin: 0;
}

.detail-table > div {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.detail-table dt {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.detail-table dd {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.detail-table dd p {
  flex: 1 1 auto;
  margin: 0;
  line-height: 1.55;
  white-space: pre-line;
}

.word-stack {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.word-stack small {
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
}

.word-stack strong,
.word-stack #replaceWord {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
}

.error-dot {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--red);
}

.round-tool {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--blue);
  color: var(--accent-text);
}

.round-tool.active {
  background: var(--green);
}

.report-button {
  display: inline-flex;
  min-height: 32px;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 4px 2px;
}

.report-button svg {
  width: 17px;
  height: 17px;
}

.report-button:hover {
  color: var(--blue);
}

#replaceWord {
  border-radius: 6px;
  padding: 2px 4px;
}

#replaceWord.editing {
  min-width: 120px;
  outline: 2px solid color-mix(in srgb, var(--blue) 56%, transparent);
  background: color-mix(in srgb, var(--blue) 12%, transparent);
  color: var(--text);
}

.more-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

.detail-extra {
  margin-top: 18px;
  border: 1px solid color-mix(in srgb, var(--blue) 24%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue) 7%, var(--panel-bg));
  padding: 14px;
}

.detail-extra dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.detail-extra div {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
}

.detail-extra dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.detail-extra dd {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

.result-toolbar,
.legend {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 24px;
}

.result-toolbar {
  margin-top: 6px;
}

.result-toolbar button {
  display: grid;
  gap: 5px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  padding: 6px 8px;
}

.result-toolbar button:hover {
  border-color: var(--line);
  background: var(--panel-inner);
  color: var(--text);
}

.legend {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.legend-dot.spelling {
  background: var(--red);
}

.legend-dot.spacing {
  background: var(--green);
}

.legend-dot.style {
  background: var(--gold);
}

.legend-dot.failed {
  background: var(--violet);
}

.side-ad-wrap {
  display: flex;
  justify-content: center;
}

.side-ad {
  width: 168px;
  min-height: 610px;
  padding: 24px 12px;
}

.bottom-ad {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  display: flex;
  min-height: 118px;
  align-items: center;
  justify-content: center;
  border-top: 1px solid rgba(0, 0, 0, 0.14);
  background: color-mix(in srgb, var(--header-bg) 90%, #ffffff 10%);
  color: #111;
  padding: 12px max(16px, calc((100vw - 1180px) / 2));
}

.ad-close {
  position: absolute;
  top: 10px;
  left: max(12px, calc((100vw - 1180px) / 2));
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel-bg);
  color: var(--muted);
  line-height: 1;
}

.ad-close svg {
  width: 14px;
  height: 14px;
}

.bottom-ad-banner {
  position: relative;
  display: grid;
  width: min(100%, 970px);
  min-height: 90px;
  grid-template-columns: auto 248px minmax(0, 1fr) 170px;
  align-items: center;
  gap: 22px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--blue) 28%, var(--line));
  border-radius: 6px;
  background:
    linear-gradient(90deg, var(--panel-bg) 0%, var(--panel-inner) 50%, color-mix(in srgb, var(--blue) 14%, var(--panel-inner)) 100%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
  padding: 10px 18px;
}

.google-ad-shell {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--blue) 24%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--panel-bg) 88%, transparent), color-mix(in srgb, var(--blue) 10%, var(--panel-inner)));
  color: var(--muted);
}

.side-ad.google-ad-shell {
  width: 168px;
  min-height: 610px;
  padding: 0;
}

.bottom-ad-banner.google-ad-shell {
  grid-template-columns: 1fr;
  gap: 0;
  padding: 0;
}

.info-top-ad.google-ad-shell {
  min-height: 90px;
  padding: 0;
}

.info-side-ad.google-ad-shell {
  width: 168px;
  min-height: 100%;
  padding: 0;
}

.google-ad-placeholder {
  display: grid;
  gap: 5px;
  place-items: center;
  text-align: center;
  padding: 14px;
}

.google-ad-placeholder span {
  display: inline-grid;
  min-width: 38px;
  min-height: 22px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--blue) 34%, var(--line));
  border-radius: 4px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
}

.google-ad-placeholder strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
}

.google-ad-placeholder small {
  color: var(--faint);
  font-size: 12px;
  font-weight: 800;
}

.google-ad-shell.adsense-ready {
  background: transparent;
}

.google-ad-shell .adsbygoogle {
  width: 100%;
  min-height: inherit;
}

.info-layout {
  width: 100%;
  margin: 26px auto 0;
}

.info-page {
  min-height: 430px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-bg);
  box-shadow: 0 18px 48px var(--shadow);
  padding: 34px;
}

.info-page.has-info-ads {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 168px;
  align-items: stretch;
  gap: 16px;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.info-page.has-info-ads.info-no-side-ad {
  grid-template-columns: 1fr;
}

.info-content {
  min-width: 0;
  min-height: 430px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-bg);
  box-shadow: 0 18px 48px var(--shadow);
  padding: 34px;
}

.info-top-ad {
  grid-column: 1 / -1;
  min-height: 86px;
  flex-direction: row;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  text-align: left;
}

.info-top-ad span,
.info-top-ad strong,
.info-top-ad p,
.info-top-ad button {
  margin: 0;
}

.info-top-ad span {
  flex: 0 0 auto;
  margin-bottom: 0;
}

.info-top-ad strong {
  max-width: 220px;
  font-size: 18px;
}

.info-top-ad p {
  flex: 1 1 auto;
  color: #fff;
  font-size: 14px;
  line-height: 1.45;
}

.info-top-ad button {
  flex: 0 0 auto;
}

.info-side-ad {
  width: 168px;
  min-height: 100%;
  padding: 22px 12px;
}

.info-side-ad p {
  font-size: 14px;
}

.info-page.info-no-top-ad .info-top-ad,
.info-page.info-no-side-ad .info-side-ad {
  display: none;
}

.info-kicker {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--blue) 34%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 10%, transparent);
  padding: 0 10px;
  margin-bottom: 9px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.info-page h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.25;
}

.info-page p {
  max-width: 720px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.info-page .info-top-ad p {
  max-width: none;
  margin: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.info-page .info-side-ad p {
  max-width: none;
  margin: 28px 0;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.about-summary {
  display: grid;
  gap: 8px;
  margin-top: 22px;
  border: 1px solid color-mix(in srgb, var(--blue) 28%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue) 8%, var(--panel-inner));
  padding: 16px;
}

.about-summary p,
.copyright-line {
  max-width: none;
  margin: 0;
  font-size: 14px;
}

.notice-link {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.notice-link:hover {
  text-decoration: underline;
}

.info-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}

.info-card-grid section,
.step-list li,
.qa-list details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-inner);
  padding: 16px;
}

.info-card-grid strong,
.step-list strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 16px;
}

.info-card-grid span,
.step-list span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.step-list {
  display: grid;
  gap: 12px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.guide-flow {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.guide-flow li {
  min-height: 156px;
}

.step-index {
  display: inline-grid;
  min-width: 34px;
  min-height: 24px;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 16%, transparent);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.guide-preview-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.guide-preview-strip span {
  display: grid;
  min-height: 58px;
  place-items: center;
  border: 1px dashed color-mix(in srgb, var(--blue) 36%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue) 7%, var(--panel-inner));
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.today-card {
  display: grid;
  gap: 16px;
  margin-top: 22px;
  border: 1px solid color-mix(in srgb, var(--blue) 34%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue) 13%, var(--panel-inner)), var(--panel-inner));
  padding: 22px;
}

.today-date {
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.today-card h2 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  line-height: 1.35;
}

.today-pair {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-bg) 55%, transparent);
  padding: 16px;
}

.today-pair span {
  color: var(--faint);
  font-size: 13px;
  font-weight: 900;
}

.today-pair strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1.35;
}

.today-card p {
  max-width: none;
  margin: 0;
  font-size: 15px;
}

.today-examples {
  display: grid;
  gap: 8px;
  margin: 0;
}

.today-examples div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.today-examples dt {
  color: var(--faint);
  font-size: 13px;
  font-weight: 900;
}

.today-examples dd {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.today-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.today-tags span {
  border: 1px solid color-mix(in srgb, var(--blue) 28%, var(--line));
  border-radius: 999px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 9px;
}

.today-archive-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 14px;
}

.today-archive-head strong {
  color: var(--text);
  font-size: 17px;
}

.today-archive {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.today-archive article {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-inner);
  padding: 14px;
}

.today-archive time {
  color: var(--faint);
  font-size: 12px;
  font-weight: 800;
}

.today-archive strong {
  color: var(--text);
  font-size: 15px;
}

.today-archive span {
  color: var(--muted);
  font-size: 13px;
}

.qa-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.qa-list summary {
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
}

.qa-list p {
  margin-top: 10px;
  font-size: 14px;
}

.board-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.board-head h1 {
  margin-top: 0;
}

.board-head p {
  margin-top: 10px;
}

.board-notice {
  max-width: none !important;
  border: 1px solid color-mix(in srgb, var(--gold) 34%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--gold) 8%, var(--panel-inner));
  padding: 12px 14px;
}

.qa-search {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 44px;
  gap: 8px;
  margin-top: 16px;
}

.qa-write-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  border: 1px solid color-mix(in srgb, var(--blue) 28%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue) 7%, var(--panel-inner));
  padding: 16px;
}

.qa-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(2, minmax(132px, 170px));
  gap: 10px;
}

.qa-write-form label {
  min-width: 0;
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.qa-write-form input,
.qa-write-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-inner);
  color: var(--text);
  outline: 0;
  padding: 12px;
}

.qa-write-form input:focus,
.qa-write-form textarea:focus {
  border-color: color-mix(in srgb, var(--blue) 56%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 12%, transparent);
}

.qa-secret-row {
  display: inline-flex !important;
  width: fit-content;
  align-items: center;
  grid-template-columns: none !important;
  gap: 8px !important;
}

.qa-secret-row input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.qa-write-form .form-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(108px, 1fr));
}

.qa-write-form .form-actions .ghost-button,
.qa-write-form .form-actions .check-button {
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding: 0 18px;
  font-size: 15px;
}

.qa-search select,
.qa-search input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-inner);
  color: var(--text);
  outline: 0;
  padding: 0 12px;
}

.qa-search input:focus,
.qa-search select:focus {
  border-color: color-mix(in srgb, var(--blue) 56%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 12%, transparent);
}

.qa-search button {
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: var(--accent-text);
}

.qa-board-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.qa-board-list a {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-inner);
  color: var(--text);
  padding: 13px 15px;
  text-decoration: none;
}

.qa-board-list a.secret strong {
  color: var(--blue);
}

.qa-board-list a strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.qa-board-list a strong svg {
  width: 15px;
  height: 15px;
}

.qa-board-list a:hover {
  border-color: color-mix(in srgb, var(--blue) 42%, var(--line));
}

.qa-board-list strong {
  font-size: 15px;
}

.qa-board-list span {
  color: var(--muted);
  font-size: 13px;
}

.qa-detail {
  display: grid;
  gap: 16px;
  margin-top: 14px;
  border: 1px solid color-mix(in srgb, var(--blue) 30%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue) 6%, var(--panel-inner));
  padding: 18px;
}

.qa-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.qa-detail-head h2 {
  margin: 8px 0 0;
  font-size: 20px;
  line-height: 1.35;
}

.qa-detail-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.qa-detail-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--blue) 34%, var(--line));
  border-radius: 999px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  padding: 0 9px;
}

.qa-detail-body {
  display: grid;
  gap: 10px;
}

.qa-detail-body section,
.qa-secret-gate {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-inner);
  padding: 14px;
}

.qa-detail-body strong,
.qa-secret-gate strong {
  color: var(--text);
  font-size: 14px;
}

.qa-detail-body p,
.qa-secret-gate span {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.qa-password-line,
.qa-detail-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.qa-detail-actions label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.qa-password-line input,
.qa-detail-actions input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-inner);
  color: var(--text);
  outline: 0;
  padding: 0 12px;
}

.qa-detail-actions .ghost-button {
  min-height: 42px;
  margin: 0;
}

.pager {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
}

.pager button {
  min-width: 36px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-inner);
  color: var(--muted);
  font-weight: 800;
}

.pager button.active {
  border-color: var(--blue);
  background: var(--blue);
  color: var(--accent-text);
}

.pager button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.contact-form {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin-top: 0;
}

.contact-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

.contact-form input,
.contact-form textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-inner);
  color: var(--text);
  outline: 0;
  padding: 12px;
}

.contact-form textarea {
  min-height: 246px;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: color-mix(in srgb, var(--blue) 56%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 12%, transparent);
}

.feedback-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
  margin-top: 22px;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.form-footer span {
  color: var(--faint);
  font-size: 14px;
}

.contact-card {
  display: grid;
  align-content: start;
  gap: 10px;
  margin-top: 26px;
}

.contact-card a {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-inner);
  color: var(--text);
  padding: 16px;
  text-decoration: none;
}

.contact-card a:hover {
  border-color: color-mix(in srgb, var(--blue) 42%, var(--line));
}

.contact-card strong {
  color: var(--blue);
}

.contact-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 130px;
  z-index: 80;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-bg);
  color: var(--text);
  opacity: 0;
  padding: 11px 14px;
  transform: translateY(12px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  pointer-events: none;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.copy-buffer {
  position: fixed;
  right: 22px;
  bottom: 178px;
  z-index: 90;
  width: min(420px, calc(100vw - 44px));
  min-height: 96px;
  border: 1px solid color-mix(in srgb, var(--blue) 38%, var(--line));
  border-radius: 8px;
  background: var(--panel-bg);
  color: var(--text);
  box-shadow: 0 16px 44px var(--shadow);
  outline: 0;
  padding: 12px;
  resize: none;
}

.admin-page {
  width: min(1080px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 34px 0 80px;
}

.admin-hero {
  margin-bottom: 20px;
}

.admin-hero h1 {
  margin: 0;
  font-size: 30px;
}

.admin-hero p {
  max-width: 680px;
  color: var(--muted);
  line-height: 1.7;
}

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

.admin-panel {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-bg);
  padding: 18px;
}

.admin-panel h2 {
  margin: 0;
  font-size: 19px;
}

.admin-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.admin-panel input,
.admin-panel select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-inner);
  color: var(--text);
  padding: 0 12px;
}

.check-row {
  display: flex !important;
  align-items: center;
  gap: 10px !important;
}

.check-row input {
  width: 18px;
  min-height: 18px;
}

.preview-panel {
  grid-column: 1 / -1;
}

.admin-preview {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-inner);
  padding: 14px;
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-ad {
  display: grid;
  min-height: 58px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
}

.preview-body {
  display: grid;
  grid-template-columns: 1fr 1fr 150px;
  gap: 10px;
}

.preview-body > * {
  min-height: 90px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-bg);
  color: var(--muted);
  padding: 12px;
}

.admin-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.redirect-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1080px) {
  .site-header {
    flex-wrap: wrap;
    gap: 14px;
    padding: 14px 18px;
  }

  .brand,
  .logo,
  .header-actions {
    min-width: 0;
  }

  .main-nav {
    order: 3;
    flex-basis: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .work-layout,
  .result-view,
  .admin-grid,
  .preview-body,
  .contact-grid,
  .feedback-layout {
    grid-template-columns: 1fr;
  }

  body.input-mode .speller-page {
    padding-top: 16px;
    padding-bottom: 110px;
  }

  body.input-mode .side-ad-wrap {
    display: none;
  }

  body.input-mode .work-layout {
    gap: 0;
  }

  body.input-mode .speller-card {
    min-height: 0;
  }

  .info-page.has-info-ads {
    grid-template-columns: 1fr;
  }

  .info-side-ad {
    width: 100%;
    min-height: 148px;
  }

  .contact-card {
    margin-top: 0;
  }

  .guide-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .document-pane,
  .detail-pane {
    padding: 0;
  }

  .detail-pane {
    margin-top: 28px;
  }

  .side-ad,
  .side-ad.google-ad-shell {
    width: 100%;
    min-height: 160px;
  }

  .bottom-ad {
    min-height: 108px;
    padding: 10px 48px;
  }

  .bottom-ad-banner.google-ad-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .speller-page {
    width: min(100% - 24px, 520px);
  }

  .top-meta,
  .input-footer {
    align-items: stretch;
    flex-direction: column;
  }

  body.input-mode .speller-page {
    padding-top: 14px;
    padding-bottom: 104px;
  }

  body.input-mode .top-meta {
    gap: 10px;
    margin-bottom: 10px;
  }

  body.input-mode .top-meta p {
    padding: 6px 10px;
  }

  body.input-mode .model-button {
    min-height: 48px;
  }

  body.input-mode .card-head {
    min-height: 54px;
  }

  body.input-mode #sourceText {
    min-height: clamp(300px, 35svh, 320px);
    padding: 18px;
  }

  body.input-mode .input-footer {
    min-height: 0;
    padding-top: 12px;
    padding-bottom: 14px;
  }

  body.input-mode .recaptcha-slot.captcha-missing-key {
    min-height: 44px;
  }

  body.input-mode .check-button {
    min-height: 46px;
  }

  .submit-row,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .submit-row .check-button,
  .recaptcha-slot {
    width: 100%;
  }

  .recaptcha-slot.captcha-rendered {
    width: 238px;
    max-width: 100%;
  }

  .card-head,
  .input-footer {
    padding-right: 22px;
    padding-left: 22px;
  }

  #sourceText {
    width: calc(100% - 44px);
    margin-right: 22px;
    margin-left: 22px;
    padding: 20px;
  }

  .info-page {
    min-height: 0;
    padding: 24px;
  }

  .info-page.has-info-ads {
    padding: 0;
  }

  .info-content {
    min-height: 0;
    padding: 24px;
  }

  .info-top-ad {
    min-height: 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .info-top-ad strong {
    max-width: none;
  }

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

  .guide-flow,
  .guide-preview-strip,
  .today-pair,
  .today-examples div,
  .qa-search,
  .qa-form-grid,
  .qa-password-line,
  .qa-detail-actions {
    grid-template-columns: 1fr;
  }

  .guide-flow li {
    min-height: 0;
  }

  .board-head {
    align-items: stretch;
    flex-direction: column;
  }

  .board-head .ghost-button,
  .form-footer .check-button {
    width: 100%;
  }

  .form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .model-button,
  .model-menu {
    width: 100%;
  }

  .result-toolbar,
  .legend {
    flex-wrap: wrap;
    gap: 12px;
  }

  .bottom-ad {
    min-height: 96px;
    padding: 8px 12px 8px 42px;
  }

  .ad-close {
    top: 8px;
    left: 8px;
  }

  .bottom-ad-banner {
    min-height: 78px;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    padding: 9px 10px;
  }

  .bottom-ad-banner.google-ad-shell {
    grid-template-columns: 1fr;
  }
}
