@font-face{font-family:DM Sans;src:url('/web/dm-sans.ttf') format('truetype');font-weight:100 1000;font-display:swap}
:root{font-family:'DM Sans',system-ui,sans-serif;color:#162c25;background:#f3f6f3;line-height:1.45;--paper:#fff;--ink:#162c25;--muted:#536861;--line:#dbe6de;--brand:#146b53;--fold:#eef5ef;--dark:#103e34;--danger:#9b3030}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0}
h1,h2,h3,p{margin:0}
h1{font-size:1.1rem;font-weight:780;letter-spacing:-.015em}
h2{font-size:1.38rem;font-weight:770;letter-spacing:-.025em}
h3{font-size:1.08rem;font-weight:730}
button,input,select,textarea{font:inherit}
button{min-height:42px;border:1px solid transparent;border-radius:9px;background:var(--brand);color:white;font-weight:680;padding:.5rem .85rem;cursor:pointer;white-space:nowrap}
button:hover{background:#0b5742}
button:disabled{opacity:.55;cursor:wait}
button.secondary{border-color:#c8d9d0;background:#fff;color:#214839}
button.secondary:hover{background:var(--fold)}
button.danger{color:var(--danger)}
:is(button,input,select,textarea,a,[tabindex]):focus-visible{outline:2px solid #2d8a70;outline-offset:3px}
input,select,textarea{display:block;width:100%;min-width:0;border:1px solid #baccbf;border-radius:8px;padding:.57rem .7rem;min-height:42px;background:#fff;color:var(--ink)}
input:read-only{background:#f6f9f6}
textarea{resize:vertical}
label{display:grid;gap:.35rem;color:#2f4a3f;font-weight:660;font-size:.89rem;margin:.65rem 0}
label small,.hint{font-size:.85rem;font-weight:450;color:var(--muted)}
.hint:empty,.form-error:empty{display:none}
.check{display:flex;gap:.55rem;align-items:center}
.check input{width:18px;height:18px;min-height:0;accent-color:var(--brand);margin:0}
.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.skip{position:fixed;z-index:9;inset:.5rem auto auto 1rem;transform:translateY(-150%);background:white;padding:10px;color:var(--dark)}
.skip:focus{transform:none}
.topbar{background:var(--dark);color:white;border-bottom:1px solid #265745}
.topbar-inner{max-width:1320px;margin:auto;min-height:68px;display:flex;align-items:center;gap:2rem;padding:.5rem clamp(.75rem,3vw,2rem)}
.brand,.account,.topbar nav{display:flex;gap:.65rem;align-items:center}
.brand{flex:none}.brand img{width:38px;height:38px;border-radius:10px}
.topbar nav{gap:.35rem}.topbar nav button,.subtle{background:transparent;color:#e5f1ea}
.topbar nav button:is(:hover,[aria-current]){background:#275446;color:white}
.topbar nav button:focus-visible,.subtle:focus-visible{outline-color:#a6dfc5}
.account{margin-left:auto;min-width:0}.account-text{display:grid;min-width:0;font-size:.85rem;line-height:1.25}
.account-text strong{max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.account-text small{color:#c9dfd3}
.avatar{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;flex:none;background:#dcefe4;color:#20533f;font-weight:800;font-size:.85rem}
#utama{max-width:1320px;margin:1.25rem auto;padding:0 clamp(.75rem,3vw,2rem)}
.panel{background:var(--paper);border:1px solid var(--line);border-radius:14px}
.login{margin:clamp(2.5rem,9vh,7rem) auto 0;max-width:410px;padding:clamp(1.25rem,5vw,2rem)}
.login form{margin-top:1rem}.login button{width:100%;margin-top:.55rem}
.notice{margin:0 auto .8rem;padding:.55rem .85rem;background:#eef6ef;border:1px solid #c8ded1;border-radius:9px;max-width:100%;color:#20553d}
.notice.error,.form-error{color:var(--danger)}.notice.error{background:#fcf2ef;border-color:#edc6bf}
.workspace{display:grid;grid-template-columns:clamp(265px,27%,350px) minmax(0,1fr);height:calc(100dvh - 115px);min-height:530px;overflow:hidden}
.sidebar,.conversation,.thread{min-width:0;min-height:0;display:flex;flex-direction:column}
.sidebar{border-right:1px solid var(--line)}.sidebar-head{padding:1rem .9rem .8rem;display:grid;gap:.65rem}
.sidebar-head h2{font-size:1.2rem}.new-chat{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.4rem}
.contacts{overflow:auto;flex:1}.contacts>.hint{padding:1rem}
.contact-row{width:100%;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:.6rem;border:0;border-radius:0;border-bottom:1px solid #e9efe9;background:white;color:var(--ink);text-align:left;padding:.65rem .85rem;min-height:66px}
.contact-row:is(:hover,[aria-pressed=true]){background:#e9f3eb}.contact-row:focus-visible{outline-offset:-3px}
.contact-row strong,.contact-row small{display:block;overflow:hidden;text-overflow:ellipsis}
.contact-row small{color:var(--muted);font-weight:460}.contact-row time{font-size:.77rem;color:#576e63;font-weight:540}
.unread{place-self:center end;border-radius:20px;background:#d0ead9;color:#23573c;padding:.1rem .36rem;min-width:1.35rem;text-align:center;font-size:.78rem}
.queue{border-top:1px solid var(--line);font-size:.82rem;color:#4f6c5e;padding:.55rem .8rem}
.empty-thread{display:grid;place-items:center;flex:1;padding:1.5rem;text-align:center;color:var(--muted);background:#f5f8f4}
.thread{height:100%}.thread-head{display:flex;align-items:center;gap:.75rem;padding:.7rem 1rem;border-bottom:1px solid var(--line)}
.thread-head h2{font-size:1.05rem;overflow-wrap:anywhere}.thread-head p{font-size:.85rem;color:var(--muted)}
.history{min-height:0;flex:1;overflow:auto;background:#f1f6f0;display:flex;flex-direction:column;gap:.55rem;padding:1rem clamp(.7rem,3vw,2rem)}
.bubble{align-self:flex-start;max-width:min(85%,40rem);border:1px solid #dde8df;background:white;border-radius:12px 12px 12px 3px;padding:.52rem .68rem;overflow-wrap:anywhere;white-space:pre-wrap}
.bubble.out{align-self:flex-end;background:#e0f2e5;border-color:#cee5d5;border-radius:12px 12px 3px 12px}
.bubble-meta{color:#49665a;display:block;text-align:right;margin-top:.22rem;font-size:.75rem;white-space:normal}
.compose{padding:.55rem 1rem .75rem;border-top:1px solid var(--line)}
.compose label{margin:.25rem 0}.compose textarea{max-height:128px}.template-choice{max-width:280px}
.form-actions{display:flex;align-items:center;justify-content:flex-end;gap:.5rem;margin-top:.65rem;flex-wrap:wrap}.form-actions p{margin-right:auto}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 .75rem}
.settings{max-width:1100px;margin:auto}.settings-head,.section-head{display:flex;align-items:center;justify-content:space-between;gap:.75rem;flex-wrap:wrap}
.settings-head{margin-bottom:.95rem}.section-head{margin-bottom:.8rem}
.section-nav{display:flex;gap:.35rem;margin-bottom:.8rem;border-bottom:1px solid var(--line);overflow:auto}
.section-nav button{background:transparent;color:#3d584d;border-radius:9px 9px 0 0}.section-nav button:is([aria-current],:hover){background:#e4f0e6;color:#164e39}
.settings-panel{padding:clamp(.85rem,2.5vw,1.35rem)}
.role-notes{display:flex;gap:.8rem 1.4rem;flex-wrap:wrap;margin-bottom:.7rem;color:#4e6a5c;font-size:.86rem}
.table-frame{overflow:auto}table{width:100%;border-collapse:collapse;font-size:.9rem}
th,td{padding:.66rem .65rem;text-align:left;border-bottom:1px solid var(--line)}
th{font-size:.79rem;font-weight:700;color:#49675a;background:#f2f7f3;white-space:nowrap}
td:last-child{text-align:right}td:nth-child(2){overflow-wrap:anywhere}
td button{min-height:37px}.badge{font-size:.78rem;font-weight:680;border-radius:20px;background:#e8f2e9;color:#2a5840;padding:.2rem .48rem;white-space:nowrap}
.badge.off{background:#f4e9e8;color:#7f403d}
.gateways{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(0,1fr);gap:1rem;margin-top:.8rem}
fieldset{min-width:0;margin:0;border:1px solid var(--line);border-radius:10px;padding:.7rem .9rem}
legend{font-weight:730;padding:0 .35rem}.gateway-check{display:flex;align-items:center;gap:.65rem;flex-wrap:wrap;margin-top:.7rem}
[data-state=ready]{color:#176242}[data-state=failed],[data-state=offline]{color:var(--danger)}
.template-list{padding:0;margin:.5rem 0 1rem;list-style:none}
.template-list li{display:flex;justify-content:space-between;gap:.65rem;padding:.72rem 0;border-bottom:1px solid var(--line);align-items:center;flex-wrap:wrap}
.list-actions{display:flex;gap:.35rem}
.routes{border-top:1px solid var(--line);padding-top:.9rem}.route-row{display:grid;grid-template-columns:minmax(150px,1fr) minmax(125px,.8fr) minmax(140px,1fr);align-items:center;gap:.6rem;border-bottom:1px solid var(--line);padding:.2rem .05rem}
.route-row select{min-width:0}.route-row label{font-size:.81rem}
dialog{width:min(510px,calc(100vw - 1.5rem));max-height:calc(100dvh - 1.5rem);border:1px solid #bdcfc3;border-radius:14px;padding:1.25rem;box-shadow:0 24px 72px #1732262d;color:var(--ink)}
dialog::backdrop{background:#17332675}
.mobile-only{display:none}
@media(max-width:860px){.gateways{grid-template-columns:minmax(0,1fr)}.account-text strong{max-width:145px}}
@media(max-width:650px){
  .topbar-inner{flex-wrap:wrap;gap:.25rem .4rem}.brand img,.account .avatar{width:32px;height:32px}.account-text{display:none}
  .topbar nav{order:3;width:100%}.topbar nav button{min-height:38px}.workspace{grid-template-columns:1fr;height:calc(100dvh - 145px);min-height:480px}
  .sidebar{border-right:0}.conversation{display:none}.workspace.opened .sidebar{display:none}.workspace.opened .conversation{display:flex}
  .mobile-only{display:block}.thread-head{padding:.5rem .7rem}.thread-head .avatar{width:30px;height:30px}.compose{padding:.4rem .7rem .65rem}
  .route-row{grid-template-columns:1fr 1fr;gap:0 .55rem}.route-row strong{grid-column:1/-1;padding-top:.4rem}
  th,td{padding:.45rem}.settings-panel{padding:.65rem}
  .section-nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.2rem}
  .section-nav button{padding:.35rem .25rem;white-space:normal;min-height:44px;font-size:.87rem;line-height:1.25}
}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
