/* Hia Jab Browser V.10.0.3 — extra panels, terminal, extensions, installer, PWA */
:root{
  --accent:#8ab4f8;
  --accent-2:#aecbfa;
  --bg:#202124;
  --ink:#e8eaed;
  --muted:#9aa0a6;
  --line:#8ab4f82e;
  --panel:#202124;
  --danger:#f28b82;
  --ok:#8ab4f8;
}
*{box-sizing:border-box}
html,body,#root{height:100%;margin:0}
body{background:var(--bg);color:var(--ink);font-family:"IBM Plex Sans Thai",Manrope,sans-serif;overflow:hidden}
button{cursor:pointer}
kbd{font:600 10px Manrope,ui-monospace,monospace;background:#202124;border:1px solid #3c4043;border-radius:5px;padding:1px 5px;color:#9aa0a6}
.hidden{display:none !important}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}

/* window overlay for PWA */
@media (display-mode: window-controls-overlay){
  .tab-strip{-webkit-app-region:drag;padding-right:env(titlebar-area-width,0)}
}

.status-bar{
  z-index:40;position:absolute;left:0;right:0;bottom:0;height:26px;
  display:flex;align-items:center;gap:10px;padding:0 12px;
  background:#202124f2;border-top:1px solid var(--line);font:600 10px Manrope,sans-serif;color:#9aa0a6
}
.status-bar b{color:var(--accent);font-weight:800}
.status-bar .grow{flex:1}
.status-bar button{background:0;border:0;color:#9aa0a6;height:22px;padding:0 8px;border-radius:6px;font:inherit}
.status-bar button:hover{background:#8ab4f814;color:#e8eaed}

.dock{
  position:absolute;left:50%;bottom:36px;transform:translateX(-50%);
  display:flex;gap:6px;padding:6px;background:#202124e8;border:1px solid var(--line);
  border-radius:16px;z-index:35;box-shadow:0 18px 40px #00000080
}
.dock button{
  width:42px;height:42px;border:1px solid #8ab4f821;border-radius:12px;background:#202124;
  color:#e8eaed;display:grid;place-items:center
}
.dock button:hover{border-color:#8ab4f86b;background:#8ab4f817;transform:translateY(-3px)}
.dock button.active{border-color:#8ab4f8;box-shadow:0 0 0 2px #8ab4f833}

.internal-page{height:100%;overflow:auto;padding:28px 32px 70px;position:relative}
.internal-page h1{margin:0 0 6px;font:800 28px Manrope,sans-serif;color:#e8eaed}
.internal-page .lead{color:#9aa0a6;margin:0 0 22px;font-size:13px}
.page-toolbar{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:18px}
.page-toolbar input,.page-toolbar select{
  background:#202124;border:1px solid #8ab4f829;border-radius:9px;color:#e8eaed;
  min-height:36px;padding:0 12px;font:inherit
}
.ghost-btn,.accent-btn,.danger-btn{
  border-radius:9px;min-height:36px;padding:0 14px;font:700 12px Manrope,sans-serif;border:1px solid #8ab4f83d;background:0;color:#e8eaed
}
.accent-btn{background:linear-gradient(135deg,#8ab4f8,#aecbfa);color:#202124;border:0}
.danger-btn{border-color:#d25b802e;background:#8f2d4d1a;color:#f28b82}

.app-grid,.ext-grid{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px
}
.app-card,.ext-card{
  background:#202124e0;border:1px solid #8ab4f821;border-radius:14px;padding:14px;display:grid;gap:8px
}
.app-card:hover,.ext-card:hover{border-color:#8ab4f84d;background:#202124f0}
.app-card header,.ext-card header{display:flex;gap:10px;align-items:center}
.app-icon,.ext-icon{
  width:42px;height:42px;border-radius:11px;background:#8ab4f814;border:1px solid #8ab4f82e;
  display:grid;place-items:center;font-size:18px;overflow:hidden
}
.app-icon img,.ext-icon img{width:100%;height:100%;object-fit:cover}
.app-card h3,.ext-card h3{margin:0;font:800 13px Manrope,sans-serif}
.app-card p,.ext-card p{margin:0;color:#9aa0a6;font-size:11px;line-height:1.45}
.card-actions{display:flex;gap:6px;flex-wrap:wrap}
.chip{font:700 9px Manrope,sans-serif;color:#8ab4f8;background:#8ab4f814;border-radius:99px;padding:3px 8px}

.drop-zone{
  border:1.5px dashed #8ab4f847;border-radius:16px;padding:28px;text-align:center;color:#9aa0a6;
  background:#8ab4f806;margin-bottom:16px
}
.drop-zone.drag{border-color:#8ab4f8;background:#8ab4f812;color:#e8eaed}

/* Terminal */
.terminal-panel{
  position:absolute;left:0;right:0;bottom:26px;height:38%;min-height:180px;max-height:72%;
  background:#202124f8;border-top:1px solid #8ab4f838;z-index:45;display:none;flex-direction:column
}
.terminal-panel.open{display:flex}
.terminal-head{
  display:flex;align-items:center;gap:8px;height:34px;padding:0 10px;border-bottom:1px solid #8ab4f81f;
  font:700 11px Manrope,sans-serif
}
.terminal-head span{color:#8ab4f8}
.terminal-head .grow{flex:1}
.term-tabs{display:flex;gap:4px;overflow:auto}
.term-tab{background:0;border:0;color:#9aa0a6;border-radius:7px 7px 0 0;padding:6px 10px;font:700 10px Manrope,sans-serif}
.term-tab.active{background:#202124;color:#e8eaed}
.terminal-body{flex:1;overflow:auto;padding:10px 14px;font:13px/1.55 "IBM Plex Mono",ui-monospace,Menlo,monospace;color:#e8eaed;white-space:pre-wrap}
.terminal-body .cmd{color:#8ab4f8}
.terminal-body .err{color:#f28b82}
.terminal-body .ok{color:#8ab4f8}
.terminal-body .muted{color:#9aa0a6}
.terminal-input-row{
  display:flex;align-items:center;gap:8px;border-top:1px solid #8ab4f81f;padding:6px 10px;background:#202124
}
.terminal-input-row b{color:#8ab4f8;font:700 12px ui-monospace,monospace;white-space:nowrap}
.terminal-input-row input{
  flex:1;background:0;border:0;outline:0;color:#e8eaed;font:13px "IBM Plex Mono",ui-monospace,Menlo,monospace
}
.term-resize{height:6px;cursor:ns-resize;background:#8ab4f814}

/* Command palette */
.palette-overlay{position:fixed;inset:0;background:#00000073;z-index:80;display:none;place-items:start center;padding-top:12vh}
.palette-overlay.open{display:grid}
.palette{
  width:min(640px,92vw);background:#202124fa;border:1px solid #8ab4f847;border-radius:16px;
  box-shadow:0 30px 80px #000000a3;overflow:hidden
}
.palette input{
  width:100%;background:0;border:0;border-bottom:1px solid #8ab4f821;color:#e8eaed;
  font:600 15px Manrope,sans-serif;padding:14px 16px;outline:0
}
.palette-list{max-height:360px;overflow:auto}
.palette-list button{
  width:100%;text-align:left;background:0;border:0;color:#e8eaed;padding:10px 16px;
  display:flex;gap:10px;align-items:center;font:600 12px Manrope,sans-serif
}
.palette-list button.active,.palette-list button:hover{background:#8ab4f814}
.palette-list small{margin-left:auto;color:#9aa0a6}

/* Installer / shortcut wizard */
.wizard{
  width:min(560px,94vw);max-height:min(680px,90vh);overflow:auto;
  background:linear-gradient(#202124,#202124);border:1px solid #8ab4f82e;border-radius:17px;padding:18px
}
.wizard h2{margin:0 0 4px;font:800 18px Manrope,sans-serif}
.steps{display:flex;gap:6px;margin:12px 0 16px}
.steps i{flex:1;height:4px;border-radius:99px;background:#292a2d}
.steps i.on{background:linear-gradient(90deg,#8ab4f8,#aecbfa)}
.field{display:grid;gap:5px;margin-bottom:10px;font-size:12px;color:#9aa0a6}
.field input,.field select,.field textarea{
  background:#202124;border:1px solid #8ab4f829;border-radius:8px;color:#e8eaed;min-height:36px;padding:8px 10px;font:inherit
}
.preview-row{display:flex;gap:12px;align-items:center;background:#202124bd;border:1px solid #8ab4f821;border-radius:12px;padding:10px}
.preview-row img{width:56px;height:56px;border-radius:12px;object-fit:cover}
.diag{margin-top:12px;display:grid;gap:6px;text-align:left;font:12px/1.5 system-ui,sans-serif}
.diag-row{background:#202124;border:1px solid #2cbf5f36;border-radius:8px;padding:7px 10px;color:#9aa0a6}
.diag-row.diag-bad{border-color:#f28b8250;color:#f28b82}
.diag-hint{color:#e6d36d;font-size:11.5px;padding:2px 2px 0}

/* Devtools extra */
.devtools-panel{
  position:absolute;left:0;right:0;bottom:26px;height:280px;background:#202124f2;
  border-top:1px solid #8ab4f821;z-index:44;display:none;flex-direction:column
}
.devtools-panel.open{display:flex}
.devtools-tabs{display:flex;gap:2px;padding:6px 8px;border-bottom:1px solid #8ab4f81a}
.devtools-tabs button{background:0;border:0;color:#9aa0a6;border-radius:7px;padding:6px 10px;font:700 10px Manrope,sans-serif}
.devtools-tabs button.active{background:#8ab4f814;color:#e8eaed}
.devtools-body{flex:1;overflow:auto;padding:8px 12px;font:12px/1.5 ui-monospace,Menlo,monospace;color:#e8eaed}
.console-line{padding:2px 0;border-bottom:1px solid #8ab4f80d}
.console-line.log{color:#e8eaed}
.console-line.warn{color:#e6d36d}
.console-line.error{color:#f28b82}
.console-line.info{color:#8ab4f8}

/* Security score */
.score-wrap{display:flex;gap:18px;align-items:center;margin:12px 0 18px}
.score-ring{
  width:88px;height:88px;border-radius:50%;
  background:conic-gradient(#8ab4f8 var(--p,72%), #292a2d 0);
  display:grid;place-items:center
}
.score-ring span{width:68px;height:68px;border-radius:50%;background:#202124;display:grid;place-items:center;font:800 20px Manrope,sans-serif}

/* Overlay / modal host */
.overlay{position:fixed;inset:0;background:#00000080;z-index:70;display:none;place-items:center;padding:18px}
.overlay.open{display:grid}

/* Site blocked overlay inside viewport */
.site-fallback{
  position:absolute;inset:0;display:grid;place-content:center;gap:10px;text-align:center;padding:24px;
  background:radial-gradient(circle at 50% 30%,#8ab4f814,#202124)
}
.site-fallback h2{margin:0;font:800 22px Manrope,sans-serif}
.site-fallback p{margin:0;color:#9aa0a6;max-width:420px}

.viewport{position:relative}
.web-frame{width:100%;height:100%;border:0;background:#fff;display:block}
.home-scroll{height:100%;overflow:auto;position:relative}

/* AI panel extras */
.ai-panel.open,.workspace-panel.open{display:flex;flex-direction:column}
.chat-thread{flex:1;overflow:auto;padding:12px;display:flex;flex-direction:column;gap:10px}
.message{border-radius:12px;padding:10px 12px;max-width:92%;font-size:12px;line-height:1.5}
.message.ai{align-self:flex-start;background:#292a2d;border:1px solid #8ab4f81f}
.message.user{align-self:flex-end;background:#26466e;color:#e8eaed}

/* Profile shortcut banner */
.profile-banner{
  display:flex;align-items:center;gap:8px;padding:6px 10px;margin:8px 12px 0;
  background:#8ab4f810;border:1px solid #8ab4f82e;border-radius:10px;font-size:11px
}

/* Install prompt */
.install-banner{
  position:absolute;right:16px;top:96px;z-index:36;width:280px;
  background:#202124fa;border:1px solid #8ab4f847;border-radius:14px;padding:12px;
  box-shadow:0 18px 40px #0008;display:none
}
.install-banner.show{display:block}

/* Context menu */
.ctx{
  position:fixed;z-index:90;min-width:180px;background:#202124fa;border:1px solid #8ab4f82e;
  border-radius:10px;padding:6px;display:none;box-shadow:0 16px 40px #0008
}
.ctx.open{display:grid}
.ctx button{background:0;border:0;text-align:left;color:#e8eaed;padding:8px 10px;border-radius:7px;font:600 12px Manrope,sans-serif}
.ctx button:hover{background:#8ab4f814}
.ctx hr{border:0;border-top:1px solid #8ab4f81a;margin:4px 0}

.brand-mark img{width:100%;height:100%;object-fit:cover;border-radius:inherit}
.hero-brand img{width:48px;height:48px;border-radius:11px;object-fit:cover}

.net-row,.hist-row{
  display:grid;grid-template-columns:70px 1fr 80px;gap:8px;padding:8px 0;border-bottom:1px solid #8ab4f814;font-size:11px
}
.badge{font:800 9px Manrope,sans-serif;padding:2px 6px;border-radius:6px;background:#8ab4f814;color:#8ab4f8}
.badge.err{background:#8f2d4d33;color:#f28b82}

.split-2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media(max-width:720px){
  .split-2{grid-template-columns:1fr}
  .dock{display:none}
  .internal-page{padding:18px 14px 80px}
}

/* Chrome-like extension details */
.ext-details{display:grid;gap:10px}
.perm-list{display:flex;flex-wrap:wrap;gap:6px}
.perm-list span{background:#202124;border:1px solid #8ab4f821;border-radius:8px;padding:4px 8px;font-size:10px;color:#9aa0a6}

/* File tree in sources */
.file-tree button{width:100%;text-align:left;background:0;border:0;color:#e8eaed;padding:4px 6px;border-radius:6px;font:12px ui-monospace,monospace}
.file-tree button:hover{background:#8ab4f812}

.toast-host{position:fixed;bottom:40px;left:50%;transform:translateX(-50%);z-index:95;display:grid;gap:8px}
.loading-bar{position:absolute;left:0;top:0;height:2px;width:0;background:linear-gradient(90deg,#8ab4f8,#43c7c7);z-index:50;transition:width .3s}

.clock-live{font:800 28px Manrope,sans-serif;color:#e8eaed}
.metric-val{font:800 16px Manrope,sans-serif;color:#8ab4f8}

/* font fallback for icons/symbols */
button,.tab-icon,.workspace-icon,.project-icon,.quick-links button{font-family:"IBM Plex Sans Thai",Manrope,"Segoe UI Symbol","Noto Sans Symbols 2","Noto Sans Symbols","Apple Symbols","Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif}
.toast{width:max-content;max-width:min(560px,86vw);white-space:normal;text-align:center}
#status-update{display:none}
#status-update.show{display:inline}

/* ==========================================================
   Hiajab Browser v10.2.0 — AI Panel / AI Page / GGUF Manager
   โทนเดียวกับแบรนด์: เขียวมะนาวบนพื้นกรมท่า
   ========================================================== */
.ai-page,.gguf-page{display:block}
.ai-full{display:grid;grid-template-columns:minmax(0,0.72fr) minmax(0,1.6fr);gap:14px;align-items:start}
.ai-full > .card:only-child,.ai-full > .ai-convs:only-child{grid-column:1 / -1}
@media (max-width:1000px){.ai-full{grid-template-columns:1fr}}
.ai-full-chat{min-height:62vh;display:flex;flex-direction:column}

/* --- การ์ด / หัวหน้าเพจ --- */
.card{background:linear-gradient(180deg,#292a2d,#292a2d);border:1px solid #3c404324;border-radius:14px;padding:14px;margin:0 0 14px;box-shadow:0 12px 30px #00000030}
.card-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 10px}
.card-head h2,.card-head h3{margin:0;font-size:13px;letter-spacing:.2px}
.card-head .grow,.page-head .grow{flex:1}
.card-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.page-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 0 14px}
.page-head h2{margin:0;font-size:18px}
.page-head .muted{font-size:11px}
.page-toolbar{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:0 0 12px}

/* --- แท็บ / ป้ายกำกับ --- */
.seg{display:inline-flex;gap:4px;background:#ffffff0a;border:1px solid #3c40432b;border-radius:11px;padding:3px}
.seg button{appearance:none;-webkit-appearance:none;border:0;background:transparent;color:#9aa0a6;border-radius:8px;padding:6px 11px;font:700 11px Manrope,sans-serif;cursor:pointer}
.seg button.on{background:linear-gradient(135deg,#8ab4f8,#aecbfa);color:#202124}
.pill{display:inline-flex;align-items:center;gap:5px;font:700 10px Manrope,sans-serif;padding:3px 8px;border-radius:999px;background:#ffffff0d;border:1px solid #3c40432b;color:#9aa0a6;white-space:nowrap}
.badge.danger,.ghost-btn.danger{background:#f28b821a;color:#f28b82;border-color:#f28b824a}

/* --- แถวข้อมูล / ตัวเลือก --- */
.row{display:flex;align-items:center;gap:9px;padding:8px 10px;border:1px solid #3c404324;border-radius:11px;background:#292a2d;margin:0 0 7px;flex-wrap:wrap}
.row .grow{flex:1;min-width:0}
.row .muted{font-size:11px}
.chk{display:flex;align-items:center;gap:8px;font-size:12px;color:#9aa0a6;margin:7px 0;cursor:pointer}
.chk input{accent-color:#8ab4f8;width:15px;height:15px}
.small{font-size:11px}

/* --- แชทในหน้า AI --- */
.chat-thread.tall{min-height:320px;max-height:56vh}
.ai-typing{display:inline-flex;gap:4px;align-items:center;padding:2px 0}
.ai-typing i{width:5px;height:5px;border-radius:50%;background:#8ab4f8;opacity:.45;animation:hiaType 1s infinite}
.ai-typing i:nth-child(2){animation-delay:.15s}
.ai-typing i:nth-child(3){animation-delay:.3s}
@keyframes hiaType{0%,100%{opacity:.25;transform:translateY(0)}50%{opacity:1;transform:translateY(-3px)}}
.ai-code{display:block;white-space:pre-wrap;word-break:break-word;background:#202124;border:1px solid #3c40432b;border-left:3px solid #8ab4f8;border-radius:9px;padding:9px 10px;margin:7px 0;font:11px/1.55 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;color:#e8eaed;max-height:340px;overflow:auto}
.ai-actions-log{display:grid;gap:5px;margin:10px 0 0}
.ai-actions-log .act{display:flex;gap:7px;align-items:center;font-size:10.5px;padding:5px 8px;border-radius:8px;background:#292a2d;border:1px solid #3c404324;color:#9aa0a6}
.ai-actions-log .act.ok{border-color:#8ab4f83d;color:#e8eaed}
.ai-actions-log .act.err{border-color:#f28b824a;color:#f28b82}

/* --- รายการบทสนทนา (คอลัมน์ซ้าย) --- */
.ai-convs{display:flex;flex-direction:column;gap:8px;background:linear-gradient(180deg,#292a2d,#292a2d);border:1px solid #3c404324;border-radius:14px;padding:12px;max-height:66vh}
.conv-list{display:grid;gap:6px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#3c4043 transparent}
.conv{appearance:none;-webkit-appearance:none;text-align:left;display:grid;gap:3px;background:#292a2d;border:1px solid #3c404324;border-radius:10px;padding:8px 10px;color:inherit;cursor:pointer;font:inherit}
.conv strong{font-size:12px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.conv small{font-size:10px;color:#9aa0a6}
.conv:hover{border-color:#3c404355}
.conv.active{border-color:#8ab4f866;background:#8ab4f812}

/* --- จัดการ GGUF --- */
.drop-zone,.gguf-drop{border:1.5px dashed #3c404344;border-radius:14px;background:#292a2d;transition:border-color .15s ease,background .15s ease}
.drop-zone.hot,.gguf-drop.hot{border-color:#8ab4f8;background:#8ab4f810}
.gguf-drop{text-align:center;padding:22px 16px}
.gguf-drop h3{margin:0 0 6px;font-size:14px}
.gguf-drop p{margin:4px 0;font-size:12px;color:#9aa0a6}
.gguf-opts{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;align-items:center;margin-top:12px;font-size:11px;color:#9aa0a6}
.gguf-opts label{display:flex;align-items:center;gap:6px}
.gguf-opts input[type="number"]{width:76px}
.gguf-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px;align-items:start}
@media (max-width:1000px){.gguf-grid{grid-template-columns:1fr}}
.gguf-queue{display:grid;gap:8px;margin-top:10px;max-height:38vh;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#3c4043 transparent}
.gguf-job{background:#292a2d;border:1px solid #3c404324;border-radius:11px;padding:9px 10px}
.job-top{display:flex;gap:8px;align-items:baseline;flex-wrap:wrap;font-size:12px}
.job-note{font-size:10.5px;color:#9aa0a6}
.job-bar{height:6px;border-radius:999px;background:#ffffff12;overflow:hidden;margin:7px 0 6px}
.job-bar i{display:block;height:100%;width:0;background:linear-gradient(135deg,#8ab4f8,#aecbfa);transition:width .25s ease}
.job-act{display:flex;gap:6px}
.job-act button{appearance:none;-webkit-appearance:none;background:#ffffff10;border:1px solid #ffffff22;color:inherit;border-radius:8px;padding:4px 9px;font:700 10px Manrope,sans-serif;cursor:pointer}
.gguf-list{display:grid;gap:7px;max-height:46vh;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#3c4043 transparent}
.gguf-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;background:#292a2d;border:1px solid #3c404324;border-radius:11px;padding:8px 10px;font-size:12px}
.gguf-row strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gguf-howto{margin:8px 0 0 18px;padding:0;font-size:11.5px;color:#9aa0a6;line-height:1.7}
.gguf-page .field input,.gguf-page .field select{max-width:100%}

/* --- โหมดขยายเต็มจอของแผง AI --- */
.ai-panel.ai-fullscreen{position:fixed;inset:0;z-index:9999;border-radius:0;width:auto;height:auto;max-width:none}

/* --- ปุ่มไฟล์แนบในแผง AI --- */
#ai-attach.on{background:#8ab4f81f;border-color:#8ab4f866}

/* ==========================================================
   โหมดสว่าง (theme-light.css ไม่รู้จักคลาสใหม่ จึงต้องประกาศเอง)
   ========================================================== */
html[data-theme="light"] .card,
html[data-theme="light"] .ai-convs{background:#ffffff;border-color:#3c404324;box-shadow:0 10px 24px #20212414}
html[data-theme="light"] .card-head h2,
html[data-theme="light"] .card-head h3,
html[data-theme="light"] .page-head h2,
html[data-theme="light"] .gguf-drop h3{color:#202124}
html[data-theme="light"] .row,
html[data-theme="light"] .conv,
html[data-theme="light"] .gguf-row,
html[data-theme="light"] .gguf-job,
html[data-theme="light"] .ai-actions-log .act{background:#f8f9fa;border-color:#3c404324}
html[data-theme="light"] .conv:hover{border-color:#3c404344}
html[data-theme="light"] .conv.active{border-color:#1a73e866;background:#e8f0fe}
html[data-theme="light"] .conv strong{color:#202124}
html[data-theme="light"] .conv small,
html[data-theme="light"] .job-note,
html[data-theme="light"] .gguf-drop p,
html[data-theme="light"] .gguf-opts,
html[data-theme="light"] .gguf-howto,
html[data-theme="light"] .chk,
html[data-theme="light"] .row .muted{color:#5f6368}
html[data-theme="light"] .seg{background:#ffffff;border-color:#3c404324}
html[data-theme="light"] .seg button{color:#5f6368}
html[data-theme="light"] .pill{background:#ffffff;border-color:#3c404324;color:#5f6368}
html[data-theme="light"] .badge.danger,
html[data-theme="light"] .ghost-btn.danger{background:#fce8e6;color:#d93025;border-color:#d930253d}
html[data-theme="light"] .drop-zone,
html[data-theme="light"] .gguf-drop{background:#f8f9fa;border-color:#3c404355}
html[data-theme="light"] .drop-zone.hot,
html[data-theme="light"] .gguf-drop.hot{border-color:#1a73e8;background:#e8f0fe}
html[data-theme="light"] .job-bar{background:#3c40431f}
html[data-theme="light"] .ai-code{background:#202124;color:#e8eaed;border-left-color:#1a73e8}
html[data-theme="light"] .ai-typing i{background:#1a73e8}
html[data-theme="light"] .ai-actions-log .act.ok{border-color:#1a73e855;color:#1a73e8}
html[data-theme="light"] .ai-actions-log .act.err{border-color:#d9302555;color:#d93025}
html[data-theme="light"] #ai-attach.on{background:#e8f0fe;border-color:#1a73e866}

/* --- กล่องพิมพ์ของแผง AI (ขวา) และหน้าศูนย์ AI --- */
.ai-panel .ai-composer{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:6px;align-items:center;padding:6px}
.ai-full-chat .ai-composer{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:6px;align-items:center;padding:6px}
.ai-panel .ai-composer input,.ai-full-chat .ai-composer input{background:transparent;border:0;outline:0;color:#e8eaed;font:inherit;min-width:0;width:100%}
.ai-panel .ai-composer input{font-size:11px;padding:7px 4px}
.ai-full-chat .ai-composer input{font-size:12.5px;padding:9px 8px}
.ai-panel .ai-composer input::placeholder,.ai-full-chat .ai-composer input::placeholder{color:#9aa0a6}
.ai-panel .ai-composer .send-button,.ai-full-chat .ai-composer .send-button{width:34px;height:30px;border-radius:9px;display:grid;place-items:center}
.ai-full-chat .ai-composer .ghost-btn{font-size:10px;padding:5px 9px}
.ai-attach{display:grid;place-items:center;width:30px;height:27px;border-radius:8px;cursor:pointer;color:#9aa0a6;font-size:13px;line-height:1}
.ai-attach:hover{background:#8ab4f817;color:#e8eaed}
.ai-attach.on{background:#8ab4f81f;color:#e8eaed}
.ai-footnote{color:#9aa0a6;font-size:9.5px;text-align:center;margin-top:6px}

html[data-theme="light"] .ai-panel .ai-composer input,
html[data-theme="light"] .ai-full-chat .ai-composer input{color:#202124}
html[data-theme="light"] .ai-panel .ai-composer input::placeholder,
html[data-theme="light"] .ai-full-chat .ai-composer input::placeholder{color:#5f6368}
html[data-theme="light"] .ai-attach{color:#5f6368}
html[data-theme="light"] .ai-attach:hover,
html[data-theme="light"] .ai-attach.on{background:#e8f0fe;color:#1a73e8}
html[data-theme="light"] .ai-footnote{color:#5f6368}
.ai-panel .ai-composer .send-button,.ai-full-chat .ai-composer .send-button{background:linear-gradient(135deg,#8ab4f8,#aecbfa);color:#202124;box-shadow:0 7px 18px #aecbfa33}
html[data-theme="light"] .ai-panel .ai-composer .send-button,
html[data-theme="light"] .ai-full-chat .ai-composer .send-button{background:linear-gradient(135deg,#1a73e8,#1a73e8);color:#ffffff}
.gguf-opts input[type="number"]{background:#202124;border:1px solid #8ab4f829;color:#e8eaed;border-radius:8px;padding:4px 6px;font:inherit}
.gguf-opts input[type="number"]:focus{outline:0;border-color:#8ab4f86b}
html[data-theme="light"] .gguf-opts input[type="number"]{background:#fff;border-color:#3c404324;color:#202124}
.gguf-drop.over,.gguf-drop.hot,.drop-zone.over{border-color:#8ab4f8;background:#8ab4f812}
html[data-theme="light"] .gguf-drop.over,
html[data-theme="light"] .gguf-drop.hot{border-color:#1a73e8;background:#e8f0fe}
/* --- หน้าตั้งค่า AI: การ์ดละแถว อ่านง่าย ไม่บีบ --- */
.ai-full-settings{grid-template-columns:1fr}
.ai-full > *{min-width:0}
.row.wrap{flex-wrap:wrap}
.row .field{margin:0;flex:1 1 132px;min-width:118px}
.row .field input,.row .field select{width:100%}
.row .chk{flex:0 0 auto}
.ai-page .muted,.ai-page .pill,.page-head h2{overflow-wrap:anywhere}
.field textarea{background:#202124;border:1px solid #8ab4f829;border-radius:9px;color:#e8eaed;font:inherit;font-size:12px;padding:8px 9px;resize:vertical;width:100%}
.field textarea:focus{outline:0;border-color:#8ab4f86b}
.gguf-job.done .job-act{display:none}
.gguf-job.err .job-bar i{background:#f28b82}
html[data-theme="light"] .field textarea{background:#fff;border-color:#3c404324;color:#202124}

.dock{display:none!important}
