:root {
  /* Theme variables are provided by head.theme.css */
}

.dhb {
  --dhb-radius: 16px;
  --dhb-shadow: 0 18px 42px rgba(0,0,0,.18);
  --dhb-card: color-mix(in oklab, var(--panel) 88%, transparent);
  --dhb-card-2: color-mix(in oklab, var(--panel-soft) 65%, transparent);
  --dhb-line: color-mix(in oklab, var(--line) 78%, transparent);
  --dhb-accent: var(--accent);
  --dhb-text: var(--text);
  --dhb-muted: var(--muted);
  color: var(--dhb-text);
}

html[data-theme="light"] .dhb {
  --dhb-shadow: 0 18px 42px rgba(16, 19, 27, .10);
}

.dhb a {
  color: inherit;
}

.dhb-wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 14px 28px;
}

.dhb-card {
  border: 1px solid var(--dhb-line);
  border-radius: var(--dhb-radius);
  background: var(--dhb-card);
  box-shadow: var(--dhb-shadow);
  overflow: hidden;
}

.dhb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--dhb-line);
}

/* When used inside support page card, we don't want the wrap constraints. */
#dhSupportRoot .dhb-wrap {
  max-width: none;
  margin: 0;
  padding: 0;
}

#dhSupportRoot .dhb-card {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#dhSupportRoot .dhb-head {
  display: none;
}

#dhSupportRoot .dhb-body {
  padding: 0;
}

/* Support notice "write" page should still look like a proper themed form card */
#dhSupportRoot #dhbWrite .dhb-wrap {
  max-width: none;
  margin: 0;
}

#dhSupportRoot #dhbWrite .dhb-card {
  border: 1px solid var(--dhb-line);
  border-radius: var(--dhb-radius);
  /* Solid (no gradients) to match the user site look */
  background: color-mix(in oklab, var(--panel) 92%, transparent);
  box-shadow: var(--dhb-shadow);
  overflow: hidden;
}

#dhSupportRoot #dhbWrite .dhb-head {
  display: flex;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--dhb-line);
}

#dhSupportRoot #dhbWrite .dhb-body {
  padding: 16px;
  min-height: 0;
}

/* Make sure form fields keep theme colors even if core/editor CSS overrides them */
#dhSupportRoot #dhbWrite .dhb-field input[type="text"],
#dhSupportRoot #dhbWrite .dhb-field input[type="password"],
#dhSupportRoot #dhbWrite .dhb-field textarea {
  width: 100% !important;
  border: 1px solid var(--dhb-line) !important;
  border-radius: 12px !important;
  background: color-mix(in oklab, var(--panel) 92%, transparent) !important;
  color: var(--dhb-text) !important;
}

#dhSupportRoot #dhbWrite .dhb-field textarea {
  min-height: 0;
}

/* Common editor wrappers (if enabled) */
#dhSupportRoot #dhbWrite .dhb-field .cke,
#dhSupportRoot #dhbWrite .dhb-field .cke .cke_top,
#dhSupportRoot #dhbWrite .dhb-field .cke .cke_bottom,
#dhSupportRoot #dhbWrite .dhb-field .cke .cke_contents {
  border-color: var(--dhb-line) !important;
  background: color-mix(in oklab, var(--panel) 92%, transparent) !important;
}

#dhSupportRoot #dhbWrite .dhb-field iframe {
  background: color-mix(in oklab, var(--panel) 92%, transparent);
}

/* "One screen" layout for write page: editor area scrolls */
#dhSupportRoot #dhbWrite {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

#dhSupportRoot #dhbWrite .dhb-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

#dhSupportRoot #dhbWrite .dhb-card {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#dhSupportRoot #dhbWrite .dhb-body {
  flex: 1 1 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#dhSupportRoot #dhbWrite form#fwrite {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#dhSupportRoot #dhbWrite .dhb-write-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#dhSupportRoot #dhbWrite .dhb-field--content {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#dhSupportRoot #dhbWrite .dhb-field--content textarea {
  flex: 1 1 auto;
  min-height: 0 !important;
  height: 100% !important;
  overflow: auto !important;
  resize: none;
}

/* If an editor is enabled, make the editor viewport fill the remaining height */
#dhSupportRoot #dhbWrite .dhb-field--content .cke {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#dhSupportRoot #dhbWrite .dhb-field--content .cke .cke_contents {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

#dhSupportRoot #dhbWrite .dhb-field--content .cke .cke_contents iframe {
  height: 100% !important;
}

/* Footer actions should be right-aligned (inline-flex would shrink-to-fit and stay left) */
.dhb-actions.dhb-actions--footer {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.dhb-actions.dhb-actions--footer .dhb-actions-left,
.dhb-actions.dhb-actions--footer .dhb-actions-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dhb-head-left {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dhb-title {
  font-size: 18px;
  font-weight: 950;
  letter-spacing: -.3px;
  line-height: 1.2;
}

.dhb-sub {
  font-size: 12px;
  color: color-mix(in oklab, var(--dhb-text) 82%, var(--dhb-muted));
  font-weight: 750;
}

.dhb-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.dhb-actions.dhb-actions--right {
  display: flex;
  width: 100%;
  justify-content: flex-end;
}

.dhb-btn {
  height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--dhb-line);
  background: color-mix(in oklab, var(--panel) 92%, transparent);
  color: color-mix(in oklab, var(--dhb-text) 92%, var(--dhb-muted));
  font-weight: 900;
  font-size: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.dhb-btn:hover {
  background: color-mix(in oklab, var(--panel-soft) 70%, transparent);
  color: var(--dhb-text);
}

.dhb-btn.is-primary {
  border-color: color-mix(in oklab, var(--dhb-accent) 70%, var(--dhb-line));
  background: var(--dhb-accent);
  color: #fff;
}

.dhb-btn.is-primary:hover {
  background: color-mix(in oklab, var(--dhb-accent) 88%, #000);
}

.dhb-btn.is-danger {
  /* 테마에서 사용하는 빨간색(포인트 컬러)과 통일 */
  border-color: color-mix(in oklab, var(--dhb-accent) 70%, var(--dhb-line));
  background: var(--dhb-accent);
  color: #fff;
}

.dhb-btn.is-danger:hover {
  background: color-mix(in oklab, var(--dhb-accent) 88%, #000);
  color: #fff;
}

.dhb-btn .material-symbols-outlined {
  font-size: 18px;
  line-height: 1;
}

.dhb-modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999;
}

.dhb-modal-backdrop.is-open {
  display: flex;
}

.dhb-modal-card {
  width: 100%;
  max-width: 480px;
  border-radius: 18px;
  border: 1px solid var(--dhb-line);
  background: color-mix(in oklab, var(--panel) 92%, transparent);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

html[data-theme="light"] .dhb-modal-card {
  box-shadow: 0 24px 60px rgba(16, 19, 27, 0.18);
}

.dhb-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--dhb-line);
}

.dhb-modal-title {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.dhb-modal-close {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--dhb-line);
  background: color-mix(in oklab, var(--panel) 92%, transparent);
  color: var(--dhb-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.dhb-modal-close:hover {
  background: color-mix(in oklab, var(--panel-soft) 70%, transparent);
}

.dhb-modal-body {
  padding: 16px 14px;
  font-size: 14px;
  font-weight: 800;
  color: color-mix(in oklab, var(--dhb-text) 92%, var(--dhb-muted));
}

.dhb-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 14px 14px;
}

.dhb-body {
  padding: 12px 14px 14px;
}

.dhb-cate {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding: 0;
  list-style: none;
}

.dhb-cate li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dhb-cate a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--dhb-line);
  background: color-mix(in oklab, var(--panel) 86%, transparent);
  color: color-mix(in oklab, var(--dhb-text) 90%, var(--dhb-muted));
  font-weight: 850;
  font-size: 12px;
  text-decoration: none;
}

.dhb-cate a#bo_cate_on,
.dhb-cate a:hover {
  border-color: color-mix(in oklab, var(--dhb-accent) 60%, var(--dhb-line));
  background: color-mix(in oklab, var(--dhb-accent) 14%, var(--panel));
  color: var(--dhb-text);
}

.dhb-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--dhb-line);
  border-radius: 14px;
  overflow: hidden;
  background: color-mix(in oklab, var(--panel) 86%, transparent);
}

.dhb-row {
  display: grid;
  grid-template-columns: 72px 1fr 150px 90px 140px;
  gap: 10px;
  align-items: center;
  padding: 12px 12px;
  border-top: 1px solid var(--dhb-line);
}

.dhb-row.has-chk {
  grid-template-columns: 34px 72px 1fr 150px 90px 140px;
}

.dhb-chk input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--dhb-accent);
}

.dhb-row:first-child {
  border-top: 0;
}

.dhb-row--head {
  background: color-mix(in oklab, var(--panel-soft) 52%, transparent);
  color: color-mix(in oklab, var(--dhb-text) 86%, var(--dhb-muted));
  font-size: 12px;
  font-weight: 900;
}

.dhb-row--head .dhb-subject a {
  -webkit-line-clamp: unset;
}

.dhb-row.is-notice {
  background: radial-gradient(900px 260px at 0% 20%, color-mix(in oklab, var(--dhb-accent) 10%, transparent), transparent 55%),
    color-mix(in oklab, var(--panel-soft) 58%, transparent);
}

.dhb-no {
  font-size: 12px;
  font-weight: 900;
  color: color-mix(in oklab, var(--dhb-text) 85%, var(--dhb-muted));
  letter-spacing: -.1px;
}

.dhb-writer,
.dhb-hit,
.dhb-date {
  font-size: 12px;
  font-weight: 850;
  color: color-mix(in oklab, var(--dhb-text) 86%, var(--dhb-muted));
  white-space: nowrap;
}

.dhb-writer,
.dhb-hit {
  overflow: hidden;
  text-overflow: ellipsis;
}

.dhb-hit {
  text-align: right;
}

.dhb-row--head .dhb-hit {
  text-align: right;
}

.dhb-subject-meta {
  display: none;
  margin-top: 6px;
  gap: 10px;
  color: color-mix(in oklab, var(--dhb-text) 78%, var(--dhb-muted));
  font-size: 12px;
  font-weight: 850;
}

.dhb-no .dhb-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--dhb-accent) 85%, #ffffff 15%);
  color: #fff;
  font-weight: 950;
  font-size: 11px;
}

.dhb-subject {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dhb-subject a {
  text-decoration: none;
  font-weight: 900;
  letter-spacing: -.2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dhb-subject a:hover {
  color: color-mix(in oklab, var(--dhb-accent) 70%, var(--dhb-text));
}

.dhb-date {
  text-align: right;
  color: var(--dhb-muted);
  font-size: 12px;
  font-weight: 800;
}

.dhb-empty {
  padding: 22px 14px;
  text-align: center;
  color: var(--dhb-muted);
  font-weight: 800;
}

.dhb-pages {
  margin-top: 14px;
}

.dhb .pg_wrap {
  display: flex;
  justify-content: center;
}

.dhb .pg {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.dhb .pg a,
.dhb .pg strong {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--dhb-line);
  background: color-mix(in oklab, var(--panel) 92%, transparent);
  color: color-mix(in oklab, var(--dhb-text) 90%, var(--dhb-muted));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 900;
  font-size: 12px;
}

.dhb .pg a.pg_start,
.dhb .pg a.pg_end {
  width: 34px;
  padding: 0;
  position: relative;
  overflow: hidden;
  text-indent: -9999px; /* keep original label for copy/paste, hide visually */
}

.dhb .pg a.pg_start::before,
.dhb .pg a.pg_end::before {
  content: "";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: "Material Symbols Outlined";
  font-weight: 400;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  text-indent: 0;
  color: currentColor;
}

.dhb .pg a.pg_start::before { content: "first_page"; }
.dhb .pg a.pg_end::before { content: "last_page"; }

.dhb .pg strong {
  border-color: color-mix(in oklab, var(--dhb-accent) 70%, var(--dhb-line));
  background: color-mix(in oklab, var(--dhb-accent) 14%, var(--panel));
  color: var(--dhb-text);
}

.dhb-search {
  margin: 0 0 12px;
  border: 1px solid var(--dhb-line);
  border-radius: 14px;
  background: color-mix(in oklab, var(--panel-soft) 60%, transparent);
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.dhb-search select,
.dhb-search input {
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--dhb-line);
  background: color-mix(in oklab, var(--panel) 92%, transparent);
  color: var(--dhb-text);
  padding: 0 12px;
  font-weight: 800;
}

.dhb-search select {
  width: 160px;
  min-width: 160px;
  flex: 0 0 auto;
}

.dhb-search input {
  flex: 1 1 auto;
  min-width: 0;
}

.dhb-search .dhb-btn {
  flex: 0 0 auto;
}

.dhb-search input:focus,
.dhb-search select:focus {
  outline: 2px solid color-mix(in oklab, var(--dhb-accent) 30%, transparent);
  outline-offset: 2px;
}

.dhb-view-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 10px;
  color: var(--dhb-muted);
  font-weight: 750;
  font-size: 12px;
}

.dhb-view-body {
  padding: 14px;
  border-top: 1px solid var(--dhb-line);
  line-height: 1.75;
  font-size: 13px;
  color: color-mix(in oklab, var(--dhb-text) 92%, var(--dhb-muted));
}

.dhb-view-body img {
  max-width: 100%;
  height: auto;
}

.dhb-write-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.dhb-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 900;
  color: color-mix(in oklab, var(--dhb-text) 90%, var(--dhb-muted));
}

.dhb-field input[type="text"],
.dhb-field input[type="password"] {
  width: 100%;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--dhb-line);
  background: color-mix(in oklab, var(--panel) 92%, transparent);
  color: var(--dhb-text);
  padding: 0 12px;
  font-weight: 800;
}

.dhb-field textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--dhb-line);
  background: color-mix(in oklab, var(--panel) 92%, transparent);
  color: var(--dhb-text);
  padding: 12px 12px;
  font-weight: 750;
}

@media (max-width: 820px) {
  .dhb-wrap {
    padding: 12px 12px 26px;
  }

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

  .dhb-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .dhb-row {
    grid-template-columns: 70px 1fr;
    grid-template-areas:
      "no title"
      "date date";
  }

  .dhb-row.has-chk {
    grid-template-columns: 34px 70px 1fr;
    grid-template-areas:
      "chk no title"
      "date date date";
  }

  .dhb-chk { grid-area: chk; }
  .dhb-no { grid-area: no; }
  .dhb-writer, .dhb-hit { display: none; }
  .dhb-subject-meta { display: inline-flex; }
  .dhb-subject { grid-area: title; }
  .dhb-date { grid-area: date; text-align: left; }

  .dhb-search {
    flex-wrap: wrap;
  }

  .dhb-search select {
    width: 100%;
    min-width: 0;
  }

  .dhb-search .dhb-btn {
    width: 100%;
  }
}
