/* =============================================================================
   memo · memo.css — packages/ui-terminal/theme.css 의 네온 그린 터미널 토큰을 이 앱용으로 복사·축약
   레이아웃: 상단 바(브랜드 1회 · 상태 · 🌐) → 앱(목록 | 편집기) → 정적 SEO 본문 → 푸터
   반응형: 760px 이하 = 한 화면에 하나(목록 ↔ 편집기, #root[data-view])
   ========================================================================== */
:root {
  --neon: #00ff9c;
  --bg: #05080a;
  --bg-soft: #0a1014;
  --panel: rgba(10, 18, 22, 0.78);
  --panel-solid: #071014;
  --line: rgba(0, 255, 156, 0.18);
  --line-soft: rgba(255, 255, 255, 0.06);
  --text: #c8ffe6;
  --dim: #6f9c8d;
  --ok: #00ff9c;
  --warn: #ffb000;
  --crit: #ff3b5c;
  --cyan: #6fd0ff;
  --radius: 6px;
  /* 한글·가나·한자·태국 문자는 일반 monospace(굴림체 등 넓은 고정폭) 대신 각 OS 의 산세리프로 떨어지게 — monospace 앞에 둔다 */
  --font: 'JetBrains Mono', ui-monospace, 'Share Tech Mono', Menlo, Consolas, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Hiragino Sans', 'Yu Gothic UI', 'Meiryo', 'PingFang SC', 'Microsoft YaHei', 'Microsoft JhengHei', 'Leelawadee UI', 'Noto Sans CJK KR', 'Noto Sans', monospace;
  --ed-font: 'JetBrains Mono', ui-monospace, Menlo, Consolas, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Hiragino Sans', 'Yu Gothic', 'Microsoft YaHei', 'PingFang SC', 'Noto Sans', sans-serif;
  --nav-h: 52px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: radial-gradient(1200px 800px at 70% -10%, #0c1a18 0%, var(--bg) 55%) fixed, var(--bg);
  color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: var(--neon); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--neon); color: #04110c; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }
button, input, select, textarea { font-family: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ===== 상단 바 ===== */
.topnav {
  position: sticky; top: 0; z-index: 20; height: var(--nav-h);
  display: flex; align-items: center; gap: 12px; padding: 0 18px;
  background: rgba(5, 8, 10, 0.86); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--neon); font-weight: 800; font-size: 15px; letter-spacing: 1.5px; white-space: nowrap; flex-shrink: 0; text-shadow: 0 0 12px rgba(0,255,156,.35); }
.brand:hover { text-decoration: none; }
.brand img { width: 22px; height: 22px; display: block; }
.brand-sub { margin: 0; display: inline; line-height: inherit; color: var(--text); font-weight: 600; font-size: 12.5px; letter-spacing: 0; text-shadow: none; opacity: .9; }
.brand-sub::before { content: '·'; margin: 0 7px 0 1px; color: var(--dim); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.status {
  display: inline-flex; align-items: center; gap: 7px; min-width: 0; max-width: 340px;
  font-size: 11.5px; letter-spacing: .3px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); color: var(--ok);
}
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; flex-shrink: 0; }
.status .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status.warn { color: var(--warn); }
.status.crit { color: var(--crit); }
.status.sync { color: var(--cyan); }
.status.sync .dot { animation: pulse 1.1s infinite; }
@keyframes pulse { 50% { opacity: .3; transform: scale(.75); } }
.lang-select { display: inline-flex; align-items: center; gap: 6px; color: var(--dim); border: 1px solid var(--line); border-radius: 4px; padding: 5px 8px 5px 10px; background: var(--panel); cursor: pointer; flex-shrink: 0; }
.lang-select:hover { color: var(--text); border-color: var(--neon); }
.lang-select .globe { font-size: 13px; line-height: 1; }
.lang-select select { appearance: none; -webkit-appearance: none; background: transparent; border: 0; color: inherit; font-size: 11.5px; cursor: pointer; padding: 0 14px 0 0; outline: none; max-width: 120px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: right 4px center, right 0 center; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; }
.lang-select select option { background: var(--bg-soft); color: var(--text); }
.lang-select:focus-within { outline: 1px solid var(--neon); outline-offset: 2px; }

/* ===== 버튼 ===== */
.btn {
  font-size: 12px; letter-spacing: .3px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 12px; min-height: 34px; color: var(--neon); background: transparent; border: 1px solid var(--neon); border-radius: 5px; transition: background .15s, color .15s, border-color .15s; white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--neon); color: #04110c; }
.btn:focus-visible, .item:focus-visible { outline: 2px solid var(--neon); outline-offset: 2px; }
.btn.ghost { color: var(--text); border-color: var(--line); }
.btn.ghost:hover:not(:disabled) { color: var(--neon); border-color: var(--neon); background: rgba(0,255,156,.07); }
.btn.solid { background: var(--neon); color: #04110c; font-weight: 700; }
.btn.solid:hover:not(:disabled) { background: #5dffbe; }
.btn.danger:hover:not(:disabled) { color: var(--crit); border-color: var(--crit); background: rgba(255,59,92,.08); }
.btn[aria-pressed="true"] { color: #04110c; background: var(--warn); border-color: var(--warn); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn .ico { font-size: 13px; line-height: 1; }

/* ===== 앱 ===== */
.app {
  position: relative; z-index: 2; max-width: 1280px; margin: 0 auto; padding: 14px 16px 18px;
  display: grid; grid-template-columns: minmax(250px, 320px) minmax(0, 1fr); gap: 14px;
  height: calc(100vh - var(--nav-h)); height: calc(100dvh - var(--nav-h)); min-height: 520px;
}
.pane { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.corner { position: absolute; width: 10px; height: 10px; border: 2px solid var(--neon); opacity: .7; pointer-events: none; }
.corner.tl { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.corner.br { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

/* 목록 */
.side-top { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px; }
.side-top .btn.solid { flex: 1 1 auto; }
.count { font-size: 11px; color: var(--dim); white-space: nowrap; }
.side-tools { display: flex; gap: 6px; padding: 0 12px 10px; border-bottom: 1px solid var(--line); }
.search { flex: 1 1 0; min-width: 96px; width: 0; font-size: 12.5px; color: var(--text); background: var(--bg-soft); border: 1px solid var(--line); border-radius: 4px; padding: 7px 9px; outline: none; }
.search:focus { border-color: var(--neon); }
.search::placeholder { color: var(--dim); }
.sort { flex: 0 1 auto; min-width: 0; max-width: 54%; font-size: 11.5px; color: var(--text); background: var(--bg-soft); border: 1px solid var(--line); border-radius: 4px; padding: 6px 4px; outline: none; cursor: pointer; }
.sort:focus { border-color: var(--neon); }
.list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1 1 auto; min-height: 60px; }
.list li { margin: 0 0 4px; }
.item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; width: 100%; text-align: left; cursor: pointer;
  padding: 9px 10px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--text); font-size: 13px;
}
.item:hover { border-color: var(--line); background: rgba(0,255,156,.04); }
.item.active { border-color: rgba(0,255,156,.5); background: rgba(0,255,156,.09); box-shadow: inset 2px 0 0 var(--neon); }
.it-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.it-title.untitled { color: var(--dim); font-weight: 500; font-style: italic; }
.it-time { font-size: 10.5px; color: var(--dim); white-space: nowrap; align-self: center; }
.it-snip { grid-column: 1 / -1; font-size: 11.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 1em; }
.it-pin { margin-right: 4px; }
.it-tag { color: var(--warn); font-weight: 600; margin-right: 5px; font-size: 11px; }
.list-empty { padding: 18px 16px; color: var(--dim); font-size: 12.5px; line-height: 1.6; }
.list-empty strong { display: block; color: var(--text); font-size: 13px; margin-bottom: 4px; }

/* 저장 위치 · 동기화 · 가져오기/백업 */
.store-box { margin-top: auto; border-top: 1px solid var(--line); padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; font-size: 11.5px; line-height: 1.55; }
.where { margin: 0; color: var(--text); }
.where b { color: var(--neon); font-weight: 700; margin-right: 4px; }
.sync-row, .io-row { display: flex; flex-wrap: wrap; gap: 6px; }
.sync-row .btn, .io-row .btn { flex: 1 1 auto; padding: 7px 9px; min-height: 32px; font-size: 11.5px; }
.sync-note { margin: 0; color: var(--dim); font-size: 10.5px; }

/* 편집기 */
.ed-bar { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-bottom: 1px solid var(--line); min-height: 52px; }
.ed-title { flex: 1 1 auto; min-width: 0; font-size: 13px; font-weight: 700; color: var(--neon); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-actions { display: flex; gap: 6px; flex-shrink: 0; }
.ed-actions .btn { padding: 6px 9px; min-height: 32px; font-size: 11.5px; }
.back { display: none; }
.ed-ta {
  flex: 1 1 auto; min-height: 0; width: 100%; resize: none; border: 0; outline: none; margin: 0;
  padding: 16px 18px; background: transparent; color: var(--text); caret-color: var(--neon);
  font-family: var(--ed-font); font-size: 15px; line-height: 1.7; tab-size: 4; white-space: pre-wrap; overflow-wrap: anywhere;
}
.ed-ta::placeholder { color: var(--dim); }
.ed-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 7px 12px; border-top: 1px solid var(--line); font-size: 11px; color: var(--dim); }
.ed-foot .kbd { margin-left: auto; }
.ed-empty { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 28px; text-align: center; }
.ed-empty .big { font-size: 40px; color: var(--neon); text-shadow: 0 0 18px rgba(0,255,156,.45); line-height: 1; }
.ed-empty h2 { margin: 0; font-size: 16px; color: var(--text); }
.ed-empty p { margin: 0; max-width: 440px; color: var(--dim); font-size: 12.5px; line-height: 1.7; }

/* 토스트 */
.toast {
  position: fixed; left: 50%; bottom: 22px; z-index: 50; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px); padding: 10px 14px;
  background: var(--panel-solid); border: 1px solid var(--neon); border-radius: 6px; box-shadow: 0 0 24px -6px var(--neon);
  color: var(--text); font-size: 12.5px; line-height: 1.5; transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast .btn { padding: 5px 10px; min-height: 28px; font-size: 11.5px; }

/* ===== 정적 SEO 본문 (#root 바깥) ===== */
.seo { position: relative; z-index: 2; max-width: 900px; margin: 0 auto; padding: 34px 20px 36px; color: var(--dim); font-size: 13.5px; line-height: 1.8; }
.seo h2 { color: var(--neon); font-size: 18px; margin: 0 0 10px; }
.seo h3 { color: var(--text); font-size: 14.5px; margin: 24px 0 8px; }
.seo ol { margin: 8px 0; padding-left: 22px; }
.seo li { margin: 4px 0; }
.seo .faq h4 { color: var(--text); font-size: 13.5px; margin: 14px 0 3px; }
.seo .faq p { margin: 0; }

/* ===== 푸터 ===== */
.site-foot { position: relative; z-index: 2; padding: 20px 20px 48px; border-top: 1px solid var(--line); color: var(--dim); font-size: 12px; line-height: 1.7; text-align: center; }
.site-foot .sep { opacity: .45; margin: 0 6px; }
.site-foot p { margin: 8px auto 0; }
.foot-desc { max-width: 680px; font-size: 11.5px; opacity: .9; }

/* ===== 반응형 ===== */
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); }
  .ed-actions .lbl { display: none; }
  .ed-foot .kbd { display: none; }
}
@media (max-width: 760px) {
  :root { --nav-h: 50px; }
  .topnav { padding: 0 12px; gap: 8px; }
  .brand-sub { display: none; }
  .status { font-size: 11px; padding: 5px 8px; }
  .lang-select { padding: 5px 6px; }
  .lang-select .globe { display: none; }
  .lang-select select { max-width: 92px; font-size: 11px; }
  .app { grid-template-columns: minmax(0, 1fr); padding: 8px 8px 10px; gap: 0; min-height: 440px; }
  .app[data-view="list"] .editor { display: none; }
  .app[data-view="editor"] .side { display: none; }
  .back { display: inline-flex; }
  .ed-bar { padding: 7px 8px; gap: 6px; }
  .ed-title { font-size: 12.5px; }
  .ed-ta { padding: 12px 12px; font-size: 16px; } /* iOS: 16px 미만이면 포커스 시 확대 */
  .search { font-size: 16px; padding: 6px 8px; }
  .seo { padding: 26px 16px 30px; }
}
@media (max-width: 380px) {
  .ed-actions .btn { padding: 6px 7px; }
  .status { max-width: 150px; }
}
