@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

:root {
  --bg: #fffbf5;
  --sidebar-bg: #fff3df;
  --border: #f0dcb5;
  --text: #4a3825;
  --muted: #917c64;
  --accent: #f28c22;
  --accent-hover: #e57c15;
  --danger: #e25b4c;
  --pill-bg: #ffdfa3;
  --tag-bg: #ffedc2;
  --leaf: #5b8c5a;
  --leaf-bg: #eef5ec;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

.layout { display: flex; min-height: 100vh; }
.mobile-header { display: none; }

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.account-box { padding-top: 14px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.account-box div { display: flex; flex-direction: column; font-size: 13px; }
.account-box span { color: var(--muted); font-size: 11px; }
.account-box button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; transition: color 0.2s; }
.account-box button:hover { color: var(--danger); }
.account-profile { display: flex; flex-direction: column; min-width: 0; color: inherit; text-decoration: none; font-size: 13px; }
.account-profile strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 700; }
.account-profile:hover strong { color: var(--accent); }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.sidebar-close { display: none; border: 0; background: transparent; font-size: 26px; color: var(--muted); cursor: pointer; }

.brand {
  font-weight: 800;
  font-size: 20px;
  text-decoration: none;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.02em;
}
.brand-icon { width: 28px; height: 34px; object-fit: contain; flex-shrink: 0; }

.search input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
  transition: all 0.2s;
}
.search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(242, 140, 34, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(74, 56, 37, 0.05);
}
.btn:hover { background: #fcfaf5; border-color: #e5cd9e; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 2px 6px rgba(242, 140, 34, 0.2); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-danger { border-color: var(--danger); color: var(--danger); background: #fff; }
.btn-danger:hover { background: #fff5f4; }

.side-section { margin-top: 10px; }
.side-title { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; font-weight: 700; }
.side-title-row { display: flex; align-items: center; justify-content: space-between; }
.icon-btn, .modal-close { border: 0; background: transparent; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; transition: color 0.2s; padding: 4px; border-radius: 4px; }
.icon-btn:hover, .modal-close:hover { color: var(--accent); background: rgba(242, 140, 34, 0.1); }
.side-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 3px; }
.side-list a { text-decoration: none; color: var(--text); font-size: 14px; padding: 6px 10px; border-radius: 6px; display: block; transition: all 0.15s; }
.side-list a.active, .side-list a:hover { background: rgba(242, 140, 34, 0.1); color: var(--accent); font-weight: 600; }
.notebook-row { display: block; }
.notebook-row-main { display: flex; align-items: center; min-width: 0; }
.notebook-row-main > a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 4px; padding-right: 4px; }
.notebook-children { list-style: none; padding: 0 0 0 16px; margin: 0; }
.notebook-children[hidden] { display: none; }
.notebook-toggle, .notebook-toggle-spacer { box-sizing: border-box; flex: 0 0 22px; width: 22px; height: 26px; display: inline-flex; align-items: center; justify-content: center; }
.notebook-toggle { padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: 18px; font-weight: 700; line-height: 1; }
.notebook-toggle:hover { background: rgba(242, 140, 34, 0.12); color: var(--accent); }
.notebook-actions-trigger { flex: 0 0 24px; padding: 2px 4px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; opacity: 0.7; }
.notebook-actions-trigger:hover, .notebook-actions-trigger:focus-visible { opacity: 1; color: var(--accent); background: rgba(242, 140, 34, 0.12); }
.notebook-row .notebook-add { display: inline-flex; align-items: center; justify-content: center; padding: 4px; color: var(--muted); border-radius: 4px; }
.notebook-row .notebook-add:hover { color: var(--accent); background: rgba(242, 140, 34, 0.15); }
.tag-list a { color: var(--text); }
.tag-list a::before { content: ""; margin-right: 2px; }
.sidebar-tools { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.sidebar-import { color: var(--muted); border: 1px dashed var(--border); box-shadow: none; }
.sidebar-import:hover { color: var(--accent); border-color: var(--accent); }

.content { flex: 1; padding: 32px 48px; max-width: 960px; margin: 0 auto; width: 100%; }
.content:has(.note-form) { max-width: none; }

.page-title { font-size: 24px; font-weight: 800; margin-bottom: 24px; letter-spacing: -0.01em; color: var(--text); }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.page-description { margin: -16px 0 24px; color: var(--muted); font-size: 14px; }
.page-heading .page-title { margin-bottom: 0; margin-top: 0; }
.page-heading .page-description { margin: 6px 0 0; }
.editor-page-heading { align-items: center; margin-bottom: 24px; }
.editor-expand-button { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; box-shadow: 0 1px 3px rgba(74,56,37,.06); transition: border-color .15s,background .15s,color .15s; }
.editor-expand-button:hover { border-color: var(--accent); background: #fff8ed; color: var(--accent); }
.editor-expand-button .collapse-icon { display: none; }
.layout.editor-expanded .sidebar { display: none; }
.layout.editor-expanded .content { max-width: none; padding-left: clamp(24px,5vw,80px); padding-right: clamp(24px,5vw,80px); }
.layout.editor-expanded .editor-expand-button .expand-icon { display: none; }
.layout.editor-expanded .editor-expand-button .collapse-icon { display: block; }
.compact-btn { width: auto; white-space: nowrap; padding: 7px 12px; }
.page-title .count { color: var(--muted); font-weight: 500; font-size: 16px; margin-left: 8px; background: rgba(0,0,0,0.04); padding: 2px 8px; border-radius: 12px; }

.note-list-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.sort-actions { display: flex; align-items: center; gap: 12px; }
.sort-form { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 500; }
.sort-button { padding: 7px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600; transition: all 0.2s; }
.sort-button:hover { color: var(--accent); border-color: var(--accent); }
.sort-button.active { color: #fff; background: var(--accent); border-color: var(--accent); }
.sort-form select { min-width: 104px; padding: 7px 30px 7px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); font: inherit; cursor: pointer; font-weight: 500; transition: border-color 0.2s; }
.sort-form select:focus { outline: none; border-color: var(--accent); }
.bulk-move-button { padding: 7px 14px; border: 1px solid var(--accent); border-radius: 8px; background: #fff; color: var(--accent); cursor: pointer; font-size: 13px; font-weight: 700; transition: all 0.2s; }
.bulk-move-button:hover:not(:disabled) { color: #fff; background: var(--accent); }
.bulk-move-button:disabled { border-color: var(--border); color: var(--muted); cursor: default; opacity: 0.6; }
.note-lock-button, .note-lock-setting { padding: 7px 12px; border: 1px solid var(--accent); border-radius: 8px; background: #fff; color: var(--accent); cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; transition: all 0.2s; }
.note-lock-button:hover:not(:disabled), .note-lock-setting:hover { color: #fff; background: var(--accent); }
.note-lock-button:disabled { border-color: var(--border); color: var(--muted); cursor: default; opacity: 0.6; }
.note-unlock-button { padding: 7px 12px; border: 1px solid var(--danger); border-radius: 8px; background: #fff; color: var(--danger); cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; transition: all 0.2s; }
.note-unlock-button:hover:not(:disabled) { background: #fff5f4; }
.note-unlock-button:disabled { border-color: var(--border); color: var(--muted); cursor: default; opacity: 0.6; }
.view-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.view-button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; color: var(--muted); background: #fff; text-decoration: none; font-size: 13px; font-weight: 600; transition: all 0.2s; }
.view-button + .view-button { border-left: 1px solid var(--border); }
.view-button:hover { color: var(--accent); background: rgba(242, 140, 34, 0.05); }
.view-button.active { color: #fff; background: var(--accent); }
.toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; margin-left: auto; gap: 12px; }
.page-size-form { white-space: nowrap; }
.page-size-form select { min-width: 82px; }
.note-lock-fields { margin-top: 20px; }
.note-lock-checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.note-form .note-lock-checkbox input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
#note-lock-password-fields { margin-top: 12px; max-width: 440px; }
.select-all-control { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.select-all-control input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; border-radius: 4px; border: 1px solid var(--border); }
.bulk-delete-button { padding: 7px 12px; border: 1px solid var(--danger); border-radius: 8px; background: #fff; color: var(--danger); cursor: pointer; font-size: 13px; font-weight: 600; transition: all 0.2s; }
.bulk-delete-button:hover:not(:disabled) { background: #fff5f4; }
.bulk-delete-button:disabled { border-color: var(--border); color: var(--muted); cursor: default; opacity: 0.6; }
.bulk-delete-button span { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 4px; border-radius: 10px; background: rgba(226, 91, 76, 0.1); font-size: 11px; }

.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.note-grid.note-list { display: flex; flex-direction: column; gap: 10px; }
.note-list .note-card { display: grid; grid-template-columns: 28px minmax(180px, 1fr) auto; align-items: center; min-height: 0; padding: 14px 18px; }
.note-list .note-card-link { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(130px, auto) 130px; align-items: center; gap: 16px; min-height: 0; }
.note-list .note-card-date { margin-top: 0; text-align: right; }
.note-card { position: relative; border: 1px solid var(--border); border-radius: 14px; padding: 18px; text-decoration: none; color: var(--text); min-height: 120px; background: #fff; box-shadow: 0 2px 6px rgba(74, 56, 37, 0.02); transition: all 0.2s ease; display: flex; flex-direction: column; }
.note-card:hover { border-color: var(--accent); box-shadow: 0 6px 16px rgba(242, 140, 34, 0.1); transform: translateY(-2px); }
.note-card-link { display: flex; flex-direction: column; gap: 10px; min-width: 0; flex: 1; color: inherit; text-decoration: none; }
.note-select-label { position: absolute; top: 16px; left: 16px; z-index: 2; display: grid; place-items: center; width: 22px; height: 22px; }
.note-select { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.note-grid:not(.note-list) .note-card-link { padding-left: 28px; }
.note-card-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.note-card-actions a, .note-card-actions button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; padding: 0; transition: color 0.2s; }
.note-card-actions a:hover { color: var(--accent); }
.note-card-actions button:hover { color: var(--danger); }
.note-list .note-select-label { position: static; }
.note-list .note-card-actions { margin: 0; padding: 0 0 0 16px; border: 0; }
.note-card-title { font-weight: 700; font-size: 16px; line-height: 1.4; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note-card-title-locked { color: var(--muted); }
.note-card-title-locked span { margin-right: 4px; }
.note-card-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.note-card-date { margin-top: auto; font-size: 12px; color: var(--muted); font-weight: 500; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 32px; }
.page-button { min-width: 64px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); text-align: center; text-decoration: none; font-size: 14px; font-weight: 600; transition: all 0.2s; }
.page-button:hover:not(.disabled) { border-color: var(--accent); color: var(--accent); background: rgba(242, 140, 34, 0.05); }
.page-button.disabled { color: var(--muted); opacity: 0.5; cursor: default; background: transparent; }
.page-status { color: var(--muted); font-size: 14px; font-weight: 500; }

.pill { background: var(--pill-bg); border: 1px solid #fae1b1; border-radius: 12px; padding: 3px 10px; font-size: 12px; font-weight: 600; color: #b06511; display: inline-block; }
.pill-tag { background: var(--tag-bg); color: #9c580d; border-color: transparent; }

.note-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.note-header h1 { font-size: 32px; font-weight: 800; margin: 0; line-height: 1.3; letter-spacing: -0.01em; }
.note-actions { display: flex; gap: 8px; flex-shrink: 0; }
.note-actions .btn { display: inline-flex; }
.note-navigation { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 60px; padding-top: 24px; border-top: 1px dashed var(--border); }
.note-navigation-link { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 18px 20px; border: 1px solid #f0dfbd; border-radius: 12px; background: #fffcf8; color: var(--text); text-decoration: none; transition: all 0.2s; box-shadow: 0 2px 8px rgba(74, 56, 37, 0.02); }
.note-navigation-link:hover { border-color: var(--accent); background: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(242, 140, 34, 0.08); }
.note-navigation-link span { color: var(--accent); font-size: 13px; font-weight: 700; }
.note-navigation-link strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.note-navigation-next { text-align: left; }
.note-navigation-previous { text-align: left; align-items: flex-start; }

.note-meta { margin: 0 0 32px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--muted); font-size: 13px; font-weight: 500; margin-left: auto; }
.note-locked-gate { width: min(440px, 100%); margin: clamp(36px, 10vh, 100px) auto; padding: 32px; border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: 0 12px 36px rgba(74, 56, 37, 0.08); text-align: center; }
.note-locked-icon { margin-bottom: 12px; font-size: 32px; }
.note-locked-gate h1 { margin: 0 0 8px; font-size: 24px; }
.note-locked-gate > p { color: var(--muted); font-size: 14px; line-height: 1.6; }
.note-unlock-form { display: flex; flex-direction: column; gap: 12px; margin-top: 22px; text-align: left; }
.note-unlock-form label, .note-relock-card label { font-size: 13px; font-weight: 700; color: var(--muted); }
.note-unlock-form input, .note-relock-card input { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; color: var(--text); }
.note-unlock-form input:focus, .note-relock-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242, 140, 34, 0.15); }
.note-unlock-form .form-actions { justify-content: flex-end; margin-top: 8px; }
.note-lock-error { min-height: 18px; margin: 0; color: var(--danger); font-size: 13px; }
.note-relocked { overflow: hidden; }
.note-relocked .layout { filter: blur(10px); pointer-events: none; user-select: none; }
.note-relock-gate { position: fixed; z-index: 10000; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(24, 20, 16, 0.36); }
.note-relock-card { position: relative; display: flex; flex-direction: column; gap: 13px; width: min(420px, 100%); padding: 30px; border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: 0 18px 64px rgba(24, 20, 16, 0.2); }
.note-relock-card .note-locked-icon, .note-relock-card h2, .note-relock-card > p { margin: 0; text-align: center; }
.note-relock-card h2 { color: var(--text); font-size: 22px; }
.note-relock-card > p:not(.note-lock-error) { color: var(--muted); font-size: 14px; line-height: 1.6; }
.note-relock-card button { width: 100%; margin-top: 4px; }
.note-relock-card .note-relock-close { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 32px; height: 32px; margin: 0; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.note-relock-card .note-relock-close:hover { background: #f3f4f6; color: var(--text); }
.note-relock-gate[hidden], .note-relock-notice[hidden] { display: none; }
.note-relock-notice { position: fixed; z-index: 10000; top: 24px; left: 50%; transform: translateX(-50%); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; width: max-content; max-width: calc(100% - 32px); padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 8px 24px rgba(24, 20, 16, 0.15); }
@media (max-width: 600px) {
  .note-locked-gate { box-sizing: border-box; padding: 24px 18px; }
  .note-relock-card { padding: 24px 18px; }
  .note-list-toolbar { align-items: flex-start; flex-wrap: wrap; }
  .sort-actions, .toolbar-actions { flex-wrap: wrap; }
}

.note-body { line-height: 1.8; font-size: 16px; color: #3a2d21; }
.note-body img { max-width: 100%; border-radius: 12px; border: 1px solid var(--border); }
.note-body table { border-collapse: collapse; width: 100%; margin: 16px 0; }
.note-body table td, .note-body table th { border: 1px solid var(--border); padding: 10px 14px; text-align: left; }
.note-body table th { background: rgba(242, 140, 34, 0.05); font-weight: 700; color: var(--text); }
.note-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.note-body a:hover { color: var(--accent-hover); }

.attachments { margin-top: 40px; border-top: 1px dashed var(--border); padding-top: 20px; }
.attachments ul { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.attachments li a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; background: #fff; text-decoration: none; color: var(--text); font-size: 14px; font-weight: 500; transition: all 0.2s; }
.attachments li a:hover { border-color: var(--accent); color: var(--accent); background: rgba(242, 140, 34, 0.04); }
.attachments li a::before { content: "📎"; color: var(--muted); }

.note-form { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: none; }
.note-form input[type=text], .note-form input[type=file] { padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; background: #fff; color: var(--text); transition: border-color 0.2s; }
.note-form input[type=text]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242, 140, 34, 0.15); }
.note-form select { padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; background: #fff; flex: 1; color: var(--text); cursor: pointer; transition: border-color 0.2s; }
.note-form select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242, 140, 34, 0.15); }
.note-form .title-input { border: 0 !important; border-bottom: 1px dashed var(--border) !important; border-radius: 0; font-size: 36px !important; font-weight: 800; padding: 12px 0 !important; outline: none; background: transparent; letter-spacing: -0.01em; box-shadow: none !important; }
.note-form .title-input:focus { border-bottom-color: var(--accent) !important; }
.form-row { display: flex; gap: 16px; }
.form-row input { flex: 2; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.form-actions .btn { display: inline-flex; }
.autosave-status { align-self: center; margin-left: 12px; color: var(--muted); font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.autosave-status::before { content: ""; display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.autosave-status[data-state="saving"]::before, .autosave-status[data-state="pending"]::before { background: var(--accent); animation: pulse 1s infinite alternate; }
.autosave-status[data-state="saved"]::before { background: var(--leaf); }
.autosave-status[data-state="error"]::before { background: var(--danger); }
@keyframes pulse { from { opacity: 0.5; } to { opacity: 1; } }
.autosave-status[data-state="saving"], .autosave-status[data-state="pending"] { color: var(--accent); }
.autosave-status[data-state="saved"] { color: var(--leaf); }
.autosave-status[data-state="error"] { color: var(--danger); }

.hint { color: var(--text); font-size: 14px; background: #fffcf5; border: 1px solid var(--border); padding: 14px 18px; border-radius: 10px; line-height: 1.6; }
.import-progress { max-width: 860px; margin-top: 24px; padding: 20px; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 4px 12px rgba(74, 56, 37, 0.04); }
.import-progress-header { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; font-size: 15px; }
.import-progress progress { width: 100%; height: 10px; accent-color: var(--accent); border-radius: 5px; overflow: hidden; background: #f0e6d3; }
.import-progress progress::-webkit-progress-bar { background: #f0e6d3; }
.import-progress progress::-webkit-progress-value { background: var(--accent); }
.import-current-file { margin-top: 14px; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; color: var(--text); }
.import-log { margin: 16px 0 0; padding-left: 24px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.import-log li[data-state="active"] { color: var(--accent); font-weight: 500; }
.import-log li[data-state="done"] { color: var(--leaf); }
.import-log li[data-state="error"] { color: var(--danger); }
.import-retry { margin-left: 10px; padding: 4px 12px; font-size: 13px; }

.flash { background: var(--leaf-bg); border: 1px solid var(--leaf); color: #2d4a27; padding: 14px 18px; border-radius: 10px; margin-bottom: 24px; font-size: 14px; font-weight: 500; }

.empty { color: var(--muted); font-size: 16px; text-align: center; padding: 40px 20px; background: #fffcf5; border: 1px dashed var(--border); border-radius: 12px; }

.modal { width: min(420px, calc(100vw - 32px)); border: 0; border-radius: 16px; padding: 0; box-shadow: 0 24px 64px rgba(74, 56, 37, 0.15); background: #fff; }
.modal::backdrop { background: rgba(50, 38, 26, 0.4); backdrop-filter: blur(2px); }
.modal form { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; }
.modal-header h2 { margin: 0; font-size: 20px; font-weight: 800; color: var(--text); }
.modal label { font-size: 13px; font-weight: 700; color: var(--muted); }
.modal input { padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; color: var(--text); }
.modal input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242, 140, 34, 0.15); }
.share-modal { width: min(560px, calc(100vw - 32px)); }
.share-description { margin: 0; color: var(--muted); line-height: 1.6; }
.share-url-row { display: flex; gap: 8px; align-items: stretch; }
.share-url-row input { min-width: 0; flex: 1; background: var(--surface); }
.share-url-row .btn { white-space: nowrap; }
.share-status { min-height: 20px; margin: -6px 0 0; color: var(--muted); font-size: 13px; }
.context-menu { position: fixed; z-index: 20; min-width: 160px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: #fff; box-shadow: 0 10px 32px rgba(74, 56, 37, 0.12); }
.context-menu[hidden] { display: none; }
.context-menu button { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 6px; background: transparent; text-align: left; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--text); transition: background 0.15s; }
.context-menu button:hover { background: #fffcf5; color: var(--accent); }
.context-menu .danger-item { color: var(--danger); }
.context-menu .danger-item:hover { background: #fff5f4; color: var(--danger); }

.editor-shell { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 2px 12px rgba(74, 56, 37, 0.03); }
.editor-toolbar { position: sticky; top: 0; z-index: 2; display: flex; gap: 4px; flex-wrap: wrap; padding: 10px; border-bottom: 1px solid var(--border); background: #fffcf8; }
.editor-toolbar button { border: 1px solid transparent; background: transparent; padding: 6px 10px; border-radius: 6px; cursor: pointer; color: var(--text); font-weight: 500; transition: all 0.15s; }
.editor-toolbar button:hover { border-color: var(--border); background: #fff; color: var(--accent); }
.tool-menu { position: relative; }
.tool-trigger span { color: var(--muted); font-size: 11px; margin-left: 4px; }
.tool-popover { display: none; position: absolute; top: calc(100% + 8px); left: 0; z-index: 10; min-width: 180px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: #fff; box-shadow: 0 12px 36px rgba(74, 56, 37, 0.12); }
.tool-menu.open .tool-popover { display: block; animation: popIn 0.15s ease-out; }
.tool-popover.mobile-tool-popover { display: block; position: fixed; z-index: 120; max-width: calc(100vw - 20px); max-height: calc(100vh - 20px); overflow-y: auto; animation: popIn 0.15s ease-out; }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.tool-menu-wide .tool-popover { min-width: 240px; }
.tool-popover > button { display: flex; flex-direction: column; width: 100%; text-align: left; margin-bottom: 2px; }
.tool-popover small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.tool-divider { height: 1px; margin: 6px 4px; background: var(--border); }
.tool-section-label { padding: 6px 10px 4px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.tool-inline { display: flex; gap: 4px; padding: 2px; }
.tool-inline button { flex: 1; border: 1px solid var(--border); text-align: center; }
.color-tool { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; font-size: 13px; font-weight: 500; border-radius: 6px; cursor: pointer; transition: background 0.15s; }
.color-tool:hover { background: #fffcf5; }
.color-tool input { width: 32px; height: 26px; padding: 0; border: 1px solid var(--border); border-radius: 4px; background: #fff; cursor: pointer; }
.color-trigger { display: inline-flex; align-items: center; gap: 3px; min-width: 42px; }
.color-letter { position: relative; font-weight: 800; }
.color-underline { width: 16px; height: 3px; margin-left: -18px; margin-right: 2px; margin-top: 19px; border-radius: 2px; background: #dc2626; }
.highlight-letter { padding: 0 3px; border-radius: 3px; background: #fef3c7; font-weight: 800; }
.color-popover { width: 284px; min-width: 284px; }
.color-palette { display: grid; grid-template-columns: repeat(5, 32px); gap: 8px; padding: 6px 10px 10px; }
.color-palette.office-main-palette { display: block; padding: 4px; }
.office-main-palette strong { display: block; margin: 11px 0 7px; font-size: 12px; }
.editor-toolbar .office-auto-color { display: flex; align-items: center; width: 100%; height: 34px; gap: 9px; padding: 5px 7px; border-radius: 5px; font-size: 13px; text-align: left; }
.editor-toolbar .office-main-palette .color-swatch { width: 23px; min-width: 23px; height: 23px; padding: 0; border: 1px solid rgba(74,56,37,.16); border-radius: 2px; }
.editor-toolbar .color-swatch,.selection-format-toolbar .color-swatch { width: 30px; height: 30px; padding: 0; border: 1px solid rgba(74,56,37,.2); border-radius: 7px; background: var(--swatch); box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.editor-toolbar .color-swatch:hover,.selection-format-toolbar .color-swatch:hover { transform: scale(1.12); border-color: #4a3825; }
.custom-color-tool { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; padding: 8px 10px; border-top: 1px solid var(--border); font-size: 13px; font-weight: 600; }
.custom-color-tool input { width: 38px; height: 30px; padding: 1px; border: 1px solid var(--border); border-radius: 6px; background: #fff; cursor: pointer; }
.selection-format-toolbar { position: fixed; z-index: 100; display: flex; align-items: center; gap: 3px; max-width: calc(100vw - 24px); padding: 7px; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 14px 42px rgba(42,31,20,.22); }
.selection-format-toolbar[hidden] { display: none; }
.selection-format-toolbar button { flex: 0 0 auto; min-width: 32px; height: 32px; padding: 5px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font-weight: 700; cursor: pointer; }
.selection-format-toolbar button:hover { background: #fff5e8; color: var(--accent); }
.selection-format-toolbar button svg { display: block; width: 17px; height: 17px; margin: auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.selection-format-toolbar .mini-divider { flex: 0 0 auto; width: 1px; height: 24px; margin: 0 3px; background: var(--border); }
.selection-format-toolbar .mini-color-tool { position: relative; display: inline-flex; }
.selection-format-toolbar .mini-color-trigger { display: inline-flex; align-items: center; justify-content: center; gap: 2px; min-width: 39px; padding: 3px 5px; }
.mini-color-icon { position: relative; display: inline-grid; place-items: center; min-width: 17px; height: 22px; font-size: 16px; font-weight: 800; }
.mini-color-icon::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 3px; border-radius: 2px; background: var(--active-color); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.mini-color-arrow { color: var(--muted); font-size: 11px; }
.selection-format-toolbar .office-color-panel { position: fixed; z-index: 110; width: 284px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; box-shadow: 0 16px 42px rgba(42,31,20,.24); color: var(--text); }
.selection-format-toolbar .office-color-panel[hidden] { display: none; }
.office-color-panel strong { display: block; margin: 11px 0 7px; font-size: 12px; }
.selection-format-toolbar .office-auto-color { display: flex; align-items: center; width: 100%; height: 34px; gap: 9px; padding: 5px 7px; border-radius: 5px; font-size: 13px; text-align: left; }
.auto-color-sample { width: 17px; height: 17px; flex: 0 0 auto; border: 1px solid rgba(0,0,0,.2); background: var(--swatch); }
.office-color-mosaic { display: flex; flex-direction: column; gap: 3px; }
.office-color-row,.office-standard-colors { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.selection-format-toolbar .office-color-panel .color-swatch { width: 23px; min-width: 23px; height: 23px; padding: 0; border: 1px solid rgba(74,56,37,.16); border-radius: 2px; background: var(--swatch); box-shadow: inset 0 0 0 1px rgba(255,255,255,.28); }
.selection-format-toolbar .office-color-panel .color-swatch:hover { position: relative; z-index: 1; transform: scale(1.18); border-color: #4a3825; }
.office-custom-color { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 13px; font-weight: 700; }
.office-custom-color input { width: 42px; height: 28px; padding: 1px; border: 1px solid var(--border); border-radius: 5px; background: #fff; cursor: pointer; }
@media (max-width: 600px) {
  .selection-format-toolbar {
    box-sizing: border-box;
    width: calc(100vw - 24px);
    gap: 2px;
    padding: 6px;
    justify-content: center;
  }
  .selection-format-toolbar button {
    min-width: 30px;
    padding: 4px 5px;
  }
  .selection-format-toolbar .mini-divider {
    display: none;
  }
  .selection-format-toolbar .mini-color-trigger {
    min-width: 36px;
    padding: 3px 4px;
  }
}
@media (max-width: 410px) {
  .selection-format-toolbar {
    flex-wrap: wrap;
  }
}
.block-editor { min-height: 480px; padding: 32px 40px 80px; }
.editor-block { position: relative; margin: 6px 0; padding: 6px 8px 6px 36px; border-radius: 8px; transition: background 0.2s; }
.editor-block:hover { background: #fffcf5; }
.editor-block.selected { background: #fff7e8; box-shadow: inset 0 0 0 2px var(--accent); }
.editor-block.dragging { opacity: 0.4; }
.block-handle { position: absolute; left: 6px; top: 10px; color: var(--muted); cursor: grab; user-select: none; opacity: 0; font-size: 16px; transition: opacity 0.2s; }
.block-handle::before { content: "⋮⋮"; letter-spacing: -2px; }
.editor-block:hover .block-handle, .editor-block.selected .block-handle { opacity: 1; }
.block-handle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.block-delete, .block-convert { display: none; position: absolute; top: 8px; z-index: 2; padding: 5px 9px; border-radius: 6px; background: #fff; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.block-delete { right: 8px; border: 1px solid #e5a09a; color: var(--danger); }
.block-convert { right: 58px; border: 1px solid var(--border); color: var(--accent); }
.editor-block.selected .block-delete { display: block; }
.editor-block.selected .block-convert { display: block; }
.block-delete:hover { background: #fff5f4; }
.block-convert:hover { background: #fffcf5; }
.editor-block.selected .block-content { padding-right: 150px; }
.block-content { min-height: 28px; outline: none; line-height: 1.7; color: #3a2d21; }
.block-content:empty::before { content: "입력하세요"; color: #c0b29e; }
.editor-block h1, .editor-block h2, .editor-block h3 { margin: 0; line-height: 1.35; font-weight: 800; letter-spacing: -0.01em; color: var(--text); }
.editor-block h1 { font-size: 32px; }
.editor-block h2 { font-size: 26px; }
.editor-block h3 { font-size: 20px; }
.text-body1 { font-size: 18px; }
.text-body2 { font-size: 16px; }
.text-body3 { font-size: 14px; color: var(--muted); }
.editor-block blockquote { margin: 0; padding-left: 16px; border-left: 4px solid var(--accent); color: #5a4b3a; font-style: italic; background: rgba(242, 140, 34, 0.03); padding-top: 4px; padding-bottom: 4px; border-radius: 0 8px 8px 0; }
.editor-block .text-callout { padding: 16px 20px; border: 0; border-radius: 12px; background: var(--pill-bg); color: #8a4e0a; font-weight: 500; box-shadow: inset 0 0 0 1px #f7ce81; }
.editor-block .text-info { padding: 16px 20px; border: 0; border-radius: 12px; background: var(--leaf-bg); color: #2d4a27; font-weight: 500; box-shadow: inset 0 0 0 1px var(--leaf); }
.editor-block .text-code { padding: 16px 20px; border-radius: 12px; background: #f2efe9; font-family: "SFMono-Regular", Consolas, monospace; white-space: pre-wrap; font-size: 14px; color: #4a3825; box-shadow: inset 0 0 0 1px #e6dccf; }
.editor-block .text-checklist { list-style: none; padding-left: 4px; }
.editor-block .text-checklist input { margin-right: 10px; width: 16px; height: 16px; accent-color: var(--accent); }
.wysiwyg-document .text-checklist, .note-body .text-checklist { list-style: none; padding-left: 4px; }
.wysiwyg-document .text-checklist > li, .note-body .text-checklist > li { margin: 6px 0; }
.wysiwyg-document .text-checklist input, .note-body .text-checklist input { margin-right: 10px; width: 16px; height: 16px; accent-color: var(--accent); vertical-align: middle; }
.note-body .text-checklist input { pointer-events: none; }
.editor-media { max-width: 100%; height: auto; border-radius: 10px; display: block; border: 1px solid var(--border); }
.block-content img { max-width: 100%; height: auto; }
.media-resizer { position: relative; width: min(560px, 100%); max-width: 100%; }
.media-resizer .editor-media { width: 100%; }
.youtube-embed { display: block; width: min(560px, 100%); max-width: 100%; aspect-ratio: 16 / 9; height: auto; border: 1px solid var(--border); border-radius: 10px; background: #17120e; }
.media-resizer .youtube-embed { width: 100%; height: auto; }
.media-resize-handle { position: absolute; right: -6px; bottom: -6px; width: 16px; height: 16px; border: 2px solid #fff; border-radius: 50%; background: var(--accent); box-shadow: 0 1px 5px rgba(74, 56, 37, 0.35); cursor: nwse-resize; touch-action: none; opacity: 0; transition: opacity 0.15s; }
.editor-block:hover .media-resize-handle, .editor-block.selected .media-resize-handle, .media-resizer.resizing .media-resize-handle { opacity: 1; }
.media-caption { color: var(--muted); font-size: 13px; margin-top: 8px; text-align: center; }
.media-text-link { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; color: var(--accent); text-decoration: none; font-weight: 600; background: #fff; transition: all 0.2s; }
.media-text-link:hover { border-color: var(--accent); background: rgba(242, 140, 34, 0.05); }
.media-text-link::before { content: "↗"; font-weight: 800; }
.attachment-tool { margin-left: auto; color: var(--accent); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.attachment-tool::before { content: "📎"; }
.editor-toolbar .dictation-language-label { display: none !important; }
.note-form .dictation-privacy { display: none !important; }
.voice-record-tool { color: #a53a2b; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.voice-record-tool::before { content: "●"; color: #d84b3d; font-size: 11px; }
.voice-record-tool[aria-pressed="true"] { color: #fff; background: #d84b3d; }
.voice-record-tool[aria-pressed="true"]::before { color: #fff; animation: voice-record-pulse 1.2s ease-in-out infinite; }
.voice-record-status { margin: 10px 2px 0; padding: 10px 12px; border-radius: 10px; background: #fff8ed; color: #7b4a15; font-size: 13px; font-weight: 600; }
.voice-record-status[data-state="error"] { background: #fff0ee; color: #a12f24; }
.voice-record-status[data-state="success"] { background: #edf8eb; color: #315f2b; }
.dictation-preview { color: #8a5a22; background: #fff2d9; border-radius: 4px; padding: 0 2px; }
@keyframes voice-record-pulse { 50% { opacity: .35; } }
.file-attachment { display: flex; align-items: center; gap: 14px; max-width: 560px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; color: inherit; text-decoration: none; background: #fff; transition: all 0.2s; box-shadow: 0 2px 4px rgba(74, 56, 37, 0.02); }
.file-attachment:hover { border-color: var(--accent); background: #fffcf5; box-shadow: 0 4px 12px rgba(242, 140, 34, 0.08); transform: translateY(-1px); }
.file-attachment-icon { padding: 10px; border-radius: 8px; background: var(--pill-bg); color: #a86214; font-size: 14px; font-weight: 800; display: grid; place-items: center; }
.file-attachment-info { display: flex; flex: 1; min-width: 0; flex-direction: column; }
.file-attachment-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; color: var(--text); }
.file-attachment-info small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.file-attachment-action { color: var(--accent); font-size: 14px; font-weight: 600; padding-left: 8px; }

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 24px 24px; }
.auth-card { width: min(440px, 100%); padding: 40px; border: 1px solid var(--border); border-radius: 24px; background: #fff; box-shadow: 0 20px 60px rgba(74, 56, 37, 0.08); }
.auth-brand { color: var(--accent); font-weight: 800; font-size: 24px; display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 24px; letter-spacing: -0.02em; }
.auth-logo { width: 44px; height: 58px; object-fit: contain; }
.auth-card h1 { margin: 0 0 10px; font-size: 26px; text-align: center; color: var(--text); font-weight: 800; }
.auth-card > p { margin: 0 0 32px; color: var(--muted); text-align: center; font-size: 15px; }
.auth-card form, .member-form { display: flex; flex-direction: column; gap: 20px; }
.auth-card label, .member-form label { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 700; color: var(--text); }
.auth-card input, .member-form input, .member-form textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-weight: 500; color: var(--text); background: #fff; transition: all 0.2s; }
.member-form select { width: 100%; padding: 12px 40px 12px 14px; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-weight: 500; color: var(--text); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238a7560' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center; appearance: none; -webkit-appearance: none; cursor: pointer; transition: all 0.2s; }
.member-form select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242, 140, 34, 0.15); }
.auth-card input:focus, .member-form input:focus, .member-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242, 140, 34, 0.15); }
.member-form { max-width: 760px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.member-form .checkbox-label { flex-direction: row; align-items: center; cursor: pointer; }
.member-form .checkbox-label input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.member-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 4px 12px rgba(74, 56, 37, 0.03); }
.member-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.member-table th, .member-table td { padding: 16px 20px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.member-table th { color: var(--muted); background: #fffcf5; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.member-table tr:last-child td { border-bottom: 0; }
.member-table td > span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.role-badge { display: inline-block !important; padding: 4px 10px; border-radius: 999px; background: #f2efe9; color: var(--text) !important; font-size: 12px; font-weight: 600; margin-top: 0 !important; }
.role-badge.admin { background: var(--tag-bg); color: #9c580d !important; }
.member-table td:last-child { white-space: nowrap; }
.member-actions { display: flex; align-items: center; gap: 12px; }
.member-actions form { margin: 0; }
.member-actions a, .member-actions button { border: 0; background: transparent; color: var(--muted); cursor: pointer; text-decoration: none; font-size: 14px; font-weight: 600; padding: 0; transition: color 0.2s; }
.member-actions a:hover { color: var(--accent); }
.member-actions button { color: var(--danger); opacity: 0.8; }
.member-actions button:hover { opacity: 1; }
.mypage-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
.mypage-stats a { display: flex; flex-direction: column; gap: 6px; padding: 24px; border: 1px solid var(--border); border-radius: 14px; background: #fff; color: inherit; text-decoration: none; transition: all 0.2s; box-shadow: 0 2px 8px rgba(74, 56, 37, 0.02); }
.mypage-stats a:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(242, 140, 34, 0.1); }
.mypage-stats strong { color: var(--accent); font-size: 32px; font-weight: 800; line-height: 1; }
.mypage-stats span { color: var(--muted); font-size: 14px; font-weight: 600; }

@media (max-width: 720px) {
  body.menu-open { overflow: hidden; }
  .mobile-header { position: sticky; top: 0; z-index: 30; height: 60px; display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; padding: 0 12px; border-bottom: 1px solid var(--border); background: rgba(255,251,245,0.92); backdrop-filter: blur(12px); }
  .mobile-menu-button, .mobile-new-note { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font-size: 24px; text-decoration: none; cursor: pointer; transition: background 0.2s; }
  .mobile-menu-button:active, .mobile-new-note:active { background: rgba(242, 140, 34, 0.1); color: var(--accent); }
  .mobile-brand { color: var(--accent); text-align: center; text-decoration: none; font-weight: 800; font-size: 18px; letter-spacing: -0.01em; }
  .sidebar-overlay { position: fixed; inset: 0; z-index: 39; background: rgba(50, 38, 26, 0.4); backdrop-filter: blur(2px); }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: min(86vw, 320px); padding: 20px; transform: translateX(-105%); transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: 12px 0 40px rgba(74, 56, 37, 0.15); overflow-y: auto; border-right: 0; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .layout { min-height: calc(100vh - 60px); }
  .content { width: 100%; padding: 24px 16px 40px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 20px; }
  .page-title { font-size: 24px; margin-bottom: 0; }
  .compact-btn { align-self: flex-start; }
  .note-navigation { grid-template-columns: 1fr; gap: 12px; margin-top: 40px; }
  .note-navigation-next { text-align: left; }
  .autosave-status { width: 100%; margin: 12px 0 0; }
  .note-header { flex-direction: column; gap: 16px; margin-bottom: 20px; }
  .note-header h1 { font-size: 26px; }
  .note-actions { width: 100%; flex-wrap: wrap; }
  .note-actions .btn { flex: 1; min-width: 80px; }
  .note-grid { grid-template-columns: 1fr; gap: 12px; }
  .view-button span:last-child { display: none; }
  .member-table-wrap { border: 0; overflow: visible; background: transparent; box-shadow: none; }
  .member-table, .member-table tbody { display: block; }
  .member-table thead { display: none; }
  .member-table tr { display: grid; grid-template-columns: 1fr auto; gap: 10px 14px; margin-bottom: 14px; padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: #fff; box-shadow: 0 2px 8px rgba(74, 56, 37, 0.03); }
  .member-table td { display: block; padding: 0; border: 0; }
  .member-table td:nth-child(2), .member-table td:nth-child(4) { grid-column: 1 / -1; }
  .member-table td:nth-child(3) { grid-column: 2; grid-row: 1; justify-self: end; }
  .member-table td:last-child { white-space: normal; grid-column: 1 / -1; padding-top: 12px; border-top: 1px dashed var(--border); margin-top: 4px; }
  .form-grid { grid-template-columns: 1fr; gap: 16px; }
  .mypage-stats { gap: 12px; grid-template-columns: 1fr; }
  .mypage-stats a { padding: 20px 16px; flex-direction: row; align-items: center; justify-content: space-between; }
  .mypage-stats strong { font-size: 26px; }
  .block-editor { padding: 24px 16px 60px; min-height: 360px; }
  .form-row { flex-direction: column; gap: 12px; }
  .editor-toolbar { flex-wrap: nowrap; overflow-x: auto; padding: 8px 12px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .editor-toolbar::-webkit-scrollbar { display: none; }
  .editor-toolbar > * { flex: 0 0 auto; }
  .editor-expand-button { display: none; }
  .layout.editor-expanded .sidebar { display: flex; }
  .layout.editor-expanded .content { padding: 24px 16px 40px; }
}

.block-editor.wysiwyg-document {
  display: block;
  min-height: 620px;
  padding: 28px 34px;
  outline: none;
  line-height: 1.75;
  overflow-wrap: anywhere;
}
.block-editor.wysiwyg-document:empty::before { content: attr(data-empty-text); color: var(--muted); }
.wysiwyg-document p { margin: 0 0 1em; min-height: 1.75em; }
.wysiwyg-document img,.wysiwyg-document video { display:block; max-width:100%; height:auto; margin:18px auto; border-radius:10px; }
.wysiwyg-document iframe { display:block; width:100%; max-width:100%; aspect-ratio:16/9; height:auto; border:0; border-radius:10px; }
.wysiwyg-document audio { width:100%; margin:18px 0; }
.wysiwyg-document .embedded-media { margin:18px 0; }

.wysiwyg-document iframe,.wysiwyg-document .embedded-media iframe { margin-inline:auto; }
.wysiwyg-document video { aspect-ratio:auto 16/9; }
.note-body img,.note-body video,.note-body iframe,.note-body audio { max-width:100%; }
.note-body iframe { display:block; margin-inline:auto; aspect-ratio:16/9; height:auto; border:0; }
.note-body video { display:block; margin-inline:auto; height:auto; aspect-ratio:auto 16/9; }

/* Device control (mypage + device-limit login step) */
.device-panel { max-width: 760px; margin: 0 0 32px; padding: 24px; border: 1px solid var(--border); border-radius: 14px; background: #fff; box-shadow: 0 2px 8px rgba(74, 56, 37, 0.02); }
.device-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.device-panel h2 { margin: 0; font-size: 18px; font-weight: 800; color: var(--text); }
.device-usage { margin: 0; font-weight: 700; color: var(--accent); }
.device-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.device-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--tag-bg); border: 1px solid #fae1b1; color: #b06511; font-size: 13px; font-weight: 700; }
.device-chip svg { width: 16px; height: 16px; }
.device-limit-note { margin: 0 0 14px; padding: 12px 14px; border-radius: 10px; background: #fffcf5; border: 1px solid var(--border); color: var(--text); font-size: 14px; line-height: 1.6; }
.device-limit-note a { color: var(--accent); font-weight: 700; }
.device-error { margin: 0 0 12px; color: var(--danger); font-size: 14px; }
.device-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.device-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: #fffcf8; }
.device-icon { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--pill-bg); color: #b06511; }
.device-icon svg { width: 22px; height: 22px; }
.device-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.device-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--text); font-weight: 800; overflow-wrap: anywhere; }
.device-meta { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.device-badge { padding: 2px 8px; border-radius: 999px; background: var(--leaf-bg); border: 1px solid var(--leaf); color: #2d4a27; font-size: 11px; font-weight: 700; }
.device-actions { flex: none; display: flex; gap: 6px; }
.device-limit-form .device-item { padding: 0; }
.device-pick { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; cursor: pointer; }
.device-pick input { width: 18px; height: 18px; flex: none; accent-color: var(--accent); padding: 0; }
.device-limit-card { width: min(520px, 100%); }
.device-limit-card .auth-card > p, .device-limit-card > p { line-height: 1.6; }
@media (max-width: 560px) {
  .device-panel { padding: 16px; }
  .device-item { flex-wrap: wrap; }
  .device-actions { width: 100%; justify-content: flex-end; }
}
.wysiwyg-editor [data-media-selected]{outline:3px solid #EF9300;outline-offset:3px;border-radius:8px}

.admin-nav { display: flex; flex-direction: column; gap: 8px; }
.admin-section-title { font-size: 18px; margin: 28px 0 10px; }
.admin-section-title:first-of-type { margin-top: 8px; }
.member-id-link { padding: 0; border: 0; background: none; color: var(--accent, #c76b00); font: inherit; cursor: pointer; text-decoration: underline; }
.member-detail-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 12px 0; }
.member-detail-list dt { color: var(--muted); }
.member-detail-list dd { margin: 0; font-weight: 600; }
.member-detail-modal { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; }
.member-detail-body { padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.member-detail-body .form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.member-detail-list { grid-template-columns: minmax(110px, max-content) 1fr; }
.member-detail-list dd { overflow-wrap: anywhere; }
.member-name-link { font-weight: 700; text-decoration: none; color: inherit; display: block; text-align: left; }
.member-name-link:hover { color: var(--accent); text-decoration: underline; }
.social-login { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.social-btn { text-align: center; justify-content: center; }
.social-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.social-divider::before, .social-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.auth-links { text-align: center; margin-top: 14px; }
.auth-secondary { margin-top: 10px; }
.connected-accounts { margin: 24px 0; }
.connected-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
