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

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --ink: #1b2430;
  --muted: #6d7a8c;
  --line: #dbe3ee;
  --primary: #2f86eb;
  --primary-dark: #1d66c2;
  --accent: #f5a524;
  --soft-blue: #e9f2ff;
  --shadow: 0 20px 45px rgba(31, 52, 84, 0.18);
  --guide-card-width: 360px;
  --editor-column-width: 520px;
  --hero-start: #0c5b91;
  --hero-mid: #3976db;
  --hero-end: #7b6bd4;
  --detail-tools-width: 260px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans KR", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}

.public-body {
  background: var(--bg);
}

.public-wrap {
  min-height: 100vh;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 16px;
  padding: 8px;
}

.public-message {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow);
  text-align: center;
}

.public-message h1 {
  margin: 0 0 12px;
  font-size: 20px;
}

.public-message p {
  margin: 0;
  color: var(--muted);
}

.login-body {
  min-height: 100vh;
  background: radial-gradient(circle at 20% 10%, #dff0ff 0%, #f6f9ff 55%),
    linear-gradient(160deg, #f2f7ff 0%, #f9fbff 100%);
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 16px;
}

.login-card {
  width: min(520px, 92vw);
  padding: 64px 48px 48px;
  border-radius: 12px;
  text-align: left;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: lift-in 0.6s ease-out;
}

.brand {
  text-align: center;
  margin: 0 0 28px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 1px;
}

.login-title {
  font-size: 15px;
  color: var(--ink);
  margin: 0 0 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.login-form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field-label {
  font-size: 0;
}

.field input {
  height: 52px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #f9fbff;
  padding: 0 16px;
  color: var(--ink);
  font-size: 15px;
}

.field input::placeholder {
  color: var(--muted);
}

.field-help {
  color: #f06277;
  font-size: 12px;
}

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.forgot {
  color: var(--primary);
  text-decoration: none;
}

.login-btn {
  margin-top: 8px;
  height: 50px;
  border: none;
  border-radius: 4px;
  background: var(--primary);
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  box-shadow: 0 12px 24px rgba(47, 134, 235, 0.25);
  cursor: pointer;
}

.login-btn:hover {
  background: var(--primary-dark);
}

.form-error {
  margin: -4px 0 0;
  font-size: 13px;
  color: #d3415c;
  background: #ffeaf0;
  padding: 8px 12px;
  border-radius: 6px;
}

.form-success {
  margin: -4px 0 0;
  font-size: 13px;
  color: #18794e;
  background: #e9f8f1;
  padding: 8px 12px;
  border-radius: 6px;
}

.demo-cred {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.demo-cred strong {
  color: var(--ink);
  font-weight: 600;
}

.signup {
  display: block;
  margin-top: 18px;
  text-align: right;
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
}

@keyframes lift-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dashboard-body {
  background: linear-gradient(180deg, #f2f6fb 0%, #ffffff 40%, #ffffff 100%);
  min-height: 100vh;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 12px 30px rgba(34, 60, 90, 0.08);
}

.nav-brand {
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 1px;
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
}

.nav-links a.active {
  color: var(--ink);
  position: relative;
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10px;
  height: 2px;
  background: var(--primary);
  border-radius: 999px;
}

.nav-tools {
  display: flex;
  align-items: center;
  gap: 18px;
}

.lang {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
}

.notify {
  color: #ff6a5f;
  font-size: 18px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.user-chip a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.dashboard-main {
  padding: 48px 80px 80px;
}

.page-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.primary-link {
  background: var(--primary);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 10px 20px rgba(47, 134, 235, 0.2);
}

.primary-link:hover {
  background: var(--primary-dark);
}

.guide-new .editor-title {
  margin: 0;
  font-size: 22px;
}

.editor-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.editor-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.link-display {
  font-size: 12px;
  color: var(--muted);
  max-width: 480px;
  word-break: break-all;
}

.link-display a {
  color: var(--primary);
  text-decoration: none;
}

.editor-title {
  outline: none;
}

.editor-meta {
  display: grid;
  gap: 12px;
  position: relative;
}

.editor-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.theme-panel {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 10px;
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 20px 40px rgba(30, 45, 80, 0.2);
  width: 260px;
  display: grid;
  gap: 10px;
  z-index: 10;
}

.theme-panel.hidden {
  display: none;
}

.theme-grid {
  display: grid;
  gap: 8px;
}

.theme-chip {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  padding: 6px;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  text-align: left;
  font-size: 12px;
  color: #1f2937;
}

.theme-swatch {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 24px;
  align-items: start;
}

.editor-canvas {
  background: var(--surface);
  border-radius: 14px;
  padding: 32px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: center;
  gap: 32px;
}

.history-panel {
  position: sticky;
  top: 24px;
  align-self: start;
  display: grid;
  gap: 12px;
  padding: 18px 16px;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  min-height: 420px;
}

.history-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-panel-header strong {
  font-size: 14px;
  color: #1f2933;
}

.history-panel-header span {
  font-size: 12px;
  color: #7b8794;
}

.history-list {
  display: grid;
  gap: 8px;
  align-content: start;
  max-height: calc(100vh - 180px);
  overflow: auto;
}

.history-empty {
  padding: 16px 12px;
  border: 1px dashed #d9e4f5;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.6;
  color: #7b8794;
  background: #f8fbff;
}

.history-item {
  border: 1px solid #d9e4f5;
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
  text-align: left;
  cursor: pointer;
}

.history-item.active {
  border-color: #5aa1ff;
  box-shadow: 0 0 0 2px rgba(90, 161, 255, 0.16);
  background: #eef5ff;
}

.history-item strong {
  font-size: 13px;
  color: #1f2933;
}

.history-item span {
  font-size: 12px;
  color: #6b7280;
}

.editor-canvas.split {
  display: grid;
  grid-template-columns: minmax(0, var(--editor-column-width)) minmax(0, var(--editor-column-width));
  align-items: start;
  justify-content: center;
}

.guide-card {
  width: min(var(--guide-card-width), 100%);
  flex: 0 0 var(--guide-card-width);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e9eef6;
  background: #fff;
  box-shadow: 0 18px 30px rgba(28, 55, 90, 0.12);
}

.guide-hero {
  padding: 20px 0 0;
  color: #ffffff;
  background: linear-gradient(135deg, var(--hero-start) 0%, var(--hero-mid) 50%, var(--hero-end) 100%);
  text-align: center;
}

.hero-line {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}

.guide-title.selected,
.guide-sub.selected {
  box-shadow: 0 0 0 2px rgba(90, 161, 255, 0.4);
  border-radius: 6px;
  padding: 4px 6px;
}

.hero-clear {
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 999px;
  width: 22px;
  height: 22px;
  cursor: pointer;
  font-size: 12px;
}

.cover-blocks {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.cover-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  justify-content: center;
}

.cover-actions .small {
  padding: 6px 10px;
  font-size: 12px;
}

.cover-block {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 8px;
  position: relative;
  touch-action: none;
}

.cover-block.plain {
  background: transparent;
  border: none;
  padding: 4px 0;
}

.cover-block.selected {
  box-shadow: 0 0 0 2px rgba(90, 161, 255, 0.4);
}

.cover-panel {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: var(--editor-column-width);
}

.cover-options {
  display: grid;
  gap: 12px;
  align-content: start;
}

.cover-block-toolbar {
  position: absolute;
  right: 6px;
  top: 6px;
  z-index: 3;
}

.cover-block-delete {
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 6px;
  width: 24px;
  height: 24px;
  cursor: pointer;
}

.cover-block-text {
  color: #fff;
  font-size: 13px;
}

.cover-text-options {
  align-self: flex-start;
  margin-top: 0;
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: #fff;
  color: #1b2430;
  box-shadow: 0 14px 30px rgba(24, 43, 72, 0.15);
  width: 140px;
}

.cover-text-options select,
.cover-image-options select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.cover-image-options {
  align-self: flex-start;
  margin-top: 0;
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: #fff;
  color: #1b2430;
  box-shadow: 0 14px 30px rgba(24, 43, 72, 0.15);
  width: 140px;
}

.cover-image-options.hidden {
  display: none;
}

.cover-text-options strong {
  font-size: 12px;
}

.cover-text-options label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: #4b5563;
}

.cover-text-options select {
  height: 30px;
  border-radius: 8px;
  border: 1px solid #d6deea;
  padding: 0 8px;
}

.cover-block.dragging {
  opacity: 0.6;
}

.cover-block-image {
  min-height: 120px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  cursor: pointer;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  color: #fff;
  transition: height 0.2s ease;
}

.cover-block-image.with-border {
  border: 1px solid rgba(255, 255, 255, 0.6);
  background-color: rgba(255, 255, 255, 0.12);
  padding: 6px;
}

.cover-block-image.cover-full {
  margin: 0;
  border-radius: 0;
}

.cover-block.cover-full {
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 0;
}

.cover-block-image input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.cover-block-image.has-image span {
  display: none;
}
.hero-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.guide-hero h2 {
  margin: 0 0 18px;
  font-size: 20px;
  font-weight: 700;
  text-align: left;
  width: 100%;
  padding: 0 24px;
}

.guide-title {
  font-size: 20px;
  font-weight: 700;
}

.guide-sub {
  margin-top: 10px;
  font-size: 14px;
  opacity: 0.9;
}

.guide-body {
  padding: 32px 24px;
  display: grid;
  gap: 16px;
  min-height: 320px;
  position: relative;
}

.hidden {
  display: none !important;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid #e6edf7;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  min-height: 220px;
}

.content-tile {
  position: relative;
  border: none;
  height: 120px;
  border-right: 1px solid #eef2f7;
  border-bottom: 1px solid #eef2f7;
  display: block;
  font-weight: 600;
  color: #415365;
  background: #ffffff;
  cursor: pointer;
}

.content-tile-body {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 12px 10px;
}

.content-tile:hover {
  background: #f6f9ff;
}

.content-tile.active {
  background: #eef5ff;
  box-shadow: inset 0 0 0 2px #5aa1ff;
}

.content-tile.dragging {
  opacity: 0.5;
  background: #e7f0ff;
}

.content-tile:nth-child(3n) {
  border-right: none;
}

.content-tile-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border: 1px solid #d8e2ee;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
  color: #7b8794;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 1;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease,
    border-color 0.2s ease;
}

.content-tile-delete:hover {
  background: #ffffff;
  color: #dc2626;
  border-color: #f0b4b4;
  transform: scale(1.06);
  box-shadow: 0 3px 10px rgba(220, 38, 38, 0.14);
}

.tile-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #e7f1ff;
  color: #4a90e2;
  display: grid;
  place-items: center;
  font-size: 22px;
}

.plus-btn {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  border: none;
  background: #f1f6ff;
  color: #2c7be5;
  font-size: 32px;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px #d7e6ff;
  cursor: pointer;
  justify-self: center;
}

.guide-footer {
  padding: 18px 24px;
  background: #f4f4f4;
  text-align: center;
  display: grid;
  gap: 6px;
  color: #4a5568;
}

.guide-footer strong {
  color: #1f2933;
}

.guide-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: 20px;
  row-gap: 0;
  width: min(var(--guide-card-width), 100%);
}

.detail-tools {
  display: none;
}

@media (min-width: 900px) {
  .guide-detail {
    grid-template-columns: var(--guide-card-width) var(--detail-tools-width);
    width: min(var(--guide-card-width), 100%);
  }

  .detail-tools {
    display: grid;
  }
}

.detail-hero {
  grid-column: 1 / 2;
  height: 70px;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(135deg, var(--hero-start) 0%, var(--hero-mid) 50%, var(--hero-end) 100%);
  display: grid;
  align-items: center;
  width: 100%;
  margin: 0;
}

.detail-header {
  margin: 0;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.4px;
  width: 100%;
  padding: 0 24px;
  text-align: left;
}

.detail-body {
  background: #ffffff;
  border-radius: 0 0 14px 14px;
  padding: 24px;
  box-shadow: var(--shadow);
  width: 100%;
  margin: 0;
  grid-column: 1 / 2;
}

.detail-body h3 {
  margin: 0 0 16px;
  font-size: 20px;
}

.detail-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.detail-nav-item {
  border: 1px solid #d9e4f5;
  background: #fff;
  color: #2b3b52;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.detail-nav-item.active {
  border-color: #5aa1ff;
  box-shadow: 0 0 0 2px rgba(90, 161, 255, 0.2);
}

.detail-nav-icon {
  font-size: 14px;
}

.detail-tools {
  grid-column: 2 / 3;
  align-self: start;
}

.detail-photo {
  height: 220px;
  border-radius: 10px;
  background: linear-gradient(140deg, #dff1ff, #a7ccff);
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background-size: cover;
  background-position: center;
}

.detail-photo span {
  opacity: 0;
  transition: opacity 0.2s ease;
  color: #3f4a5a;
  font-weight: 600;
}

.detail-photo:hover span {
  opacity: 1;
}

.detail-photo input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.detail-photo.has-image span {
  display: none;
}

.detail-body p {
  margin: 0 0 18px;
  line-height: 1.6;
  color: #4a5568;
  font-size: 14px;
  white-space: pre-line;
}

.detail-blocks {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.detail-block {
  background: #fff;
  border: 0 solid #e2e8f0;
  border-radius: 10px;
  padding: 0px;
}

.detail-block.selected {
  border-color: #5aa1ff;
  box-shadow: 0 0 0 2px rgba(90, 161, 255, 0.3);
}

.detail-block.dragging {
  opacity: 0.6;
}

.block-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.detail-block .block-toolbar {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  height: 0;
  margin-bottom: 0;
  overflow: hidden;
}

.detail-block.selected .block-toolbar {
  opacity: 1;
  pointer-events: auto;
  height: auto;
  margin-bottom: 8px;
}

.block-toolbar button {
  border: 1px solid #d6deea;
  background: #fff;
  border-radius: 8px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 14px;
}

.block-toolbar select {
  border: 1px solid #d6deea;
  border-radius: 8px;
  height: 30px;
  padding: 0 8px;
  font-size: 12px;
  color: #4b5563;
}

.block-image input[type="file"] {
  font-size: 12px;
  margin-bottom: 6px;
}

.block-image img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  cursor: zoom-in;
}
.block-content {
  display: grid;
  gap: 8px;
}

.block-text {
  min-height: 60px;
  font-size: 14px;
  color: #44546a;
}

.block-title {
  font-size: 18px;
  font-weight: 700;
  color: #1f2933;
}

.block-list {
  margin: 0;
  padding-left: 18px;
  color: #44546a;
}

.block-image,
.block-video,
.block-map {
  min-height: 140px;
  border-radius: 0;
  background: transparent;
  color: #6b7280;
  display: grid;
  place-items: center;
  font-size: 13px;
  overflow: hidden;
}

.block-button {
  border: 1px solid #c7d3e6;
  border-radius: 10px;
  padding: 10px 18px;
  background: #f8fbff;
  color: #1f2933;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  width: 100%;
}

.block-video input,
.block-map input {
  width: 100%;
  border: 1px solid #d7dee9;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  color: #4b5563;
}

.video-frame,
.map-frame {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
}

.video-frame iframe,
.map-frame iframe {
  width: 100%;
  height: 220px;
  border: 0;
}

.block-spacer {
  width: 100%;
}

.detail-block[data-image-fit="cover"] .block-image img {
  height: 180px;
  object-fit: cover;
}

.detail-block[data-image-border="true"] .block-image {
  border: 1px solid #d6deea;
  border-radius: 12px;
  padding: 8px;
  background: #fff;
}

.detail-photo.has-image {
  cursor: zoom-in;
}

.image-lightbox-panel {
  width: min(980px, 96vw);
  max-height: 94vh;
  padding: 12px;
  background: rgba(255, 255, 255, 0.98);
}

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

.image-lightbox-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.image-lightbox-controls button {
  min-width: 36px;
  height: 36px;
  border: 1px solid #d8e2ee;
  border-radius: 10px;
  background: #fff;
  color: #475569;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.image-lightbox-controls .ghost {
  min-width: 64px;
  font-size: 13px;
}

.image-lightbox-tip {
  margin: 0;
  font-size: 12px;
  color: #64748b;
}

.image-lightbox-body {
  position: relative;
  display: grid;
  place-items: center;
  height: min(82vh, 820px);
  overflow: hidden;
  border-radius: 12px;
  background: #f8fafc;
  touch-action: none;
}

.image-lightbox-body img {
  display: block;
  max-width: min(100%, 1000px);
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
}

.image-lightbox-body.is-draggable img {
  cursor: grab;
}

.image-lightbox-body.is-dragging img {
  cursor: grabbing;
}

@media (max-width: 560px) {
  .image-lightbox-panel {
    width: 100vw;
    max-width: 100vw;
    max-height: 100dvh;
    min-height: 100dvh;
    border-radius: 0;
    padding: 10px;
  }

  .image-lightbox-header {
    gap: 8px;
    margin-bottom: 6px;
  }

  .image-lightbox-controls {
    gap: 6px;
  }

  .image-lightbox-controls button {
    min-width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: 17px;
  }

  .image-lightbox-controls .ghost {
    min-width: 60px;
    font-size: 12px;
  }

  .image-lightbox-tip {
    font-size: 11px;
    line-height: 1.4;
    margin-bottom: 6px;
  }

  .image-lightbox-body {
    height: calc(100dvh - 108px);
    border-radius: 10px;
  }

  .image-lightbox-body img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 10px;
  }
}

.block-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.block-table th,
.block-table td {
  border: 1px solid #d7dee9;
  padding: 8px;
  text-align: left;
}

.block-table th {
  background: #eef3f9;
}

.detail-footer {
  background: #f4f4f4;
  padding: 18px 24px;
  margin: 16px -24px -24px;
  border-radius: 0 0 14px 14px;
  text-align: center;
  display: grid;
  gap: 6px;
  color: #4a5568;
}

.detail-footer strong {
  color: #1f2933;
}

.detail-footer.footer-locked [data-footer-type] {
  pointer-events: none;
}

.detail-tools {
  display: grid;
  align-content: start;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  position: sticky;
  top: 40px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 12px;
  grid-template-columns: 66px 1fr;
  align-items: start;
}

.detail-tools .block-options {
  min-width: 0;
}

.tool-buttons {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.tool-buttons span {
  font-size: 11px;
  color: var(--muted);
}

.block-options {
  margin-top: 12px;
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid #e5ecf6;
  width: 100%;
}

.text-options,
.table-options,
.spacer-options,
.button-options {
  display: grid;
  gap: 10px;
}

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

.table-options .table-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.table-options #applyTable {
  width: auto;
  height: 32px;
  border-radius: 6px;
}

.photo-options {
  display: grid;
  gap: 10px;
}

.photo-options.hidden {
  display: none;
}

.photo-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.photo-toggle span {
  white-space: nowrap;
}

.photo-toggle input[type="checkbox"] {
  margin: 0;
}

.block-options label {
  display: grid;
  gap: 6px;
  font-size: 12px;
}

.block-options label.photo-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
}

.block-options select,
.block-options input[type="color"],
.block-options input[type="number"],
.block-options input[type="text"] {
  height: 32px;
  border: 1px solid #d6deea;
  border-radius: 8px;
  padding: 0 8px;
  background: #fff;
  width: 100%;
}

.detail-tools button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  cursor: pointer;
}

.confirm-panel {
  max-width: 520px;
}

.confirm-panel p {
  margin: 0 0 18px;
  line-height: 1.6;
  color: #333;
}

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

.confirm-actions .primary,
.confirm-actions .ghost {
  min-width: 88px;
  height: 40px;
  border-radius: 10px;
  font-weight: 600;
}

.confirm-actions .primary {
  border: none;
  background: #ef4444;
  color: #fff;
}

.confirm-actions .primary:disabled {
  opacity: 0.65;
  cursor: default;
}

.confirm-actions .ghost {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #6b7280;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal.show {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 20, 40, 0.55);
}

.modal-panel {
  position: relative;
  width: min(520px, 92vw);
  max-height: 80vh;
  overflow: auto;
  background: #ffffff;
  border-radius: 16px;
  padding: 28px 26px;
  box-shadow: 0 30px 60px rgba(15, 30, 60, 0.25);
  animation: lift-in 0.35s ease-out;
}

.preview-panel {
  width: min(900px, 96vw);
  padding: 20px;
}

.link-panel {
  width: min(560px, 92vw);
}

.link-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.link-row input {
  height: 40px;
  border: 1px solid #d6deea;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 13px;
  color: #374151;
  background: #f8fafc;
}

.link-status {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
}

.link-expire {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  color: #6b7280;
}

.link-expire select {
  height: 32px;
  border: 1px solid #d6deea;
  border-radius: 8px;
  padding: 0 8px;
  background: #fff;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.preview-actions {
  position: absolute;
  right: 12px;
  top: 12px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  z-index: 2;
}

.preview-hero-title {
  color: #ffffff;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
}

.preview-body {
  display: grid;
  gap: 20px;
  justify-items: center;
  place-items: center;
  padding: 10px;
  background: #f4f6fb;
  border-radius: 12px;
}

.preview-mobile {
  grid-template-columns: minmax(0, 1fr);
  width: auto;
  max-width: 360px;
}

.preview-mobile .detail-tools {
  display: none;
}

.preview-body .content-tile-delete {
  display: none !important;
}

.modal-panel h3 {
  text-align: center;
  margin: 0 0 18px;
  font-size: 18px;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.modal-grid button {
  height: 72px;
  border: 1px solid #e2e8f0;
  background: #f9fbff;
  border-radius: 12px;
  font-weight: 600;
  color: #4b5563;
  cursor: pointer;
}

.modal-actions {
  display: grid;
  gap: 12px;
}

.modal-actions .primary {
  background: #6db6ff;
  color: #fff;
  border: none;
  height: 44px;
  border-radius: 10px;
  font-weight: 600;
}

.modal-actions .ghost {
  border: 1px solid #cbd5e1;
  background: transparent;
  height: 44px;
  border-radius: 10px;
  font-weight: 600;
  color: #6b7280;
}

.page-title h1 {
  margin: 0 0 14px;
  font-size: 24px;
}

.title-line {
  height: 1px;
  background: var(--line);
  margin-bottom: 28px;
}

.board-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.search-field {
  flex: 1;
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.search-field input {
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0 14px;
  background: #fbfcff;
}

.select-field select {
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 0 36px 0 14px;
  background: var(--surface);
  font-size: 13px;
  color: var(--muted);
}

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

.board-table {
  margin-top: 24px;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.board-head,
.board-row {
  display: grid;
  grid-template-columns: 48px 70px minmax(220px, 2fr) 170px 1fr 1fr 70px 1.4fr 90px 160px 80px 70px 90px;
  align-items: start;
  column-gap: 12px;
  padding: 16px 24px;
}

.admin-guides .board-head,
.admin-guides .board-row {
  grid-template-columns: 48px 70px 220px minmax(220px, 2fr) 170px 1fr 1fr 70px 1.4fr 90px 160px 80px 70px 90px;
}

.board-head {
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.board-row {
  border-top: 1px solid var(--line);
  font-size: 14px;
  cursor: pointer;
}

.board-row:hover {
  background: #f7faff;
}

.users-table .board-head,
.users-table .board-row {
  grid-template-columns: 70px minmax(220px, 2fr) 140px 120px 1fr 200px 90px 90px;
}

.users-table .board-row {
  cursor: default;
}

.users-table select,
.users-table input[type="password"] {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
}

.users-table .ghost {
  padding: 6px 10px;
  font-size: 12px;
}

.row-index {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.row-select {
  display: flex;
  align-items: center;
  justify-content: center;
}

.row-select input {
  width: 16px;
  height: 16px;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #d5dbe5;
}

.status-dot.active {
  background: #31c26f;
}

.row-title {
  font-weight: 600;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.row-link {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.row-link:hover {
  color: var(--primary);
}

.row-share a {
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  word-break: break-all;
}

.row-preview img {
  width: 150px;
  height: 150px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid var(--line);
  display: block;
}

.row-preview-placeholder {
  width: 150px;
  height: 150px;
  border-radius: 16px;
  background: #f1f5f9;
  border: 1px dashed #d6deea;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.copy-link {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #d6deea;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}

.status-badge.status-active {
  color: #0f7b3a;
  background: #e6f6ee;
  border-color: #b7e6cc;
}

.status-badge.status-inactive {
  color: #5b677a;
  background: #eef2f7;
  border-color: #d3dbe6;
}

.status-badge.status-expired {
  color: #b54216;
  background: #ffe9df;
  border-color: #ffc7b4;
}

.share-expire-field {
  display: flex;
  align-items: center;
  gap: 6px;
}

.share-expire-input {
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid #d6deea;
  font-size: 12px;
  background: #fff;
  min-width: 120px;
}

.row-share-regenerate .ghost,
.row-share-expire .ghost {
  padding: 6px 10px;
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #111827;
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 999;
}

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

.toast.success {
  background: #0f7b3a;
}

.toast.error {
  background: #b42318;
}

.toast.warn {
  background: #b54708;
}

.row-company {
  color: var(--muted);
  font-size: 13px;
}

.row-date {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.row-date strong {
  font-size: 13px;
  color: var(--ink);
}

.row-views {
  font-weight: 600;
  text-align: right;
}

.board-empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  padding: 28px 32px;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 24px;
}

.hero p {
  margin: 0;
  color: var(--muted);
}

.ghost {
  border: 1px solid var(--line);
  background: #f7faff;
  padding: 10px 18px;
  border-radius: 10px;
  color: var(--primary);
  font-weight: 600;
}

.search-row {
  margin-top: 28px;
}

.search-row label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.search-row input {
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0 14px;
  background: #fbfcff;
}

.card-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.card {
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: fade-up 0.7s ease-out both;
}

.card:nth-child(2) {
  animation-delay: 0.1s;
}

.card:nth-child(3) {
  animation-delay: 0.2s;
}

.card-hero {
  height: 160px;
  background: #eef1f6;
}

.card.placeholder .card-hero {
  background: linear-gradient(120deg, #f1f1f1, #e2e6ee);
}

.card-body {
  padding: 16px 18px 20px;
}

.icon-row {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.3;
}

.card time {
  font-size: 12px;
  color: var(--muted);
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 560px) {
  .login-card {
    padding: 48px 28px 36px;
  }

  .top-nav {
    flex-direction: column;
    gap: 14px;
    padding: 18px 20px;
  }

  .nav-links {
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .dashboard-main {
    padding: 28px 20px 60px;
  }

  .hero {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

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

  .editor-layout {
    grid-template-columns: 1fr;
  }

  .history-panel {
    position: static;
    min-height: 0;
  }

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

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

  .guide-detail {
    grid-template-columns: 1fr;
  }

  .detail-tools {
    grid-auto-flow: column;
    grid-auto-columns: 44px;
    overflow-x: auto;
    padding-bottom: 8px;
  }

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

  .board-head,
  .board-row {
    grid-template-columns: 40px 60px 1fr;
    row-gap: 8px;
  }

  .board-head span:nth-child(n + 4),
  .board-row div:nth-child(n + 4) {
    display: none;
  }
}

.public-body .content-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
