/* Krafty Crafts — admin panel styles (scoped to #admin) */
#admin {
  --a-bg: #f4f1ec;
  --a-panel: #ffffff;
  --a-side: #24221e;
  --a-line: #e6e0d6;
  --a-ink: #23211d;
  --a-ink-2: #5f5a51;
  --a-ink-3: #8f887c;
  --a-pri: #46553a;
  --a-pri-2: #3a4730;
  --a-acc: #b5603a;
  --a-err: #b23a2e;
  --a-r: 12px;
  min-height: 100vh; background: var(--a-bg); color: var(--a-ink); font: 15px/1.5 var(--sans);
}
#admin[hidden] { display: none; }
#admin h1, #admin h2, #admin h3 { font-family: var(--sans); letter-spacing: -0.01em; font-weight: 650; }
#admin .muted { color: var(--a-ink-3); }
#admin .block { display: block; }
#admin small { font-size: 12.5px; }
#admin code { font-size: 13px; background: #f1ede6; padding: 2px 6px; border-radius: 6px; }
#admin .r { text-align: right; }
#admin .c { text-align: center; }
#admin .nowrap { white-space: nowrap; }
#admin a { color: inherit; }
#admin .ic { width: 18px; height: 18px; }

/* buttons */
#admin .btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center; height: 38px; padding: 0 14px; border-radius: 10px;
  border: 1px solid #e1d6c4; background: #efe6d7; color: var(--a-ink); font-size: 14px; font-weight: 550; text-decoration: none; white-space: nowrap;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
#admin .btn:hover { border-color: #d3c4ab; background: #e7dbc7; }
#admin .btn:disabled { opacity: .6; cursor: progress; }
#admin .btn.sm { height: 32px; padding: 0 10px; font-size: 13px; }
#admin .btn-pri { background: var(--a-pri); border-color: var(--a-pri); color: #fff; }
#admin .btn-pri:hover { background: var(--a-pri-2); border-color: var(--a-pri-2); }
#admin .btn-danger { background: var(--a-err); border-color: var(--a-err); color: #fff; }
#admin .btn-danger:hover { background: #962f25; }
#admin .btn-danger-ghost { color: var(--a-err); }
#admin .btn-danger-ghost:hover { background: #fbefed; border-color: #efc9c3; }
#admin .btn-block { width: 100%; }
#admin .icon-btn { border: 0; background: none; width: 36px; height: 36px; border-radius: 9px; display: inline-grid; place-items: center; color: var(--a-ink-2); }
#admin .icon-btn:hover { background: #efebe4; }
#admin .icon-btn.danger:hover { color: var(--a-err); background: #fbefed; }
#admin .lnk { background: none; border: 0; padding: 0; color: var(--a-pri); font-weight: 550; text-decoration: none; font-size: 14px; }
#admin .lnk:hover { text-decoration: underline; }
#admin .lnk.sm { font-size: 12.5px; margin-left: 6px; }
#admin .lnk.center { display: block; text-align: center; margin-top: 10px; width: 100%; }
#admin .spin, #admin .spin-sm { display: inline-block; border-radius: 50%; border: 3px solid var(--a-line); border-top-color: var(--a-pri); animation: spin .8s linear infinite; }
#admin .spin { width: 30px; height: 30px; }
#admin .spin-sm { width: 14px; height: 14px; border-width: 2px; border-color: rgba(255,255,255,.4); border-top-color: currentColor; }
.adm-loading { min-height: 60vh; display: grid; place-items: center; }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 10%, #ece4d6, transparent 50%), var(--a-bg); }
.auth-card { width: min(400px, 100%); background: #fff; border: 1px solid var(--a-line); border-radius: 18px; padding: 32px; box-shadow: 0 20px 50px -30px rgba(0,0,0,.35); display: grid; gap: 14px; }
.auth-card h1 { font-size: 1.5rem; margin: 6px 0 0; }
.auth-card p { margin: 0; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 4px; }
.auth-logo img { height: 72px; width: auto; }
.auth-logo .logo-mark { width: 34px; height: 34px; }

#admin .hint { background: #f3efe6; border: 1px solid #e6dfd1; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; margin-bottom: 14px; }
#admin .auth-card .hint { margin: 0; }
#admin .hint-err { background: #fbefed; border-color: #efc9c3; color: #8a2a20; }

/* shell */
.adm { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--a-side) 248px, transparent 248px); }
.side { background: var(--a-side); color: #d9d2c5; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 18px 12px; }
.side-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 4px 8px 18px; color: #fff !important; }
.side-brand img { height: 48px; width: auto; }
.side-brand small { color: #9c9486; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; margin-top: 18px; }
.side-brand .logo-mark { width: 34px; height: 34px; background: #f2e9da; color: var(--a-pri); }
.side-brand b { display: block; font-size: 15px; }
.side-brand small { color: #9c9486; font-size: 12px; }
.side-nav { display: grid; gap: 2px; }
.side-nav a, .side-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 9px; text-decoration: none; color: #cfc8ba !important; font-size: 14.5px; border: 0; background: none; width: 100%; text-align: left; }
.side-nav a:hover, .side-link:hover { background: #312e29; color: #fff !important; }
.side-nav a.on { background: #3a3630; color: #fff !important; }
.side-nav a.on .ic { color: #e9a77f; }
.badge-n { margin-left: auto; font-style: normal; background: var(--a-acc); color: #fff; font-size: 11.5px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 6px; }
.side-foot { margin-top: auto; display: grid; gap: 2px; border-top: 1px solid #38342e; padding-top: 12px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; text-decoration: none; color: #fff !important; }
.side-user:hover, .side-user.on { background: #312e29; }
.side-user b { display: block; font-size: 13.5px; font-weight: 600; }
.side-user small { color: #9c9486; }
#admin .av { width: 32px; height: 32px; border-radius: 50%; background: #e3d6c1; color: #4a3b28; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.side-ov { display: none; }
.main { min-width: 0; }
.demo-note { display: flex; align-items: center; gap: 10px; background: #2f2c27; color: #e9e1d2; font-size: 13px; padding: 8px 24px; }
.demo-note .lnk { color: #f3b58f !important; margin-left: auto; font-size: 13px; }
.top { display: flex; align-items: center; gap: 12px; padding: 22px 32px 6px; flex-wrap: wrap; }
.top h1 { font-size: 1.55rem; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-act { display: flex; gap: 8px; }
.body { padding: 16px 32px 48px; max-width: 1240px; }
.mob-only { display: none !important; }
.lead-in { color: var(--a-ink-2); margin: 0 0 18px; font-size: 15.5px; }
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--a-ink-2) !important; font-size: 14px; margin-bottom: 14px; }
.back:hover { color: var(--a-ink) !important; }
.foot-note { color: var(--a-ink-3); font-size: 13.5px; display: flex; gap: 8px; align-items: center; margin-top: 14px; }
.foot-note a { color: var(--a-pri) !important; }

/* panels */
.panel { background: var(--a-panel); border: 1px solid var(--a-line); border-radius: 14px; padding: 20px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel-hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.panel-hd h2 { font-size: 1.05rem; margin: 0; }
.panel-t { font-size: 1rem; margin: 0 0 14px; display: flex; gap: 8px; align-items: center; }
.panel-t .ic { color: var(--a-pri); }
.empty-s { color: var(--a-ink-3); padding: 28px 20px; text-align: center; margin: 0; }
.empty-s a { color: var(--a-pri) !important; }
.panel hr { border: 0; border-top: 1px solid var(--a-line); margin: 16px 0; }

/* stats & dashboard */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--a-line); border-radius: 14px; padding: 16px 18px; text-decoration: none; display: grid; gap: 2px; transition: border-color .12s, transform .12s; }
.stat:hover { border-color: #cfc6b8; transform: translateY(-1px); }
#admin .stat .ic { color: var(--a-ink-3); width: 20px; height: 20px; margin-bottom: 6px; }
.stat b { font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.stat span { color: var(--a-ink-2); font-size: 13.5px; }
.stat.hot { border-color: #e7b597; background: #fdf6f1; }
.stat.hot .ic, .stat.hot b { color: var(--a-acc); }
.dash { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
.quick { display: grid; gap: 8px; }
.quick a { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 10px; border: 1px solid var(--a-line); text-decoration: none; }
.quick a:hover { background: #faf8f4; border-color: #d9d0c2; }
#admin .quick a > .ic { width: 34px; height: 34px; padding: 8px; border-radius: 9px; background: #eef0e9; color: var(--a-pri); }
.quick b { display: block; font-size: 14px; }
.quick small { color: var(--a-ink-3); }

/* messages */
.msg-list { list-style: none; margin: 0; padding: 0; }
.msg-list li + li { border-top: 1px solid var(--a-line); }
.panel:not(.flush) .msg-list { margin: 0 -20px -20px; }
.msg { display: grid; grid-template-columns: 10px 1fr auto; gap: 14px; align-items: center; padding: 14px 20px; text-decoration: none; }
.msg:hover { background: #faf8f4; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: transparent; }
.dot.dot-new { background: var(--a-acc); }
.msg-main { min-width: 0; display: grid; gap: 2px; }
.msg-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.msg-top b { font-weight: 550; }
.msg.unread .msg-top b { font-weight: 700; }
.msg-snip { color: var(--a-ink-2); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-meta { display: grid; justify-items: end; gap: 4px; font-size: 12.5px; color: var(--a-ink-3); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 8px; border-radius: 6px; background: #f1ede6; color: var(--a-ink-2); font-weight: 550; }
.tag .ic { width: 13px; height: 13px; }
.tag-order { background: #fbeee6; color: #8c4524; }
.pill { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.st-new { background: #fbe7dc; color: #8c4524; }
.st-prog { background: #fdf2d4; color: #7a5a10; }
.st-done { background: #e3eedf; color: #335a2b; }
.st-arch { background: #ece9e3; color: #6a645a; }
.st-hidden { background: #ece9e3; color: #6a645a; border: 1px dashed #c9c1b3; }
.msg-view { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
.mv-hd { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.mv-hd h2 { font-size: 1.35rem; margin: 0 0 6px; }
.mv-sub { display: flex; gap: 8px; align-items: center; color: var(--a-ink-3); font-size: 13.5px; flex-wrap: wrap; }
.mv-act { display: flex; gap: 8px; flex-wrap: wrap; }
.kv { margin: 0 0 16px; display: grid; gap: 0; border-top: 1px solid var(--a-line); }
.kv div { display: grid; grid-template-columns: 110px 1fr; padding: 9px 0; border-bottom: 1px solid var(--a-line); }
.kv dt { color: var(--a-ink-3); font-size: 13.5px; }
.kv dd { margin: 0; word-break: break-word; }
.mv-msg { background: #faf8f4; border: 1px solid var(--a-line); border-radius: 10px; padding: 16px; font-size: 15px; white-space: normal; }
.order { margin-bottom: 16px; display: grid; gap: 10px; justify-items: start; }
.order .tbl { border: 1px solid var(--a-line); border-radius: 10px; overflow: hidden; }
.order .tbl a { color: var(--a-pri) !important; }

/* bars, search */
.bar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.seg { display: flex; background: #ebe6dd; border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 550; color: var(--a-ink-2); }
.seg button em { font-style: normal; color: var(--a-ink-3); font-weight: 500; margin-left: 2px; }
.seg button.on { background: #fff; color: var(--a-ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.search { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--a-line); border-radius: 10px; padding: 0 10px; flex: 1; min-width: 200px; max-width: 360px; height: 38px; }
.search .ic { color: var(--a-ink-3); }
.search input { border: 0; outline: 0; font: inherit; flex: 1; min-width: 0; background: none; }
.bar select, #admin select { font: inherit; height: 38px; border: 1px solid var(--a-line); border-radius: 10px; padding: 0 10px; background: #fff; color: var(--a-ink); }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--a-ink-3); font-weight: 600; padding: 10px 14px; background: #faf8f4; border-bottom: 1px solid var(--a-line); }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--a-line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tfoot td { border-top: 1px solid var(--a-line); border-bottom: 0; background: #faf8f4; }
.tbl-click tbody tr { cursor: pointer; }
.tbl-click tbody tr:hover td { background: #faf8f4; }
.tbl .th { width: 64px; padding-right: 0; }
.tbl .th img, .th-ph { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; object-position: center top; background: #f1ede6; display: grid; place-items: center; color: var(--a-ink-3); }
.tbl .c .ic { color: var(--a-pri); }
.star .ic { color: #d29a2a; fill: #f3c75f; }
.person { display: flex; gap: 10px; align-items: center; }

/* forms */
#admin .fld { display: grid; gap: 6px; margin-bottom: 16px; align-content: start; }
#admin .fld:last-child { margin-bottom: 0; }
#admin .fld-l { font-size: 13.5px; font-weight: 600; color: var(--a-ink); display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
#admin .help { font-weight: 400; color: var(--a-ink-3); font-size: 12.5px; }
#admin input:not([type=checkbox]):not([type=radio]):not([type=file]), #admin textarea {
  font: 15px/1.45 var(--sans); width: 100%; border: 1px solid #ddd5c8; border-radius: 9px; padding: 9px 11px; background: #fff; color: var(--a-ink);
  transition: border-color .12s, box-shadow .12s;
}
#admin .search input { border: 0 !important; box-shadow: none !important; padding: 0 !important; }
#admin input:focus, #admin textarea:focus, #admin select:focus { outline: none; border-color: var(--a-pri); box-shadow: 0 0 0 3px rgba(70, 85, 58, .15); }
#admin input:disabled { background: #f6f3ee; color: var(--a-ink-3); }
#admin textarea { resize: vertical; }
.bi-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bi-row label, .cat-row label { position: relative; display: block; }
#admin .flag { position: absolute; top: 9px; right: 9px; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; color: var(--a-ink-3); background: #f3efe8; padding: 1px 6px; border-radius: 5px; pointer-events: none; }
.bi-row input, .bi-row textarea { padding-right: 44px !important; }
#admin .check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; cursor: pointer; border-bottom: 1px solid var(--a-line); }
#admin .check:last-of-type { border-bottom: 0; }
#admin .check input { width: 18px; height: 18px; accent-color: var(--a-pri); margin-top: 2px; flex: none; }
#admin .check b { display: block; font-weight: 600; font-size: 14px; }
#admin .check small { color: var(--a-ink-3); }
.edit { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.edit.one { grid-template-columns: 1fr; max-width: 900px; }
.edit-main, .edit-side { display: grid; gap: 18px; min-width: 0; }
.edit-side { position: sticky; top: 16px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.slug { display: flex; align-items: center; border: 1px solid #ddd5c8; border-radius: 9px; overflow: hidden; background: #f6f3ee; }
.slug span { padding: 0 2px 0 10px; color: var(--a-ink-3); font-size: 13px; }
#admin .slug input { border: 0 !important; border-radius: 0; box-shadow: none !important; padding-left: 2px !important; }
.pw-row { display: flex; gap: 8px; }
.roles p { margin: 0 0 6px; color: var(--a-ink-2); }
.roles { margin-top: 18px; }

/* tabs */
.tabs { margin-left: auto; display: inline-flex; background: #ebe6dd; border-radius: 8px; padding: 2px; }
.tabs button { border: 0; background: none; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 6px; color: var(--a-ink-2); }
.tabs button.on { background: #fff; color: var(--a-ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* rich text */
.rte { border: 1px solid #ddd5c8; border-radius: 10px; overflow: hidden; background: #fff; }
.rte[hidden] { display: none; }
.rte:focus-within { border-color: var(--a-pri); box-shadow: 0 0 0 3px rgba(70, 85, 58, .15); }
.rte-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--a-line); background: #faf8f4; }
.rte-bar button { border: 0; background: none; min-width: 32px; height: 30px; border-radius: 7px; font-size: 14px; font-weight: 600; color: var(--a-ink-2); display: grid; place-items: center; }
.rte-bar button:hover { background: #ece7de; color: var(--a-ink); }
.rte-bar .ic { width: 16px; height: 16px; }
.rte-bar .sep { width: 1px; background: var(--a-line); margin: 4px 4px; }
.rte-body { min-height: 220px; max-height: 60vh; overflow-y: auto; padding: 14px 16px; outline: none; font-size: 15px; color: var(--a-ink); }
.rte-body:empty::before { content: "Start writing…"; color: var(--a-ink-3); }
.rte-body h2 { font-size: 1.35rem; margin: 1em 0 .4em; }
.rte-body h3 { font-size: 1.1rem; margin: 1em 0 .4em; }
.rte-body p { margin: 0 0 .8em; }
.rte-body img { max-width: 100%; border-radius: 8px; }

/* images */
.imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.img-it { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #f1ede6; border: 1px solid var(--a-line); }
.img-it img, .img-it .th-ph { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.img-it.cover { grid-column: span 2; grid-row: span 2; }
.cover-tag { position: absolute; top: 6px; left: 6px; background: rgba(35,33,29,.8); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; }
.img-act { position: absolute; inset: auto 0 0 0; display: flex; justify-content: flex-end; gap: 2px; padding: 4px; background: linear-gradient(transparent, rgba(0,0,0,.45)); opacity: 0; transition: opacity .15s; }
.img-it:hover .img-act, .img-it:focus-within .img-act { opacity: 1; }
.img-act button { border: 0; width: 28px; height: 28px; border-radius: 7px; background: rgba(255,255,255,.92); display: grid; place-items: center; color: var(--a-ink); }
.img-act button:hover { background: #fff; }
.img-act .ic { width: 15px; height: 15px; }
.img-add { aspect-ratio: 1; border: 2px dashed #d6ccbc; border-radius: 10px; display: grid; place-content: center; justify-items: center; gap: 4px; color: var(--a-ink-2); font-size: 12.5px; font-weight: 600; cursor: pointer; text-align: center; padding: 6px; }
.img-add:hover { border-color: var(--a-pri); color: var(--a-pri); background: #f7f8f4; }
.img-add.loading { pointer-events: none; opacity: .7; }

/* categories */
.cat-list { display: grid; gap: 8px; margin-bottom: 22px; }
.cat-row { display: grid; grid-template-columns: 1fr 1fr 1fr 84px 92px auto 36px; gap: 8px; align-items: center; }
.cat-row .cnt { font-size: 12.5px; text-align: right; }
.cat-row input { padding-right: 40px !important; }
.cat-row label:nth-child(3) input { padding-left: 64px !important; padding-right: 10px !important; }
.cat-row label:nth-child(3) .flag { left: 8px; right: auto; }
.cat-row .w-ord input { padding-right: 28px !important; }

/* toasts & modal */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { display: flex; gap: 8px; align-items: center; background: #23211d; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.4); animation: up .2s ease-out; transition: opacity .3s, transform .3s; max-width: min(520px, 92vw); }
.toast .ic { color: #9fd28d; }
.toast-err { background: #8f2a20; }
.toast-err .ic { color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes up { from { opacity: 0; transform: translateY(10px); } }
.m-ov { position: fixed; inset: 0; background: rgba(25, 23, 20, .45); z-index: 150; animation: fade .15s; }
.m-box { position: fixed; z-index: 151; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(440px, calc(100vw - 32px)); max-height: 90vh; overflow: auto; background: #fff; border-radius: 16px; padding: 24px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.45); animation: pop .18s ease-out; }
.m-box.wide { width: min(640px, calc(100vw - 32px)); }
.m-box h3 { margin: 0 0 8px; font-size: 1.2rem; }
.m-box p { margin: 0 0 16px; }
.m-act { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -48%) scale(.98); } }

/* responsive */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .dash, .msg-view { grid-template-columns: 1fr; }
  .edit { grid-template-columns: 1fr; }
  .edit-side { position: static; }
  .cat-row { grid-template-columns: 1fr 1fr 84px auto 36px; }
  .cat-row .hide-s, .cat-row .cnt { display: none; }
}
@media (max-width: 820px) {
  .adm { grid-template-columns: 1fr; background: none; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 264px; z-index: 120; transform: translateX(-100%); transition: transform .22s ease; }
  .adm.side-open .side { transform: none; }
  .adm.side-open .side-ov { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 110; }
  .mob-only { display: inline-grid !important; }
  .top { padding: 14px 16px 4px; }
  .top h1 { font-size: 1.25rem; }
  .body { padding: 12px 16px 40px; }
  .hide-s { display: none !important; }
  .bi-row, .two { grid-template-columns: 1fr; }
  .search { max-width: none; }
  .msg { grid-template-columns: 10px 1fr; }
  .msg-meta { grid-column: 2; justify-items: start; grid-auto-flow: column; justify-content: start; gap: 10px; align-items: center; }
  .img-act { opacity: 1; }
  .demo-note { padding: 8px 16px; }
}
@media (max-width: 520px) {
  .cat-row { grid-template-columns: 1fr 1fr; }
  .cat-row .w-ord { display: none; }
  .top-act .btn span.hide-s { display: none; }
}

/* FAQ: hidden (archived) questions */
.rte-body h3[data-hidden] { color: var(--a-ink-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.rte-body h3[data-hidden]::after { content: "Hidden"; display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 99px; background: #efe9dd; color: var(--a-ink-2); font-size: 11px; font-weight: 600; text-decoration: none; vertical-align: 2px; }
#admin .small { font-size: 13px; }
#admin .faq-vis-panel p.small { margin: 0 0 10px; }
#admin .fv-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--a-line); }
#admin .fv-row:first-child { border-top: 0; }
#admin .fv-btn { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--a-line); background: #fff; color: var(--a-ink); cursor: pointer; }
#admin .fv-btn:hover { background: #f6f2ea; }
#admin .fv-btn svg { width: 17px; height: 17px; }
#admin .fv-q { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.3; }
#admin .fv-q b { font-weight: 600; display: block; }
#admin .fv-q small { display: block; color: var(--a-ink-3); font-size: 12px; margin-top: 2px; }
#admin .fv-row.is-hidden .fv-q { color: var(--a-ink-3); }
#admin .fv-row.is-hidden .fv-q b { text-decoration: line-through; text-decoration-thickness: 1px; }
#admin .fv-row.is-hidden .fv-btn { background: #efe9dd; color: var(--a-ink-3); }
#admin .fv-tag { flex: none; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: #efe9dd; color: var(--a-ink-2); }

/* inbox: row menu (⋯) */
.msg-li { position: relative; display: flex; align-items: stretch; }
.msg-li > .msg { flex: 1; min-width: 0; padding-right: 8px; }
.msg-more { flex: none; align-self: center; width: 34px; height: 34px; margin-right: 12px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--a-ink-3); cursor: pointer; transition: background .15s, color .15s; }
.msg-more:hover, .msg-more.open { background: #f1ede6; color: var(--a-ink); }
.msg-more .ic, .msg-more svg { width: 18px; height: 18px; }
.msg-li:has(.msg:hover) { background: #faf8f4; }
.msg-li .msg:hover { background: none; }
.msg-menu { position: fixed; z-index: 140; min-width: 196px; padding: 6px; background: #fff; border: 1px solid var(--a-line); border-radius: 12px; box-shadow: 0 14px 40px -12px rgba(40, 30, 20, .28); animation: pop-menu .14s ease-out; }
.msg-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 14px; color: var(--a-ink); text-align: left; cursor: pointer; }
.msg-menu button:hover, .msg-menu button:focus-visible { background: #f6f2ea; outline: none; }
.msg-menu button svg { width: 17px; height: 17px; color: var(--a-ink-2); }
.msg-menu button.danger, .msg-menu button.danger svg { color: #a3352a; }
.msg-menu button.danger:hover { background: #fbefed; }
@keyframes pop-menu { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .msg-menu { animation: none; } }
#admin .btn-block + .btn-block { margin-top: 8px; }

/* ---------- language switch ---------- */
#admin .lang-sw { display: flex; width: max-content; padding: 3px; gap: 2px; border-radius: 99px; background: rgba(255,255,255,.08); }
#admin .lang-sw button { min-width: 40px; height: 28px; padding: 0 10px; border: 0; border-radius: 99px; background: none; color: rgba(255,255,255,.62); font: inherit; font-size: 12.5px; font-weight: 650; letter-spacing: .04em; cursor: pointer; transition: background .15s, color .15s; }
#admin .lang-sw button:hover { color: #fff; }
#admin .lang-sw button.on { background: #efe6d7; color: var(--a-ink); }
#admin .side-lang { margin: 0 12px 10px; align-self: flex-start; }
#admin .auth-lang { background: #efe6d7; margin: -8px -8px 4px auto; }
#admin .auth-lang button { color: var(--a-ink-2); }
#admin .auth-lang button:hover { color: var(--a-ink); }
#admin .auth-lang button.on { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ---------- tutorial button, tip and drawer ---------- */
#admin .top-act { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
#admin .tut-btn svg { width: 17px; height: 17px; }
#admin .tut-tip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 0 0 18px; border-radius: var(--a-r); background: #efe6d7; border: 1px solid #e1d6c4; color: var(--a-ink); font-size: 14px; }
#admin .tut-tip > svg { flex: none; width: 20px; height: 20px; color: var(--a-acc); }
#admin .tut-tip > span { flex: 1; }
#admin .tut-tip .lnk { font-size: inherit; text-decoration: underline; text-underline-offset: 2px; }
#admin .tut-tip .btn { background: #fff; }
.tut-root { position: fixed; inset: 0; z-index: 150; }
.tut-ov { position: absolute; inset: 0; background: rgba(36, 34, 30, .32); opacity: 0; transition: opacity .22s ease; }
.tut { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%); display: flex; flex-direction: column; background: #fbf8f3; box-shadow: -18px 0 48px -20px rgba(40, 30, 20, .35); transform: translateX(24px); opacity: 0; transition: transform .26s cubic-bezier(.22,1,.36,1), opacity .2s ease; }
.tut-root.in .tut-ov { opacity: 1; }
.tut-root.in .tut { transform: none; opacity: 1; }
.tut-hd { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 10px 24px; border-bottom: 1px solid var(--a-line); }
.tut-kicker { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--a-acc); }
.tut-kicker svg { width: 16px; height: 16px; }
.tut-body { overflow-y: auto; padding: 20px 24px 40px; color: var(--a-ink); font-size: 15px; line-height: 1.55; }
.tut-body h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.01em; }
.tut-intro { margin: 0 0 18px; color: var(--a-ink-2); }
.tut-sec { margin: 0 0 18px; padding: 16px 18px; background: #fff; border: 1px solid var(--a-line); border-radius: 12px; }
.tut-sec h3, .tut-tips h3 { margin: 0 0 10px; font-size: 15px; }
.tut-sec ol { margin: 0; padding: 0; list-style: none; counter-reset: st; }
.tut-sec li { position: relative; padding: 0 0 0 34px; margin: 0 0 10px; counter-increment: st; }
.tut-sec li:last-child { margin-bottom: 0; }
.tut-sec li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: #efe6d7; color: var(--a-ink); font-size: 12.5px; font-weight: 700; }
.tut-tips { padding: 14px 18px; border-radius: 12px; background: #efe6d7; }
.tut-tips h3 { display: flex; align-items: center; gap: 7px; }
.tut-tips h3 svg { width: 16px; height: 16px; color: var(--a-acc); }
.tut-tips ul { margin: 0; padding-left: 18px; }
.tut-tips li { margin: 0 0 6px; }
.tut-tips li:last-child { margin: 0; }
@media (max-width: 700px) {
  .tut { top: auto; width: 100%; max-height: 88vh; border-radius: 18px 18px 0 0; transform: translateY(30px); }
  .tut-body { padding: 16px 18px 32px; }
}
@media (prefers-reduced-motion: reduce) { .tut, .tut-ov { transition: none; } }
