/* მართვის პანელი */
:root {
  --brand: #7A004B; --brand-2: #940F5D; --brand-bg: #FCECF4; --brand-line: #EBC9DB;
  --line: #E6E1D8; --line2: #D3CCC0; --muted: #6F6874; --ink: #1E1B22; --bg: #F5F3EF; --surface: #fff; --soft: #FAF8F5;
  --ok: #1F7A3F; --warn: #94600A; --err: #B0281E;
  --r: 9px; --shadow: 0 1px 2px rgba(30, 20, 30, .05), 0 4px 14px rgba(30, 20, 30, .05);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 'Noto Sans', 'Noto Sans Georgian', sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; } a:hover { text-decoration: underline; }
.ti { font-size: 1.15em; vertical-align: -0.14em; }
h1 { font-size: 21px; margin: 0 0 16px; letter-spacing: -.005em; }
h2 { font-size: 15px; margin: 28px 0 10px; display: flex; align-items: center; gap: 7px; } h2 .ti { color: var(--brand); }
h3 { font-size: 12.5px; margin: 16px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--muted); } small.muted { font-weight: 400; font-size: 13px; }

/* ზედა ზოლი */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: stretch; gap: 6px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); color: #fff; padding: 0 18px; min-height: 52px; flex-wrap: wrap; box-shadow: 0 2px 10px rgba(122, 0, 75, .22); }
.top > * { display: flex; align-items: center; }
.top a, .top .link { color: #fff; opacity: .86; gap: 6px; } .top a:hover, .top .link:hover { opacity: 1; text-decoration: none; }
.top .brand { font-weight: 700; opacity: 1; gap: 9px; margin-right: 6px; } .top .brand img { border-radius: 7px; background: #fff; padding: 2px; }
.top .dname { font-weight: 600; opacity: 1; background: rgba(255, 255, 255, .14); border-radius: 999px; padding: 4px 13px; align-self: center; }
.top .mods { gap: 2px; margin-left: 8px; } .top .mods a { padding: 0 13px; height: 100%; display: flex; align-items: center; border-bottom: 3px solid transparent; border-top: 3px solid transparent; }
.top .mods a.on { opacity: 1; border-bottom-color: #fff; font-weight: 600; background: rgba(255, 255, 255, .08); }
.top .grow { flex: 1; } .top .who { opacity: .9; gap: 6px; margin: 0 6px 0 10px; font-size: 13px; } .top form { margin: 0; }
.top .tl { padding: 6px 10px; border-radius: 8px; } .top .tl:hover { background: rgba(255, 255, 255, .14); }
.link { background: none; border: 0; font: inherit; cursor: pointer; padding: 0; display: inline-flex; align-items: center; } .top .link .ti { font-size: 19px; }

main { max-width: 1120px; margin: 0 auto; padding: 24px 20px 70px; } main.wide { max-width: 1720px; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; } .bar h1 { margin: 0; } .bar > span { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ღილაკები და ველები */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 500; line-height: 1.3; cursor: pointer; border: 1px solid var(--line2); background: var(--surface); color: var(--ink); border-radius: var(--r); padding: 7px 14px; transition: border-color .12s, background .12s, box-shadow .12s, transform .08s; white-space: nowrap; }
.btn:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; background: #fff; box-shadow: 0 1px 4px rgba(122, 0, 75, .12); } .btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; box-shadow: 0 1px 3px rgba(122, 0, 75, .3); } .btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn.big { padding: 9px 20px; font-size: 14.5px; } .btn.sq { padding: 7px 9px; } .btn.on { background: var(--brand-bg); border-color: var(--brand-line); color: var(--brand); font-weight: 600; }
.btn.off { opacity: .4; pointer-events: none; } .btn.danger { color: var(--err); } .btn.danger:hover { border-color: var(--err); color: var(--err); background: #FDF1EF; box-shadow: none; }
input, select, textarea { font: inherit; color: inherit; padding: 8px 10px; border: 1px solid var(--line2); border-radius: var(--r); background: var(--surface); max-width: 100%; transition: border-color .12s, box-shadow .12s; }
input:focus, select:focus, textarea:focus, .ed:focus { outline: 0; border-color: #C27CA4; box-shadow: 0 0 0 3px rgba(194, 124, 164, .22); }
input::placeholder { color: #B0A9A0; }
.mono, textarea.rich { font-family: 'JetBrains Mono', monospace; font-size: 13px; }

.flash { display: flex; align-items: flex-start; gap: 9px; padding: 11px 14px; border-radius: var(--r); margin-bottom: 16px; border: 1px solid; } .flash .ti { font-size: 18px; margin-top: 1px; flex: none; }
.flash.ok { background: #EAF6EE; border-color: #BFDFC9; color: var(--ok); } .flash.warn { background: #FFF6E0; border-color: #EBD49A; color: var(--warn); } .flash.err { background: #FDECEA; border-color: #F0BDB8; color: var(--err); }
.empty { text-align: center; padding: 46px 20px; background: var(--surface); border: 1px dashed var(--line2); border-radius: 14px; } .empty > .ti { font-size: 34px; color: var(--brand-line); } .empty p { max-width: 520px; margin: 8px auto 0; }

/* ლექსიკონების ბარათები, რიცხვები */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.card { position: relative; display: flex; flex-direction: column; gap: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; color: inherit; box-shadow: var(--shadow); transition: border-color .12s, transform .12s, box-shadow .12s; }
a.card:hover { border-color: var(--brand); text-decoration: none; transform: translateY(-2px); box-shadow: 0 6px 22px rgba(122, 0, 75, .13); }
.card .cic { width: 40px; height: 40px; border-radius: 11px; background: var(--brand-bg); color: var(--brand); display: flex; align-items: center; justify-content: center; margin-bottom: 8px; } .card .cic .ti { font-size: 22px; }
.card b { font-size: 15px; line-height: 1.35; } .card > span:not(.cic) { color: var(--muted); font-size: 13px; }
.card em { font-style: normal; font-size: 12.5px; color: var(--muted); margin-top: 8px; display: inline-flex; align-items: center; gap: 4px; } .card em.go { color: var(--brand); font-weight: 600; }
.card.off { box-shadow: none; background: var(--soft); } .card.off .cic { background: #EEEAE3; color: #A49C90; } .card.off b { color: #7d7682; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; color: inherit; display: grid; grid-template-columns: 38px 1fr; column-gap: 12px; align-items: center; box-shadow: var(--shadow); transition: border-color .12s, transform .12s; }
.stat .sic { grid-row: span 2; width: 38px; height: 38px; border-radius: 10px; background: var(--brand-bg); color: var(--brand); display: flex; align-items: center; justify-content: center; } .stat .sic .ti { font-size: 20px; }
.stat b { font-size: 21px; line-height: 1.2; } .stat > span:last-child { color: var(--muted); font-size: 12.5px; line-height: 1.3; }
a.stat:hover { border-color: var(--brand); text-decoration: none; transform: translateY(-1px); }

/* ცხრილები */
table.list { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
table.list th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 9px 12px; background: var(--soft); border-bottom: 1px solid var(--line); }
table.list td { padding: 9px 12px; border-bottom: 1px solid #F1EDE6; vertical-align: top; } table.list tr:last-child td { border-bottom: 0; }
table.list tr:hover td { background: #FDFAFC; }
td.num { color: #A39BA8; font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; } a.hw { font-weight: 600; font-size: 14.5px; }
td.clip { max-width: 440px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #57525C; }
.tag.warn { display: inline-flex; align-items: center; background: #FFF1CC; color: var(--warn); border-radius: 6px; padding: 1px 5px; font-size: 12px; vertical-align: 1px; }
a.icb { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 7px; color: var(--muted); } a.icb:hover { background: var(--brand-bg); color: var(--brand); text-decoration: none; }
table.list td a .ti { margin-right: 4px; }

/* სიის ფილტრი */
.filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filter .inp { flex: 1; min-width: 240px; position: relative; display: flex; } .filter .inp .ti { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #A39BA8; font-size: 17px; } .filter .inp input { width: 100%; padding-left: 36px; }
.letters { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.letters a { min-width: 30px; text-align: center; padding: 4px 0; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); color: inherit; font-weight: 600; font-size: 13px; transition: border-color .12s, background .12s; }
.letters a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; } .letters a.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.pg { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* შესვლა */
body.guest { background: radial-gradient(1200px 600px at 50% -10%, #F6DDEB 0%, var(--bg) 60%); min-height: 100vh; }
.login { max-width: 360px; margin: 11vh auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 30px 28px; display: flex; flex-direction: column; gap: 13px; box-shadow: 0 12px 40px rgba(122, 0, 75, .12); text-align: center; }
.login img { margin: 0 auto; border-radius: 16px; } .login h1 { margin: 4px 0 0; color: var(--brand); } .login p { margin: -8px 0 6px; font-size: 13px; }
.login label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: #57525C; text-align: left; } .login .flash { text-align: left; margin: 0; }

/* რედაქტორი */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; } @media (max-width: 1100px) { .editor { grid-template-columns: 1fr; } }
.editor form, .editor aside { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow); }
.editor aside { position: sticky; top: 66px; padding: 0; overflow: hidden; }
.pvh { display: flex; align-items: center; gap: 7px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 13px; background: var(--soft); } .pvh .ti { color: var(--brand); } .pvh span { font-weight: 400; margin-left: 4px; }
#preview { width: 100%; height: calc(100vh - 170px); min-height: 420px; border: 0; display: block; background: #F8F7F4; }
.fields { display: grid; grid-template-columns: 1.3fr 1.3fr 1fr; gap: 12px; } @media (max-width: 700px) { .fields { grid-template-columns: 1fr; } }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: #57525C; margin-top: 14px; text-transform: uppercase; letter-spacing: .03em; }
label.f input, label.f select { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 400; color: var(--ink); } .f-headword input { font-weight: 600; font-size: 15px; }
.fields label.f { margin-top: 0; } label.f small { font-weight: 400; color: var(--muted); text-transform: none; letter-spacing: 0; font-family: 'JetBrains Mono', monospace; font-size: 11.5px; }
.richhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 4px; }
.modes { display: inline-flex; border: 1px solid var(--line2); border-radius: var(--r); overflow: hidden; background: var(--soft); padding: 2px; gap: 2px; }
.modes button { display: inline-flex; align-items: center; gap: 5px; font: inherit; font-size: 12.5px; border: 0; background: none; padding: 4px 12px; cursor: pointer; color: var(--muted); border-radius: 7px; }
.modes button:hover { color: var(--brand); } .modes button.on { background: var(--brand); color: #fff; font-weight: 600; box-shadow: 0 1px 3px rgba(122, 0, 75, .3); }
.tools { display: flex; gap: 3px; flex-wrap: wrap; margin: 7px 0; padding: 4px; background: var(--soft); border: 1px solid var(--line); border-radius: var(--r); } .tools span { width: 1px; background: var(--line2); margin: 3px 5px; }
.tools button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; font: inherit; cursor: pointer; border: 1px solid transparent; background: none; border-radius: 6px; min-width: 30px; height: 30px; padding: 0 7px; color: #45404A; }
.tools button .ti { font-size: 17px; } .tools button.ch { font-size: 15px; } .tools button.wide { font-size: 12.5px; }
.tools button:hover { background: #fff; border-color: var(--brand-line); color: var(--brand); }
textarea.rich { width: 100%; height: calc(100vh - 440px); min-height: 320px; line-height: 1.65; resize: vertical; }
.msgs { list-style: none; margin: 10px 0 0; padding: 0; font-size: 13px; } .msgs li { padding: 6px 11px 6px 30px; border-radius: 7px; margin-bottom: 4px; position: relative; }
.msgs li:before { font-family: 'tabler-icons'; position: absolute; left: 9px; top: 5px; font-size: 15px; }
.msgs .err { background: #FDECEA; color: var(--err); } .msgs .err:before { content: '\ea05'; } .msgs .warn { background: #FFF6E0; color: var(--warn); } .msgs .warn:before { content: '\ea06'; }
.actions { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ისტორია */
.diff { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; font-family: 'JetBrains Mono', monospace; font-size: 12.5px; line-height: 1.75; overflow-wrap: anywhere; box-shadow: var(--shadow); }
.diff p { margin: 0 0 8px; } .diff p:last-child { margin: 0; } .diff p.same { color: var(--muted); font-family: 'Noto Sans', 'Noto Sans Georgian', sans-serif; font-size: 12px; }
del { background: #FBD5D0; color: #8E1B12; text-decoration: line-through; border-radius: 3px; padding: 0 1px; } ins { background: #CDEFD7; color: #145A2C; text-decoration: none; border-radius: 3px; padding: 0 1px; }

/* შემოკლებები, მომხმარებლები */
.abbr { display: grid; grid-template-columns: 170px 1fr 1fr 86px; gap: 7px; align-items: center; padding: 3px 0; }
.abbr.head { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 18px; text-transform: uppercase; letter-spacing: .04em; padding: 0 2px 4px; }
.abbr.new { grid-template-columns: 170px 1fr 1fr auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; box-shadow: var(--shadow); }
.abbr input[name=abbr] { font-weight: 600; } .abbr.review input[name=abbr] { border-color: #E0B24A; background: #FFF9E8; } .abbr .acts { display: flex; gap: 4px; }
.abbr:not(.new):not(.head) .btn.sq { border-color: transparent; background: none; color: var(--muted); box-shadow: none; } .abbr:not(.new):hover .btn.sq { border-color: var(--line2); background: #fff; color: var(--ink); } .abbr:not(.new):hover .btn.sq.danger { color: var(--err); }
@media (max-width: 800px) { .abbr, .abbr.new { grid-template-columns: 1fr; } .abbr.head { display: none; } }
.user { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 9px; box-shadow: var(--shadow); } .user b { min-width: 120px; display: inline-flex; align-items: center; gap: 6px; } .user b .ti { color: var(--brand); }
.chk { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; margin-right: 8px; } .chk input { accent-color: var(--brand); width: 15px; height: 15px; padding: 0; } .dl { display: inline-flex; flex-wrap: wrap; background: var(--soft); border-radius: 8px; padding: 5px 4px 5px 10px; }

/* „ნაწილებად“ რეჟიმი */
.parts { max-height: calc(100vh - 350px); min-height: 320px; overflow-y: auto; padding: 2px 8px 2px 2px; margin-right: -8px; }
.parts .sec { margin: 18px 0 8px; font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--brand); border-bottom: 1px solid var(--brand-line); padding-bottom: 5px; } .parts .sec:first-child { margin-top: 4px; }
.parts .sec small { font-weight: 400; color: var(--muted); text-transform: none; letter-spacing: 0; font-size: 12px; }
.sense { border: 1px solid var(--line); border-left: 3px solid var(--brand-line); border-radius: 11px; padding: 11px 13px; margin-bottom: 10px; background: #FDFCFA; transition: border-color .12s; } .sense:focus-within { border-left-color: var(--brand); }
.sh { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; } .sh .sp { flex: 1; } .sl { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.sense .num { width: 26px; height: 26px; border-radius: 8px; background: var(--brand); color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.sub { margin: 9px 0 9px 12px; padding-left: 12px; border-left: 2px solid var(--brand-line); } .sub .lab { width: 54px; padding: 3px 7px; font-weight: 700; color: var(--brand); }
.ed { border: 1px solid var(--line2); border-radius: 8px; padding: 6px 10px; background: #fff; min-height: 34px; overflow-wrap: anywhere; transition: border-color .12s, box-shadow .12s; }
.ed:empty:before { content: attr(data-ph); color: #B5AEA3; }
.ed.lead { font-weight: 600; } .ed i { color: #1F6B4A; } .ed .xr { background: #E8F0FE; color: #1D4ED8; border-radius: 10px; padding: 0 7px; }
.exs { margin-top: 8px; }
.ex { display: grid; grid-template-columns: 1fr 1fr 28px 28px; gap: 6px; align-items: start; margin-bottom: 5px; } .ex.blk { grid-template-columns: 56px 1fr 1fr 28px 28px; }
.ex .en { font-weight: 600; } .sym { padding: 6px 4px; }
.parts button.x, .parts button.mv { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 32px; border: 0; background: none; cursor: pointer; padding: 0; color: #B4ADA3; border-radius: 6px; } .parts button .ti { font-size: 16px; }
.parts button.mv:hover { background: var(--brand-bg); color: var(--brand); } .parts button.x:hover { background: #FDECEA; color: var(--err); }
.parts button.add { display: inline-flex; align-items: center; gap: 4px; font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; border: 1px dashed var(--brand-line); background: none; border-radius: 7px; padding: 4px 11px; color: var(--brand); margin-top: 4px; }
.parts button.add:hover { background: var(--brand-bg); border-style: solid; } .parts button.add.big { width: 100%; justify-content: center; padding: 9px; }

/* საკუთარი დიალოგი (ბრაუზერის ფანჯრების ნაცვლად) */
.dlg-bg { position: fixed; inset: 0; z-index: 100; background: rgba(30, 20, 30, .45); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: dlgIn .12s ease; }
.dlg { background: var(--surface); border-radius: 16px; padding: 24px 24px 18px; max-width: 420px; width: 100%; box-shadow: 0 20px 60px rgba(30, 20, 30, .3); text-align: center; animation: dlgUp .16s ease; }
.dlg-ic { font-size: 30px; width: 54px; height: 54px; border-radius: 50%; background: var(--brand-bg); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; }
.dlg.danger .dlg-ic { background: #FDECEA; color: var(--err); } .dlg.danger .btn.primary { background: var(--err); border-color: var(--err); box-shadow: none; } .dlg.danger .btn.primary:hover { background: #96211A; border-color: #96211A; }
.dlg p { margin: 14px 0 20px; font-size: 14.5px; line-height: 1.55; } .dlg-btns { display: flex; gap: 8px; justify-content: center; } .dlg-btns .btn { min-width: 110px; }
@keyframes dlgIn { from { opacity: 0; } to { opacity: 1; } } @keyframes dlgUp { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* წვრილმანები */
label.f input, label.f select { width: 100%; min-width: 0; }
.fields > label.f { min-width: 0; }
.user input[name=name] { flex: 1; min-width: 180px; } .user input[type=password] { min-width: 240px; } .user select { min-width: 150px; } .user .btn { margin-left: auto; }

/* ლოგო (წიგნების დასტა + წარწერა) */
.plogo { display: inline-flex; align-items: center; gap: 11px; color: #fff; line-height: 1.1; }
.plogo svg { width: 34px; height: 28px; flex: none; } .plogo .slit { fill: var(--brand); }
.plogo > span { display: flex; flex-direction: column; font-family: 'Noto Sans Georgian', sans-serif; }
.plogo small { font-size: 9.5px; letter-spacing: .09em; opacity: .9; font-weight: 600; } .plogo b { font-size: 15.5px; letter-spacing: .05em; font-weight: 700; }
.top .brand { margin-right: 10px; }
.login { padding: 0; overflow: hidden; gap: 0; text-align: left; }
.lhead { background: linear-gradient(135deg, var(--brand), var(--brand-2)); padding: 26px 20px; display: flex; justify-content: center; }
.lhead .plogo svg { width: 52px; height: 43px; } .lhead .plogo small { font-size: 12px; } .lhead .plogo b { font-size: 21px; } .lhead .plogo { gap: 15px; }
.lbody { padding: 22px 26px 26px; display: flex; flex-direction: column; gap: 13px; }
.lcorner { position: fixed; top: 14px; right: 16px; } .lcorner .link { color: var(--muted); padding: 8px; border-radius: 9px; } .lcorner .link:hover { background: var(--surface); color: var(--brand); } .lcorner .ti { font-size: 20px; }

/* ბნელი რეჟიმი (საიტის პარამეტრი dict_theme) */
[data-theme="dark"] {
  --brand: #D9609F; --brand-2: #B23B7F; --brand-bg: #3A1E2E; --brand-line: #5A3349;
  --line: #34303A; --line2: #46414D; --muted: #A49CAB; --ink: #ECE8F0; --bg: #17151B; --surface: #211E26; --soft: #27232D;
  --ok: #6FCF8E; --warn: #E5B95C; --err: #F08A80;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
  color-scheme: dark;
}
[data-theme="dark"] .top, [data-theme="dark"] .lhead { background: linear-gradient(90deg, #5E0B3D, #7A1452); box-shadow: 0 2px 10px rgba(0, 0, 0, .4); }
[data-theme="dark"] .plogo .slit { fill: #6A0F47; }
[data-theme="dark"] body.guest { background: radial-gradient(1200px 600px at 50% -10%, #3A1E2E 0%, var(--bg) 60%); }
[data-theme="dark"] .btn.primary, [data-theme="dark"] .modes button.on, [data-theme="dark"] .letters a.on, [data-theme="dark"] .sense .num { background: #A8286F; border-color: #A8286F; color: #fff; }
[data-theme="dark"] .btn.primary:hover { background: #BF3A84; border-color: #BF3A84; }
[data-theme="dark"] .btn:hover { background: var(--soft); box-shadow: none; }
[data-theme="dark"] .ed, [data-theme="dark"] .abbr:not(.new):hover .btn.sq { background: var(--surface); }
[data-theme="dark"] .sense { background: var(--soft); } [data-theme="dark"] #preview { background: #17151B; }
[data-theme="dark"] table.list tr:hover td { background: #2A2530; } [data-theme="dark"] table.list td { border-bottom-color: #2C2832; }
[data-theme="dark"] td.clip, [data-theme="dark"] label.f, [data-theme="dark"] .login label, [data-theme="dark"] .tools button { color: #C9C2D0; }
[data-theme="dark"] .tools button:hover { background: var(--surface); }
[data-theme="dark"] .flash.ok { background: #16301F; border-color: #27523A; } [data-theme="dark"] .flash.warn, [data-theme="dark"] .msgs .warn { background: #33290F; border-color: #5B4A1B; } [data-theme="dark"] .flash.err, [data-theme="dark"] .msgs .err, [data-theme="dark"] .dlg.danger .dlg-ic { background: #3A1A17; border-color: #6A2E28; }
[data-theme="dark"] .tag.warn { background: #4A3A12; } [data-theme="dark"] .abbr.review input[name=abbr] { background: #33290F; border-color: #8A6E22; }
[data-theme="dark"] del { background: #5A211C; color: #FFB4AC; } [data-theme="dark"] ins { background: #1D4A2C; color: #A9EBBE; }
[data-theme="dark"] .ed i { color: #7FD4A6; } [data-theme="dark"] .ed .xr { background: #1E2D4D; color: #9DBBFF; }
[data-theme="dark"] .card.off .cic { background: #2E2A34; color: #6F6876; } [data-theme="dark"] .card.off b { color: #8E8795; }
[data-theme="dark"] input::placeholder, [data-theme="dark"] .ed:empty:before { color: #6F6876; }
[data-theme="dark"] .dlg-bg { background: rgba(0, 0, 0, .6); }

/* ლოგო: ნაკლებად კაშკაშა და ნაკლებად მსხვილი */
.plogo { color: rgba(255, 255, 255, .88); }
.plogo svg { opacity: .92; }
.plogo small { font-weight: 500; opacity: .8; }
.plogo b { font-weight: 600; letter-spacing: .06em; }

/* რედაქტორის სვეტი */
.tag.ok { display: inline-block; background: #E3F4E8; color: var(--ok); border-radius: 6px; padding: 1px 8px; font-size: 12px; font-weight: 600; }
.tag.draft { display: inline-block; background: #EEEAE3; color: var(--muted); border-radius: 6px; padding: 1px 8px; font-size: 12px; font-weight: 600; } .tag.warn { padding: 1px 8px; font-weight: 600; }
[data-theme="dark"] .tag.ok { background: #16301F; } [data-theme="dark"] .tag.draft { background: #2E2A34; }
.post { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 22px 20px; box-shadow: var(--shadow); max-width: 900px; }
.post .ptitle { font-size: 19px !important; font-weight: 700 !important; padding: 10px 12px; }
.post .tools.rt { margin-top: 14px; position: sticky; top: 56px; z-index: 5; }
.rtext { min-height: 340px; border: 1px solid var(--line2); border-radius: var(--r); padding: 16px 20px; background: var(--surface); font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; }
.rtext:focus { outline: 0; border-color: #C27CA4; box-shadow: 0 0 0 3px rgba(194, 124, 164, .22); } .rtext:empty:before { content: attr(data-ph); color: #B0A9A0; } .rtext.busy { opacity: .55; pointer-events: none; }
.rtext p { margin: 0 0 12px; } .rtext h2 { font-size: 21px; margin: 22px 0 8px; display: block; } .rtext h3 { font-size: 17px; margin: 18px 0 6px; color: inherit; text-transform: none; letter-spacing: 0; }
.rtext blockquote { margin: 12px 0; padding: 4px 16px; border-left: 3px solid var(--brand-line); color: var(--muted); } .rtext ul, .rtext ol { margin: 0 0 12px; padding-left: 24px; }
.rtext img { max-width: 100%; height: auto; border-radius: 8px; display: block; } .rtext iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 8px; display: block; background: #000; }
.rtext a[href^="/v2/uploads/"] { display: inline-flex; align-items: center; gap: 6px; background: var(--soft); border: 1px solid var(--line2); border-radius: 8px; padding: 3px 10px; font-size: 14px; }
.rtext a[href^="/v2/uploads/"]:before { font-family: 'tabler-icons'; content: '\eb02'; }
.pmeta { display: grid; grid-template-columns: 1.2fr 1fr 1.3fr; gap: 12px; } @media (max-width: 700px) { .pmeta { grid-template-columns: 1fr; } }
.actions .grow { flex: 1; }
.dlg-inp { width: 100%; margin: -6px 0 18px; text-align: left; }

.langtabs { display: inline-flex; gap: 2px; background: var(--soft); border: 1px solid var(--line2); border-radius: var(--r); padding: 2px; }
.langtabs button { font: inherit; font-size: 13px; border: 0; background: none; padding: 5px 16px; cursor: pointer; color: var(--muted); border-radius: 7px; } .langtabs button small { opacity: .7; }
.langtabs button.on { background: var(--brand); color: #fff; font-weight: 600; } [data-theme="dark"] .langtabs button.on { background: #A8286F; }
.rtext table { border-collapse: collapse; margin: 0 0 12px; } .rtext td, .rtext th { border: 1px solid var(--line2); padding: 4px 9px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60; background: var(--ink, #1c2430); color: var(--bg, #fff); padding: 10px 18px; border-radius: 10px; font-size: 14px; box-shadow: 0 8px 28px rgba(0,0,0,.25); transition: opacity .4s; max-width: calc(100vw - 32px); }
.toast.out { opacity: 0; }
.dlg-btns { flex-wrap: wrap; }

/* ანგარიშები, ნიშნულები, წაშლა */
.rtabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.rtabs a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line2); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: 13px; }
.rtabs a:hover { border-color: var(--brand); } .rtabs a.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
[data-theme="dark"] .rtabs a.on { background: #A8286F; border-color: #A8286F; }
.rtabs.sub a { padding: 3px 10px; font-size: 12px; }
p.note { background: var(--soft); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; margin: 0 0 14px; max-width: 900px; }
.bar.thin { margin: 0 0 8px; } .bar.thin h1 { display: none; }
form.inl { display: inline; }
table.rep td { vertical-align: top; } table.rep td.num { text-align: right; white-space: nowrap; }
details.chg { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); margin: 0 0 6px; }
details.chg summary { cursor: pointer; padding: 9px 14px; list-style-position: inside; } details.chg[open] summary { border-bottom: 1px solid var(--line); }
.chg-body { padding: 10px 14px; overflow-x: auto; }
.tag.act-create { background: #E3F4E8; color: #1D6B36; } .tag.act-update { background: var(--soft); color: var(--muted); } .tag.act-delete { background: #FBE6E6; color: #A32020; } .tag.act-restore { background: #E5EEFB; color: #1F4F9C; }
.tag.mark-review { background: #FFF1D6; color: #8A5A00; } .tag.mark-done { background: #E3F4E8; color: #1D6B36; } .tag.note { background: var(--soft); color: var(--muted); cursor: help; }
[data-theme="dark"] .tag.act-create, [data-theme="dark"] .tag.mark-done { background: #1E3A28; color: #9EDDB0; } [data-theme="dark"] .tag.act-delete { background: #47201F; color: #F2A6A6; }
[data-theme="dark"] .tag.act-restore { background: #1F2F4A; color: #A9C6F5; } [data-theme="dark"] .tag.mark-review { background: #453410; color: #F3CF7A; }
fieldset.work { border: 1px dashed var(--line2); border-radius: var(--r); padding: 10px 12px; margin: 14px 0 0; display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
fieldset.work legend { font-size: 12px; font-weight: 600; padding: 0 6px; display: inline-flex; gap: 6px; align-items: center; } fieldset.work legend .muted { font-weight: 400; }
fieldset.work select, fieldset.work textarea { font: inherit; border: 1px solid var(--line2); border-radius: 8px; background: var(--surface); color: var(--ink); padding: 6px 10px; }
fieldset.work textarea { flex: 1; min-width: 240px; resize: vertical; }
.delform { margin-top: 18px; } .btn.danger { color: var(--err, #B3261E); border-color: currentColor; background: none; }
.btn.sm { padding: 3px 10px; font-size: 12px; font-weight: 400; vertical-align: middle; margin-left: 8px; }
.tag { display: inline-block; border-radius: 6px; padding: 1px 8px; font-size: 12px; }

/* ასოს იმპორტი და ექსპორტი */
ul.plain { margin: 0 0 14px; padding-left: 18px; } ul.plain li { margin: 2px 0; }
.hwlist { line-height: 2; } .hwlist span, .hwlist a { display: inline-block; background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; margin: 0 2px 2px 0; font-size: 13px; line-height: 1.6; color: var(--ink); text-decoration: none; }
.applybox { position: sticky; bottom: 0; background: var(--surface); border: 1px solid var(--line2); border-radius: 14px; padding: 14px 18px; margin-top: 22px; box-shadow: 0 -6px 24px rgba(0,0,0,.08); }
.applybox .chk { display: block; margin-bottom: 10px; } .applybox .actions { display: flex; gap: 10px; align-items: center; }
.expgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; max-width: 900px; }
.expl { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; background: var(--surface); } .expl b { flex: 1; font-size: 15px; } .expl a { font-size: 12px; }
.filter input[type=file] { font: inherit; padding: 5px; border: 1px dashed var(--line2); border-radius: var(--r); background: var(--surface); color: var(--ink); max-width: 320px; }

/* წერილები (საკონტაქტო ფორმა) */
.top .mods a .nb { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px; background: #fff; color: var(--brand); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rtabs a small { opacity: .7; font-variant-numeric: tabular-nums; }
.tag.msg-new { background: var(--brand-bg); color: var(--brand); font-weight: 600; } .tag.msg-read, .tag.msg-archived { background: var(--soft); color: var(--muted); } .tag.msg-spam { background: #FBE6E6; color: #A32020; }
[data-theme="dark"] .tag.msg-new { background: #4A1A36; color: #F3B4D6; } [data-theme="dark"] .tag.msg-spam { background: #47201F; color: #F2A6A6; }
table.msgs-list td.from { width: 230px; overflow-wrap: anywhere; } table.msgs-list td.when { white-space: nowrap; width: 110px; } table.msgs-list a { color: inherit; }
table.msgs-list tr.unread td.from a, table.msgs-list tr.unread a.subj { font-weight: 700; color: var(--ink); } table.msgs-list tr.unread td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
table.msgs-list .snip { font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.msg-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); } .msg-head b { font-size: 15.5px; margin-right: 6px; }
.msg-body { padding: 18px 0; font-size: 15.5px; line-height: 1.7; overflow-wrap: anywhere; }
.msg-foot { padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; } .msg .actions { flex-wrap: wrap; }
.msg-set textarea { width: 100%; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 14px; color: var(--ink); line-height: 1.6; } p.note .ti { vertical-align: -2px; }
@media (max-width: 800px) { table.msgs-list td.from { width: auto; } }
