/* 모아노트 1.8.0 — focus view, mobile flow and consistency. Loaded after the older layers. */

/* ---------- Focus view (wider than 650px, 1.8.1): the memo fills the window once it is used ---------- */
.focus-tab{display:none}
@media(min-width:651px){
  .workspace.focus-mode{grid-template-columns:minmax(0,1fr)!important;position:relative}
  .workspace.focus-mode>.panel-resizer,.workspace.focus-mode>.sidebar,.workspace.focus-mode>.note-list-panel{display:none!important}
  .workspace.focus-mode>.editor-panel{grid-column:1;min-width:0;animation:moa-focus-in .18s ease-out}
  .focus-tab{position:absolute;left:0;top:50%;z-index:33;width:22px;height:68px;margin-top:-34px;padding:0;
    border:1px solid var(--line);border-left:0;border-radius:0 12px 12px 0;background:var(--surface-raised);color:var(--muted);
    box-shadow:2px 4px 14px #1c30451f;cursor:pointer;align-items:center;justify-content:center;transition:width .12s ease,color .12s}
  .workspace.focus-mode>.focus-tab:not([hidden]){display:flex}
  .focus-tab:hover,.focus-tab:focus-visible{width:28px;color:var(--accent)}
  .focus-tab:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
  .focus-tab .moa-icon{width:16px;height:16px}
}
@keyframes moa-focus-in{from{opacity:.85}to{opacity:1}}
@media(prefers-reduced-motion:reduce){.workspace.focus-mode>.editor-panel{animation:none}}
/* The full-view switch lives in the editor top bar; phones already show one memo at a time. */
.focus-toggle .moa-icon{width:17px;height:17px}
@media(max-width:650px){.focus-toggle{display:none!important}}

/* ---------- Mobile: new memo button, no side-by-side mode on phones ---------- */
.fab-new-note{display:none}
@media(max-width:900px){
  .note-list-panel{position:relative}
  .fab-new-note{display:flex;position:absolute;right:18px;bottom:calc(20px + env(safe-area-inset-bottom,0px));width:56px;height:56px;border-radius:28px;border:0;
    background:var(--accent);color:var(--on-accent);box-shadow:0 8px 24px #1c304545;align-items:center;justify-content:center;z-index:20;cursor:pointer}
  .fab-new-note .moa-icon{width:26px;height:26px}
  .fab-new-note:active{transform:scale(.96)}
  .note-list{padding-bottom:96px!important}
}
@media(max-width:650px){.editor-topbar .view-toggle button.split-toggle{display:none!important}}
.markdown-preview[title]{cursor:text}

/* ---------- Sidebar: one primary action, web clipping as a small companion ---------- */
.new-note-row{display:flex;gap:8px;align-items:stretch;margin-bottom:17px}
.new-note-row .new-note{flex:1;min-width:0;margin-bottom:0!important}
.new-note-row .new-note kbd{overflow:hidden;text-overflow:ellipsis}
.new-note-row .web-clip-button{width:38px;min-width:38px;height:auto;margin:0;display:inline-flex;align-items:center;justify-content:center;
  border:1px solid var(--line);border-radius:6px;background:var(--surface);color:var(--accent)}
.new-note-row .web-clip-button:hover{background:var(--hover);border-color:var(--accent)}
.tag-cloud .tag-count{margin-left:4px;font-size:.9em;opacity:.75;font-variant-numeric:tabular-nums}
.tag-cloud button{color:var(--accent);background:var(--blue-soft)}

/* ---------- Toast undo and app-styled confirmation ---------- */
.toast .toast-action{background:none;border:0;padding:0 4px;color:var(--accent);font:inherit;font-weight:700;white-space:nowrap;cursor:pointer;align-self:center}
.toast .toast-action:hover{text-decoration:underline}
.confirm-dialog{width:min(430px,92vw);padding:26px 26px 20px}
.confirm-dialog .confirm-text{white-space:pre-line;line-height:1.65;margin:0 0 20px;color:var(--ink);font-size:.95rem}
.confirm-dialog .modal-actions{display:flex;justify-content:flex-end;gap:8px;margin:0}
.danger-solid{background:var(--danger);border:1px solid var(--danger);color:#fff;border-radius:8px;padding:8px 16px;font-weight:600;cursor:pointer}
:root[data-theme=dark] .danger-solid{color:#2a1418}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]) .danger-solid{color:#2a1418}}

/* ---------- Native selects match the app's inputs ---------- */
select.note-sort,select.folder-select,.clip-dialog select,.modal select{
  -webkit-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238592a3' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 9px center;background-size:14px;padding-right:30px!important}
select.note-sort:focus-visible,select.folder-select:focus-visible{outline:2px solid var(--accent);outline-offset:1px}

/* ---------- 1.9.0 web clipping: address in, memo out ---------- */
.web-clip-button svg{width:17px;height:17px}
.clip-dialog{width:min(640px,94vw);max-height:92dvh;border:1px solid var(--line);border-radius:18px;padding:22px;background:var(--surface);color:var(--ink);box-shadow:var(--shadow);overflow:auto}
.clip-dialog::backdrop{background:#172d4560}
.clip-dialog header{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}
.clip-dialog h2{font-size:21px;margin:2px 0}
.clip-dialog #clip-close{font-size:25px;background:none;border:0;padding:2px 10px;color:var(--muted)}
.clip-dialog form{display:flex;flex-direction:column;gap:10px}
.clip-dialog label{font-size:13px;font-weight:600;display:flex;flex-direction:column;gap:5px}
.clip-hint{font-weight:400;color:var(--muted);font-size:12px}
.clip-dialog label[for=clip-url]{flex-direction:row;align-items:baseline;gap:8px}
.clip-dialog input:not([type=checkbox]),.clip-dialog textarea,.clip-dialog select{width:100%;box-sizing:border-box;border:1px solid var(--line);border-radius:8px;background:var(--input);color:inherit;padding:9px 10px;font:inherit;font-size:13px}
.clip-dialog #clip-url{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:13px;resize:vertical;min-height:64px}
.clip-dialog textarea{resize:vertical}
.clip-fields{display:grid;grid-template-columns:1fr 1.3fr 1.3fr;gap:10px}
.clip-dialog .clip-check{flex-direction:row;align-items:center;gap:7px;font-weight:400}
.clip-memo summary,.clip-connect summary{cursor:pointer;color:var(--muted);font-size:13px}
.clip-memo textarea{margin-top:7px}
.clip-actions{display:flex;justify-content:flex-end}
.clip-dialog button{cursor:pointer;border:1px solid var(--line);border-radius:8px;padding:8px 12px;background:var(--hover);color:var(--ink);font-size:13px;white-space:nowrap}
.clip-dialog button.primary{background:var(--accent);color:var(--on-accent);border-color:var(--accent);min-width:96px;padding:9px 18px;font-weight:600}
.clip-dialog button.primary:hover{background:var(--accent-hover);border-color:var(--accent-hover)}
.clip-dialog button:disabled{opacity:.55;cursor:wait}
.clip-dialog #clip-status{font-size:12px;line-height:1.6;color:var(--muted);min-height:20px;margin:12px 0 4px}
.clip-dialog #clip-status.error{color:var(--danger)}
.clip-results{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.clip-results:empty{display:none}
.clip-result{display:flex;align-items:center;gap:10px;border:1px solid var(--line);border-radius:10px;padding:8px 10px}
.clip-result-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.clip-result-body strong{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.clip-result-body small{font-size:12px;color:var(--muted);overflow-wrap:anywhere}
.clip-result-state{width:9px;height:9px;border-radius:50%;background:var(--line);flex:none}
.clip-result.working .clip-result-state{background:var(--accent);animation:clip-pulse 1s ease-in-out infinite}
.clip-result.done .clip-result-state{background:#2e9d62}
.clip-result.failed .clip-result-state{background:var(--danger)}
.clip-result.failed small{color:var(--danger)}
.clip-result button{font-size:12px;padding:5px 10px}
@keyframes clip-pulse{50%{opacity:.35}}
@media (prefers-reduced-motion:reduce){.clip-result.working .clip-result-state{animation:none}}
.clip-connect{margin-top:14px;border-top:1px solid var(--line);padding-top:12px;font-size:12px}
.clip-connect p{line-height:1.6}
.clip-connect label{margin:6px 0}
.clip-connect button{margin:4px 5px 0 0}
#clip-key-result{display:flex;gap:6px;margin-top:8px}
#clip-key-result:empty{display:none}
@media(max-width:640px){.clip-dialog{padding:15px;max-height:94dvh}.clip-fields{grid-template-columns:1fr}}

/* ---------- 1.9.1 web clip: saved web page view ---------- */
.webclip-switch{display:inline-flex;gap:2px;padding:3px;margin:4px 0 14px;border-radius:9px;background:var(--hover,#eef2f5)}
.webclip-switch button{display:inline-flex;align-items:center;gap:6px;border:0;background:none;padding:6px 14px;border-radius:7px;font-size:.8rem;color:var(--muted,#62717e);cursor:pointer}
.webclip-switch button svg{width:15px;height:15px}
.webclip-switch button[aria-pressed=true]{background:var(--surface,#fff);color:var(--ink,#25384a);box-shadow:0 1px 3px #243e5e1a;font-weight:600}
.webclip-page{position:relative}
.webclip-page iframe{display:block;width:100%;height:480px;border:0;background:transparent}
.webclip-loading{position:absolute;top:12px;left:0;font-size:.85rem}
