/* Artemii v2: search palette, settings, project and list pages, share viewer, switches. */
/* ---------- search palette ---------- */
.pal-scrim { position: fixed; inset: 0; z-index: 110; background: var(--scrim); backdrop-filter: blur(2px); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; animation: fade-in 0.12s; }
.pal { width: min(100%, 640px); max-height: min(70vh, 560px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; animation: pop 0.14s ease-out; }
.pal-top { display: flex; align-items: center; gap: 12px; padding: 0 16px; height: 54px; border-bottom: 1px solid var(--border); color: var(--muted); flex: none; }
input.pal-input { flex: 1; border: 0; background: transparent; font-size: 16px; height: 100%; outline: none; color: var(--text); box-shadow: none; padding: 0; border-radius: 0; }
input.pal-input:focus-visible { outline: none; box-shadow: none; }
.pal-list { overflow-y: auto; padding: 6px; }
.pal-head { font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 4px; }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.pal-item svg { color: var(--muted); flex: none; }
.pal-item.sel { background: var(--bg-soft); }
.pal-item.sel svg { color: var(--accent-text); }
.pal-text { flex: 1; min-width: 0; }
.pal-title { font-size: 14px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-snip { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.pal-meta { font-size: 11.5px; color: var(--muted); }
.pal-empty { padding: 28px; text-align: center; color: var(--muted); }
mark { background: var(--accent-soft); color: inherit; border-radius: 3px; padding: 0 1px; box-shadow: inset 0 -2px 0 var(--accent); }

/* ---------- settings ---------- */
.settings { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: grid; grid-template-columns: 280px minmax(0, 1fr); animation: fade-in 0.15s; }
.set-side { background: var(--side); border-right: 1px solid var(--border); padding: 24px 14px; overflow-y: auto; }
.set-side-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 10px 14px; }
.set-side-head h2 { margin: 0; font-size: 20px; letter-spacing: -0.015em; }
.set-status { font-size: 12px; }
.set-tabs { display: grid; gap: 2px; }
.set-tab { display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: 14px; font-weight: 500; }
.set-tab svg { color: var(--muted); }
.set-tab:hover { background: var(--side-hover); }
.set-tab.on { background: var(--side-active); font-weight: 600; }
.set-tab.on svg { color: var(--accent-text); }
.set-main { overflow-y: auto; position: relative; }
.set-main-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; max-width: 720px; margin: 0 auto; padding: 22px 28px 10px; background: linear-gradient(var(--bg) 70%, transparent); }
.set-main-head h2 { margin: 0; font-size: 22px; letter-spacing: -0.015em; }
.set-content { max-width: 720px; margin: 0 auto; padding: 6px 28px 80px; outline: none; }
.set-section { margin-top: 26px; }
.set-h { font-size: 12px; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.set-row.stack { flex-direction: column; align-items: stretch; gap: 12px; }
.set-row-text { min-width: 0; flex: 1; }
.set-label { font-weight: 600; font-size: 14.5px; }
.set-desc { font-size: 13px; margin-top: 2px; max-width: 46ch; }
.set-control { flex: none; max-width: 100%; }
.set-control input[type=text] { width: 260px; max-width: 100%; }
.set-section textarea { width: 100%; margin-top: 8px; font-size: 14.5px; }
.ci-count { text-align: right; margin-top: 4px; }
.switch { position: relative; width: 44px; height: 26px; border-radius: 999px; border: 0; background: var(--border-strong); cursor: pointer; transition: background 0.18s; padding: 0; flex: none; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch-knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.18s var(--ease); }
.switch[aria-checked="true"] .switch-knob { transform: translateX(18px); }
.seg-ctl { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-soft2); border-radius: 11px; flex-wrap: wrap; }
.seg-btn { border: 0; background: transparent; height: 30px; padding: 0 14px; border-radius: 8px; font-size: 13.5px; font-weight: 500; cursor: pointer; color: var(--muted); }
.seg-btn:hover { color: var(--text); }
.seg-btn.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm); font-weight: 600; }
.theme-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.theme-card { border: 1.5px solid var(--border); background: transparent; border-radius: 14px; padding: 8px 8px 10px; cursor: pointer; display: grid; gap: 8px; text-align: center; }
.theme-card:hover { border-color: var(--border-strong); }
.theme-card.on { border-color: var(--accent-ring); box-shadow: 0 0 0 3px var(--accent-soft); }
.tc-name { font-size: 13.5px; font-weight: 600; }
.tc-prev { height: 62px; border-radius: 9px; display: grid; align-content: center; gap: 6px; padding: 0 14px; border: 1px solid rgba(128, 128, 128, 0.25); }
.tc-prev i { display: block; height: 7px; border-radius: 4px; background: currentColor; opacity: 0.35; }
.tc-prev i:nth-child(1) { width: 70%; } .tc-prev i:nth-child(2) { width: 100%; } .tc-prev i:nth-child(3) { width: 45%; }
.tc-light { background: #faf9f5; color: #1f1e1b; }
.tc-dark { background: #211f1c; color: #ece8de; }
.tc-system { background: linear-gradient(100deg, #faf9f5 50%, #211f1c 50%); color: #8a8578; }
.mem-host { margin-top: 12px; }
.mem-head { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 10px; }
.mem-add { display: flex; gap: 8px; margin-bottom: 10px; }
.mem-add input { flex: 1; }
.mem-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.mem-item { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--border); }
.mem-item:last-child { border-bottom: 0; }
.mem-text { flex: 1; font-size: 14px; overflow-wrap: anywhere; }
.mem-empty { padding: 16px; text-align: center; }
.share-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 12px; }
.share-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.share-item:last-child { border-bottom: 0; }
.share-item > svg { color: var(--muted); flex: none; }
.share-main { flex: 1; min-width: 0; }
.share-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-url { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kbd-list { display: grid; grid-template-columns: max-content 1fr; gap: 0; margin: 8px 0 0; }
.kbd-list dt, .kbd-list dd { padding: 11px 0; border-bottom: 1px solid var(--border); margin: 0; }
.kbd-list dt { padding-right: 28px; display: flex; gap: 4px; align-items: center; white-space: nowrap; }
.kbd-list dd { color: var(--muted); }
@media (max-width: 800px) {
  .settings { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .set-side { padding: 10px 8px 6px; border-right: 0; border-bottom: 1px solid var(--border); }
  .set-side-head { display: none; }
  .set-tabs { display: flex; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .set-tab { flex: none; padding: 0 12px; height: 36px; }
  .set-tab span { display: inline; }
  .set-main-head { padding: 14px 16px 8px; }
  .set-content { padding: 0 16px 60px; }
  .set-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .set-row .switch { align-self: flex-start; }
}

/* ---------- project + list pages ---------- */
.page-scroll { flex: 1; overflow-y: auto; }
.page-body { max-width: 980px; margin: 0 auto; padding: 8px 28px 60px; }
.page-h1 { font-size: 26px; letter-spacing: -0.02em; margin: 8px 0 18px; font-family: var(--serif); font-weight: 500; }
.proj-head { margin: 8px 0 20px; }
.proj-name { font-family: var(--serif); font-weight: 500; font-size: 32px; letter-spacing: -0.02em; margin: 0 0 6px; }
.proj-desc { margin: 0; color: var(--muted); font-size: 15px; max-width: 70ch; }
.proj-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 36px; margin-top: 34px; }
.col-title { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.col-add { margin-left: auto; text-transform: none; letter-spacing: 0; }
.proj-col > section + section { margin-top: 28px; }
.pad { padding: 4px 2px; }
.list { display: grid; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--panel); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 12px 11px 14px; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text); min-height: 52px; }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover { background: var(--bg-soft); }
.list-row > svg { color: var(--muted); flex: none; }
.lr-main { flex: 1; min-width: 0; display: grid; }
.lr-title { font-weight: 550; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-sub { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-time { font-size: 12px; flex: none; }
.list-row .ci-more { opacity: 0.0; }
.list-row:hover .ci-more, .list-row:focus-within .ci-more { opacity: 1; }
.ins-box { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; white-space: pre-wrap; font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.files-list:empty { display: none; }
.files-list .pad { padding: 14px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.proj-card { display: grid; gap: 6px; padding: 18px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; text-decoration: none; color: var(--text); transition: border-color 0.15s, box-shadow 0.15s; }
.proj-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.pc-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; }
.pc-name { font-weight: 650; font-size: 16px; margin-top: 6px; }
.pc-desc { font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc-meta { font-size: 12.5px; margin-top: 4px; }
.page-view .composer { margin-top: 4px; }
@media (max-width: 800px) {
  .page-body { padding: 4px 16px 40px; }
  .proj-grid { grid-template-columns: 1fr; gap: 28px; }
  .proj-name { font-size: 26px; }
  .list-row .ci-more { opacity: 1; }
}

/* ---------- share viewer ---------- */
.share-layout { height: 100%; display: flex; background: var(--bg); }
.share-layout > .artifact-root { flex: none; border-left: 1px solid var(--border); }
.share-layout.share-solo > .share-page { display: none; }
.share-layout.share-solo > .artifact-root { flex: 1; width: 100% !important; border: 0; }
.share-page { flex: 1; min-width: 0; height: 100%; overflow-y: auto; display: flex; flex-direction: column; background: var(--bg); }
.share-top { position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.share-main { flex: 1; width: 100%; max-width: 780px; margin: 0 auto; padding: 28px 20px 40px; }
.share-title-h { font-family: var(--serif); font-weight: 500; font-size: 28px; letter-spacing: -0.02em; margin: 0 0 24px; }
.share-thread { min-height: 0; }
.share-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 20px 26px; border-top: 1px solid var(--border); font-size: 13px; max-width: 780px; width: 100%; margin: 0 auto; }
.share-art-meta { text-transform: uppercase; font-size: 11.5px; letter-spacing: 0.05em; margin-bottom: 12px; }
.share-svg img { max-width: 100%; background: #fff; border-radius: 12px; border: 1px solid var(--border); }
@media (max-width: 700px) { .pal-top .kbd-hint { display: none; } input.pal-input { min-width: 0; text-overflow: ellipsis; } }
