:root {
  --bg: #f4f6f0;
  --surface: #ffffff;
  --text: #1f2a1f;
  --muted: #617061;
  --line: #d6e0d0;
  --accent: #007b5e;
  --accent-strong: #005f49;
  --danger: #b72f2f;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans KR", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 10% 10%, #d8f3dc 0%, transparent 35%),
    radial-gradient(circle at 90% 20%, #ffead5 0%, transparent 35%), var(--bg);
}

.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(90deg, transparent 24px, rgba(0, 0, 0, 0.03) 25px),
    linear-gradient(transparent 24px, rgba(0, 0, 0, 0.03) 25px);
  background-size: 25px 25px;
  opacity: 0.3;
}

.remote-support {
  position: fixed;
  top: 90px;
  left: max(12px, calc((100vw - 1080px) / 2 - 200px));
  z-index: 30;
  width: 176px;
}

.remote-support a {
  display: grid;
  justify-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 20px rgba(35, 52, 35, 0.14);
  padding: 10px 10px 12px;
}

.remote-support img {
  display: block;
  height: 48px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.remote-support-title {
  font-weight: 700;
  color: #0b4fd8;
}

.remote-support-sub {
  font-size: 0.8rem;
  color: var(--muted);
}

.layout {
  max-width: 1080px;
  margin: 0 auto;
  padding: 44px 18px 80px;
  position: relative;
  z-index: 1;
}

.hero h1 {
  margin: 0 0 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 5vw, 3rem);
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.hero .eyebrow {
  margin: 0;
  color: var(--accent-strong);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.hero .desc {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
}

.card {
  margin-top: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 12px 20px rgba(35, 52, 35, 0.08);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

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

h2,
h3 {
  margin: 0 0 6px;
}

.sub,
.hint,
.future p {
  margin: 0;
  color: var(--muted);
}

form {
  display: grid;
  gap: 12px;
  max-width: 420px;
}

label {
  display: grid;
  gap: 5px;
  font-weight: 500;
}

input,
select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  font: inherit;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.toggle-input {
  width: auto;
  min-width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.button-link {
  display: inline-block;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}

.button-link.icon-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.button-link.icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
}

.button-link:hover {
  background: var(--accent-strong);
}

button:hover {
  background: var(--accent-strong);
}

.material-symbols-rounded {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  line-height: 1;
}

.ghost {
  background: #e8f3ee;
  color: #205646;
}

.ghost:hover {
  background: #d8ece4;
}

.error {
  color: var(--danger);
  min-height: 1.2em;
  margin: 10px 0 0;
}

.hidden {
  display: none !important;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.table-wrap {
  margin-top: 12px;
  overflow: auto;
}

.tabs {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab-btn {
  background: #eef5f2;
  color: #2c5d4f;
  border: 1px solid #d8e4dd;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 600;
}

.tab-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.ad-shell {
  margin-top: 18px;
}

.ad-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.ad-slot {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  min-height: 120px;
  padding: 8px;
}

.ad-slot .adsbygoogle {
  display: block;
  min-height: 104px;
}

.ad-row td {
  padding: 10px 8px;
  background: #fbfcf8;
}

.unregistered-row td {
  background: #fff5df;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 12px 8px;
  font-size: 0.95rem;
}

th {
  color: #355241;
  white-space: nowrap;
  font-weight: 700;
}

.th-select {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.th-select input[type="checkbox"] {
  margin: 0;
}

.download-row-clickable .download-meta-cell {
  cursor: pointer;
}

.download-row-clickable:hover .download-meta-cell {
  background: #f6faf7;
}

.operator-toggle-cell,
.operator-db-cell {
  cursor: pointer;
}

.operator-db-cell:hover,
.operator-toggle-cell:hover {
  background: #f6faf7;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
}

.action-icon {
  font-size: 20px;
}

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

.board-title-link {
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 400;
}

.board-card-head {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.board-list-wrap {
  margin-top: 10px;
  max-height: 420px;
  overflow: auto;
  border: 1px solid #e4ece3;
  border-radius: 12px;
}

.board-title-link:hover {
  text-decoration: underline;
}

.board-table {
  table-layout: fixed;
  min-width: 680px;
}

.board-table .col-time {
  width: 18ch;
}

.board-table .col-author {
  width: calc(15ch + 20px);
}

.board-table .col-actions {
  width: 124px;
}

.board-table .board-title-cell {
  width: auto;
}

.board-table .board-title-link {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.board-row-clickable td:not(.board-action-cell) {
  cursor: pointer;
}

.board-row-clickable:hover td:not(.board-action-cell) {
  background: #f6faf7;
}

.board-table .board-time-cell,
.board-table .board-author-cell,
.board-table .board-action-cell {
  padding-left: 10px;
  padding-right: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-table .board-action-cell {
  text-align: center;
}

.board-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.board-scroll-sentinel {
  height: 1px;
}

.board-latest {
  margin-top: 12px;
  margin-bottom: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fcfa;
}

.board-latest h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
}

.board-latest-content {
  margin-top: 8px;
  max-height: 260px;
}

.board-dialog {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 22px;
  gap: 12px;
  overflow-x: hidden;
}

.board-dialog,
.board-dialog * {
  box-sizing: border-box;
}

.board-dialog label {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.board-dialog input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.board-editor {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.board-editor .ql-editor {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 180px;
  overflow-x: hidden;
  word-break: break-word;
}

.board-editor .ql-container {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 460px;
  overflow-x: hidden;
}

.board-editor .ql-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.board-content {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
  max-height: 56vh;
  overflow: auto;
}

dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  width: min(560px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  margin: auto;
}

#ui-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100dvw - 24px));
  max-width: calc(100dvw - 24px);
  margin: 0;
  box-sizing: border-box;
}

#board-view-dialog,
#board-compose-dialog {
  width: min(1200px, calc(100vw - 24px));
  max-width: min(1200px, calc(100vw - 24px));
}

.dialog-form {
  padding: 18px;
  display: grid;
  gap: 10px;
}

.dialog-message {
  white-space: pre-line;
  line-height: 1.45;
}

.danger-btn {
  background: var(--danger);
}

.danger-btn:hover {
  background: #982424;
}

.dropzone {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 768px) {
  .remote-support {
    top: auto;
    left: auto;
    right: 12px;
    bottom: 14px;
    width: auto;
    max-width: calc(100vw - 24px);
  }

  .remote-support a {
    grid-template-columns: 34px auto;
    align-items: center;
    justify-items: start;
    column-gap: 8px;
    row-gap: 1px;
    padding: 8px 10px;
  }

  .remote-support img {
    height: 34px;
    width: auto;
    max-width: 34px;
    grid-row: 1 / span 2;
  }

  dialog {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
  }

  #ui-dialog {
    width: calc(100dvw - 20px);
    max-width: calc(100dvw - 20px);
  }

  .layout {
    padding-top: 28px;
  }

  .hero-top {
    flex-direction: column;
  }

  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  #board-compose-dialog {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    height: calc(100dvh - 20px);
    max-height: calc(100dvh - 20px);
    margin: 10px;
    padding: 0;
    border-radius: 0;
    border: 0;
    background: rgba(31, 42, 31, 0.18);
  }

  #board-compose-dialog .board-dialog {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-rows: auto auto auto 1fr auto;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    overflow-x: hidden;
  }

  #board-compose-dialog .board-editor {
    min-height: 0;
    height: 100%;
  }

  #board-compose-dialog .board-editor .ql-container {
    min-height: 0;
    height: calc(100dvh - 290px);
  }
}
