:root{
  --bg:#f4f2ed;
  --paper:#fff;
  --ink:#20211f;
  --muted:#73746f;
  --line:#dedbd5;
  --soft:#f7f5f1;
  --soft2:#efede7;
  --dark:#20201f;
  --accent:#c67516;
  --accent-soft:#f5e6d1;
  --green:#5bbd62;
  --shadow:0 14px 38px rgba(28,28,24,.08);
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;font-family:"Google Sans",Arial,sans-serif;color:var(--ink);background:var(--bg)}
button,textarea,select{font:inherit}
button{color:inherit}
[hidden]{display:none!important}

.gb-shell{
  min-height:100dvh;
  display:grid;
  grid-template-columns:284px minmax(0,1fr);
  background:var(--bg);
}

.gb-panel{
  position:sticky;
  top:0;
  height:100dvh;
  overflow:auto;
  display:flex;
  flex-direction:column;
  padding:20px;
  border-right:1px solid var(--line);
  background:#fbfaf7;
}

.gb-brand{
  display:flex;
  align-items:center;
  gap:12px;
  padding:8px 5px 20px;
  border-bottom:1px solid #e7e3db;
}
.gb-brand img{
  width:48px;height:48px;object-fit:contain;border-radius:13px;background:#fff
}
.gb-brand div{display:grid;gap:2px;min-width:0}
.gb-brand strong{font-size:19px}
.gb-brand span{color:var(--muted);font-size:11px;line-height:1.25}

.gb-new{
  margin:18px 0 5px;
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border:0;
  border-radius:12px;
  padding:12px 14px;
  background:var(--dark);
  color:#fff;
  cursor:pointer;
  font-weight:750;
}
.gb-new:hover{background:#343432}

.gb-section{padding:18px 0;border-bottom:1px solid #e7e3db}
.gb-section-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:10px;
  color:#75766f;
  font-size:10px;
  font-weight:850;
  letter-spacing:.09em;
  text-transform:uppercase;
}
.gb-mini-link{
  border:0;background:none;padding:0;color:#8c8c86;cursor:pointer;font-size:9px;text-transform:none;letter-spacing:0
}
.gb-context{display:grid;gap:8px}
.gb-context>div{
  display:grid;
  grid-template-columns:75px 1fr;
  gap:8px;
  align-items:baseline;
}
.gb-context span{color:#92928c;font-size:9px}
.gb-context strong{font-size:10px;font-weight:720;line-height:1.35}

.gb-create-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.gb-create-grid button{
  min-height:58px;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  gap:3px;
  padding:9px 10px;
  border:1px solid #e1ddd5;
  border-radius:11px;
  background:#fff;
  cursor:pointer;
  text-align:left;
}
.gb-create-grid button:hover{border-color:#cfc9bd;background:#f7f4ee}
.gb-create-grid button span{font-size:10px;font-weight:700}

.gb-coming{
  padding:3px 6px;
  border-radius:999px;
  background:#edeae3;
  color:#8f8f88;
  font-size:8px;
  letter-spacing:0;
  text-transform:none;
}
.gb-history-empty{
  padding:11px;
  border:1px dashed #d7d2c7;
  border-radius:10px;
  color:#96968f;
  font-size:9px;
  line-height:1.45;
}
.gb-panel-spacer{flex:1;min-height:20px}
.gb-admin{
  width:100%;
  display:flex;
  align-items:center;
  gap:10px;
  padding:11px;
  border:1px solid #dcd8cf;
  border-radius:12px;
  background:#fff;
  cursor:pointer;
  text-align:left;
}
.gb-admin:hover{background:#f4f1eb}
.gb-admin>span:first-child{font-size:18px}
.gb-admin>span:last-child{display:grid;gap:2px}
.gb-admin strong{font-size:11px}
.gb-admin small{color:#85857e;font-size:9px}

.gb-main{
  min-width:0;
  height:100dvh;
  display:grid;
  grid-template-rows:auto auto minmax(0,1fr) auto;
  background:#fff;
}

.gb-main-header{
  display:flex;
  justify-content:space-between;
  gap:24px;
  align-items:flex-start;
  padding:28px 34px 20px;
  border-bottom:1px solid #e9e6df;
}
.gb-eyebrow{
  display:block;
  margin-bottom:8px;
  color:#7d7d76;
  font-size:9px;
  font-weight:850;
  letter-spacing:.16em;
}
.gb-main-header h1{margin:0;font-size:clamp(25px,3vw,39px);letter-spacing:-.03em;line-height:1.05}
.gb-main-header p{margin:8px 0 0;color:#7a7a74;font-size:11px}
.gb-status{
  display:flex;
  align-items:center;
  gap:7px;
  padding:7px 10px;
  border:1px solid #dedbd5;
  border-radius:999px;
  color:#777771;
  font-size:9px;
  white-space:nowrap;
}
.gb-status-dot{width:7px;height:7px;border-radius:50%;background:var(--green)}

.gb-filters{
  display:grid;
  grid-template-columns:1fr 1fr 1.15fr 1.25fr;
  gap:9px;
  padding:15px 34px;
  background:#faf9f6;
  border-bottom:1px solid #e9e6df;
}
.gb-filters label{display:grid;gap:5px;min-width:0}
.gb-filters label>span:first-child{
  color:#797973;font-size:8px;font-weight:800;text-transform:uppercase;letter-spacing:.07em
}
.gb-filters select,.gb-select-button{
  width:100%;
  min-width:0;
  height:36px;
  padding:0 10px;
  border:1px solid #dcd8cf;
  border-radius:9px;
  background:#fff;
  color:#393a36;
  font-size:10px;
}
.gb-select-button{
  display:flex;align-items:center;justify-content:space-between;cursor:pointer
}
.gb-select-button:disabled,.gb-filters select:disabled{background:#f1efea;color:#aaa8a0;cursor:not-allowed}

.gb-chat{
  min-height:0;
  overflow:auto;
  padding:26px max(34px,calc((100% - 900px)/2));
  background:
    linear-gradient(#fff,#fff) padding-box,
    linear-gradient(180deg,#fff,#fbfaf8) border-box;
}
.gb-message{
  display:flex;
  gap:11px;
  align-items:flex-start;
  margin-bottom:18px;
}
.gb-avatar{
  width:34px;height:34px;flex:0 0 auto;
  display:grid;place-items:center;
  border:1px solid #e0ddd6;border-radius:10px;background:#fff
}
.gb-avatar img{width:27px;height:27px;object-fit:contain}
.gb-bubble{
  width:min(760px,100%);
  padding:17px 18px;
  border:1px solid #e1ded7;
  border-radius:15px;
  background:#fff;
  box-shadow:0 6px 18px rgba(25,25,20,.035);
}
.gb-bubble p{margin:0 0 8px;font-size:12px;line-height:1.55}
.gb-bubble p:last-child{margin-bottom:0}
.gb-user{justify-content:flex-end}
.gb-user .gb-bubble{
  width:auto;max-width:min(680px,86%);
  background:#f0eee8;border-color:#dfdbd2;box-shadow:none
}
.gb-examples{display:flex;flex-wrap:wrap;gap:7px;margin-top:14px}
.gb-examples button{
  padding:7px 9px;
  border:1px solid #dbd7ce;
  border-radius:999px;
  background:#faf9f6;
  cursor:pointer;
  font-size:9px;
}
.gb-examples button:hover{background:#f1eee8}
.gb-source-note{
  margin-top:14px;
  padding:9px 10px;
  border-left:3px solid #d7c3a7;
  background:#fbf7f0;
  color:#786c5b;
  font-size:9px;
  line-height:1.5;
}

.gb-composer-wrap{
  padding:10px max(34px,calc((100% - 900px)/2)) 16px;
  border-top:1px solid #e8e5de;
  background:#fff;
}
.gb-context-strip{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:7px}
.gb-context-strip span{
  padding:4px 7px;border-radius:999px;background:#f0ede7;color:#686861;font-size:8px;font-weight:700
}
.gb-composer{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  align-items:end;
  padding:7px;
  border:1px solid #d8d4cb;
  border-radius:14px;
  box-shadow:0 7px 20px rgba(25,25,20,.05);
}
.gb-composer textarea{
  width:100%;
  min-height:40px;
  max-height:130px;
  resize:none;
  padding:10px 11px;
  border:0;
  outline:0;
  background:transparent;
  color:#30312e;
  font-size:11px;
  line-height:1.4;
}
.gb-send{
  min-height:40px;
  display:flex;align-items:center;gap:6px;
  padding:0 15px;border:0;border-radius:10px;background:var(--dark);color:#fff;cursor:pointer;font-weight:750;font-size:10px
}
.gb-send:hover{background:#373735}
.gb-helper{margin:6px 3px 0;color:#999890;font-size:8px}

.gb-modal-backdrop{
  position:fixed;inset:0;z-index:50;
  display:grid;place-items:center;
  padding:20px;
  background:rgba(23,23,20,.38);
  backdrop-filter:blur(3px);
}
.gb-modal{
  width:min(820px,100%);
  max-height:min(740px,calc(100dvh - 40px));
  overflow:auto;
  padding:22px;
  border:1px solid #ddd9d0;
  border-radius:20px;
  background:#fff;
  box-shadow:var(--shadow);
}
.gb-modal>header{display:flex;justify-content:space-between;gap:20px;align-items:flex-start}
.gb-modal h2{margin:0;font-size:24px}
.gb-close{
  width:36px;height:36px;border:1px solid #ddd9d1;border-radius:10px;background:#fff;cursor:pointer
}
.gb-tabs{display:flex;gap:6px;margin-top:20px;padding-bottom:10px;border-bottom:1px solid #e6e2da}
.gb-tabs button{
  padding:7px 10px;border:0;border-radius:8px;background:transparent;color:#77766f;font-size:9px;font-weight:750
}
.gb-tabs button.active{background:#eeeae2;color:#292a27}
.gb-tabs button:disabled{opacity:.45}
.gb-library-placeholder{
  min-height:330px;
  display:grid;place-items:center;align-content:center;text-align:center;padding:38px
}
.gb-library-icon{font-size:38px}
.gb-library-placeholder h3{margin:12px 0 7px;font-size:18px}
.gb-library-placeholder p{max-width:500px;margin:0;color:#7c7c75;font-size:11px;line-height:1.6}
.gb-primary{
  margin-top:18px;padding:10px 14px;border:0;border-radius:10px;background:var(--dark);color:#fff;font-size:10px;font-weight:750
}
.gb-primary:disabled{opacity:.4}

.gb-oa-popover{
  position:fixed;z-index:60;
  width:min(360px,calc(100vw - 30px));
  padding:15px;
  border:1px solid #ddd9d1;border-radius:13px;background:#fff;box-shadow:var(--shadow)
}
.gb-oa-head{display:flex;justify-content:space-between;gap:10px;align-items:center}
.gb-oa-head strong{font-size:11px}
.gb-oa-head button{border:0;background:none;cursor:pointer}
.gb-oa-popover p{color:#7c7c75;font-size:9px;line-height:1.5}
.gb-placeholder-oa{display:flex;gap:7px;color:#999890;font-size:9px}

@media(max-width:980px){
  .gb-shell{grid-template-columns:235px minmax(0,1fr)}
  .gb-panel{padding:15px}
  .gb-filters{grid-template-columns:1fr 1fr;padding-inline:22px}
  .gb-main-header{padding-inline:22px}
  .gb-chat,.gb-composer-wrap{padding-left:22px;padding-right:22px}
}

@media(max-width:720px){
  .gb-shell{display:block}
  .gb-panel{
    position:relative;height:auto;max-height:none;
    border-right:0;border-bottom:1px solid var(--line)
  }
  .gb-brand,.gb-history-section,.gb-panel-spacer{display:none}
  .gb-new{margin-top:0}
  .gb-context{grid-template-columns:1fr 1fr}
  .gb-section{padding:12px 0}
  .gb-create-grid{grid-template-columns:repeat(3,1fr)}
  .gb-admin{margin-top:12px}
  .gb-main{height:auto;min-height:100dvh}
  .gb-main-header{flex-direction:column;padding:20px 16px 15px;gap:10px}
  .gb-main-header h1{font-size:27px}
  .gb-filters{grid-template-columns:1fr 1fr;padding:12px 16px}
  .gb-chat{min-height:430px;padding:18px 16px}
  .gb-composer-wrap{position:sticky;bottom:0;padding:9px 12px 12px}
}

@media(max-width:470px){
  .gb-context{grid-template-columns:1fr}
  .gb-create-grid{grid-template-columns:1fr 1fr}
  .gb-filters{grid-template-columns:1fr}
  .gb-composer{grid-template-columns:1fr}
  .gb-send{justify-content:center}
}


/* =========================================================
   PASO 3.2 · CUENTA + BIBLIOTECA REAL
   ========================================================= */

.gb-account{
  position:relative;
  display:grid;
  grid-template-columns:34px minmax(0,1fr) auto;
  gap:9px;
  align-items:center;
  margin:13px 0 0;
  padding:9px;
  border:1px solid #e2ded6;
  border-radius:11px;
  background:#fff;
}
.gb-account-avatar{
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border-radius:10px;
  background:#efede7;
  color:#4e504b;
  font-size:11px;
  font-weight:850;
}
.gb-account-copy{
  min-width:0;
  display:grid;
  gap:2px;
}
.gb-account-copy strong,
.gb-account-copy span{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.gb-account-copy strong{
  font-size:10px;
}
.gb-account-copy span{
  color:#85867f;
  font-size:8px;
}
.gb-admin-badge{
  padding:3px 6px;
  border-radius:999px;
  background:#20201f;
  color:#fff;
  font-size:7px;
  font-weight:850;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.gb-status.is-ready .gb-status-dot,
.gb-library-connection.is-ready .gb-connection-dot{
  background:#5bbd62;
}
.gb-status.is-warning .gb-status-dot,
.gb-library-connection.is-warning .gb-connection-dot{
  background:#d49b3c;
}
.gb-status.is-error .gb-status-dot,
.gb-library-connection.is-error .gb-connection-dot{
  background:#c96c61;
}

.gb-library-modal{
  width:min(1000px,100%);
}
.gb-library-subtitle{
  margin:6px 0 0;
  color:#7c7c76;
  font-size:10px;
}
.gb-library-connection{
  display:flex;
  align-items:center;
  gap:7px;
  margin-top:15px;
  padding:8px 10px;
  border:1px solid #e2dfd8;
  border-radius:10px;
  background:#faf9f6;
  color:#6f7069;
  font-size:9px;
}
.gb-connection-dot{
  width:8px;
  height:8px;
  flex:0 0 auto;
  border-radius:50%;
  background:#a9aaa4;
}

.gb-library-view{
  min-height:350px;
}
.gb-library-toolbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:15px;
  margin-top:16px;
}
.gb-library-toolbar>div{
  display:grid;
  gap:3px;
}
.gb-library-toolbar strong{
  font-size:13px;
}
.gb-library-toolbar span{
  color:#81817a;
  font-size:9px;
}

.gb-library-summary{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:8px;
  margin-top:13px;
}
.gb-library-summary article{
  display:grid;
  gap:3px;
  padding:11px;
  border:1px solid #e4e0d8;
  border-radius:11px;
  background:#fbfaf7;
}
.gb-library-summary strong{
  color:#2d2e2b;
  font-size:20px;
}
.gb-library-summary span{
  color:#85857e;
  font-size:8px;
  text-transform:uppercase;
  letter-spacing:.06em;
}

.gb-library-filters{
  display:grid;
  grid-template-columns:1fr 1fr 1fr auto;
  gap:7px;
  margin-top:12px;
}
.gb-library-filters select,
.gb-secondary{
  height:34px;
  border:1px solid #ddd9d1;
  border-radius:9px;
  background:#fff;
  padding:0 9px;
  color:#50514c;
  font-size:9px;
}
.gb-secondary{
  cursor:pointer;
  font-weight:750;
}
.gb-secondary:hover{
  background:#f5f2ec;
}

.gb-library-list{
  display:grid;
  gap:8px;
  margin-top:12px;
}
.gb-library-loading,
.gb-library-empty{
  display:grid;
  place-items:center;
  min-height:180px;
  padding:28px;
  border:1px dashed #dad5ca;
  border-radius:12px;
  color:#8b8b84;
  text-align:center;
  font-size:10px;
  line-height:1.55;
}
.gb-library-empty strong{
  display:block;
  margin-bottom:5px;
  color:#5f605a;
  font-size:12px;
}
.gb-document-card{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:14px;
  align-items:center;
  padding:12px;
  border:1px solid #e2ded6;
  border-radius:12px;
  background:#fff;
}
.gb-document-copy{
  min-width:0;
}
.gb-document-copy h4{
  margin:0;
  font-size:11px;
}
.gb-document-copy p{
  margin:4px 0 0;
  color:#85857e;
  font-size:9px;
}
.gb-document-meta{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  margin-top:8px;
}
.gb-document-meta span{
  padding:3px 6px;
  border-radius:999px;
  background:#f1eee8;
  color:#72736d;
  font-size:7px;
  font-weight:720;
}
.gb-document-actions{
  display:flex;
  gap:6px;
}
.gb-document-actions button{
  padding:6px 8px;
  border:1px solid #ddd9d1;
  border-radius:8px;
  background:#fff;
  cursor:pointer;
  font-size:8px;
  font-weight:750;
}
.gb-document-actions button:hover{
  background:#f5f2ec;
}
.gb-document-actions .danger{
  color:#9a5d54;
}

.gb-curriculum-tree{
  margin-top:13px;
  display:grid;
  gap:10px;
}
.gb-curriculum-level{
  border:1px solid #e2ded6;
  border-radius:12px;
  overflow:hidden;
}
.gb-curriculum-level>header{
  padding:10px 12px;
  background:#f7f5f1;
  font-size:11px;
  font-weight:800;
}
.gb-curriculum-unit{
  padding:10px 12px;
  border-top:1px solid #ebe7df;
}
.gb-curriculum-unit strong{
  font-size:10px;
}
.gb-curriculum-unit p{
  margin:4px 0 0;
  color:#80817a;
  font-size:9px;
}
.gb-oa-list{
  display:grid;
  gap:5px;
  margin-top:8px;
}
.gb-oa-item{
  padding:7px 8px;
  border-left:3px solid #d9d1c4;
  background:#faf8f4;
  color:#5f605b;
  font-size:8px;
  line-height:1.45;
}
.gb-oa-item b{
  color:#343532;
}

.gb-resource-summary{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:9px;
  margin-top:14px;
}
.gb-resource-summary article{
  padding:15px;
  border:1px solid #e2ded6;
  border-radius:12px;
  background:#fbfaf7;
}
.gb-resource-summary strong{
  display:block;
  font-size:22px;
}
.gb-resource-summary span{
  color:#7d7e77;
  font-size:9px;
}

.gb-template-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:9px;
  margin-top:14px;
}
.gb-template-card{
  padding:13px;
  border:1px solid #e2ded6;
  border-radius:12px;
  background:#fff;
}
.gb-template-card strong{
  display:block;
  font-size:11px;
}
.gb-template-card span{
  display:block;
  margin-top:4px;
  color:#81827b;
  font-size:9px;
}
.gb-template-card .active{
  margin-top:8px;
  color:#5d7865;
  font-weight:800;
}

.gb-library-error{
  margin-top:12px;
  padding:10px 11px;
  border:1px solid #eccfc9;
  border-radius:10px;
  background:#fcf4f2;
  color:#875f59;
  font-size:9px;
  line-height:1.5;
}

.gb-library-next{
  display:flex;
  gap:9px;
  align-items:flex-start;
  margin-top:14px;
  padding:9px 10px;
  border:1px solid #e8dfcc;
  border-radius:10px;
  background:#fcf8ef;
  color:#756b57;
  font-size:9px;
  line-height:1.5;
}
.gb-library-next strong{
  white-space:nowrap;
}

@media(max-width:720px){
  .gb-account{
    display:none;
  }
  .gb-library-summary,
  .gb-resource-summary,
  .gb-template-grid{
    grid-template-columns:1fr 1fr;
  }
  .gb-library-filters{
    grid-template-columns:1fr;
  }
  .gb-document-card{
    grid-template-columns:1fr;
  }
  .gb-document-actions{
    justify-content:flex-end;
  }
}

@media(max-width:450px){
  .gb-library-summary,
  .gb-resource-summary,
  .gb-template-grid{
    grid-template-columns:1fr;
  }
}


/* PASO 3.2.3 · CONTRASEÑA TEMPORAL DE ADMIN */

.gb-password-modal{
  width:min(460px,100%);
}

.gb-password-form{
  display:grid;
  gap:12px;
  margin-top:18px;
}

.gb-password-form label{
  display:grid;
  gap:6px;
}

.gb-password-form label span{
  color:#696a64;
  font-size:9px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.05em;
}

.gb-password-form input{
  width:100%;
  height:42px;
  padding:0 12px;
  border:1px solid #dcd8cf;
  border-radius:10px;
  background:#fff;
  color:#30312e;
  outline:none;
}

.gb-password-form input:focus{
  border-color:#b9ad9a;
  box-shadow:0 0 0 3px rgba(185,173,154,.12);
}

.gb-password-form .gb-primary{
  width:100%;
  margin-top:0;
}

.gb-password-note{
  margin:12px 0 0;
  color:#8a8a83;
  font-size:8px;
  line-height:1.5;
}

.gb-admin.is-unlocked{
  border-color:#cfc7b9;
  background:#f7f3eb;
}


/* =========================================================
   PASO 3.2.5 · INTEGRACIÓN DIRECTA, SIN IFRAME
   ========================================================= */

.guten-bot-direct{
  overflow:hidden;
}

.guten-bot-direct > .guten-app-main{
  height:calc(100dvh - var(--guten-height));
  min-height:0;
  overflow:hidden;
  background:var(--bg);
}

.guten-bot-direct .guten-app-main .gb-shell{
  height:100%;
  min-height:0;
}

.guten-bot-direct .guten-app-main .gb-panel{
  height:100%;
  min-height:0;
}

.guten-bot-direct .guten-app-main .gb-main{
  height:100%;
  min-height:0;
}

.guten-bot-direct .guten-app-main .gb-chat{
  min-height:0;
}

/* En escritorio guten-menu.css ya desplaza <main> al dejar abierto
   el menú global de L33M3. No añadimos un segundo margen. */

@media(max-width:800px){
  .guten-bot-direct{
    overflow:hidden;
  }

  .guten-bot-direct > .guten-app-main{
    height:calc(100dvh - var(--guten-height));
    overflow:auto;
  }

  .guten-bot-direct .guten-app-main .gb-shell{
    min-height:100%;
    height:auto;
  }

  .guten-bot-direct .guten-app-main .gb-panel{
    height:auto;
  }

  .guten-bot-direct .guten-app-main .gb-main{
    height:auto;
    min-height:100%;
  }
}


/* PASO 3.2.7 · LOGIN PROPIO */

body.gb-locked > .guten-header,
body.gb-locked > .guten-sidebar,
body.gb-locked > .guten-overlay,
body.gb-locked > .guten-app-main{
  filter:blur(3px);
  pointer-events:none;
  user-select:none;
}

.gb-login-gate{
  position:fixed;
  inset:0;
  z-index:9999;
  display:grid;
  place-items:center;
  padding:22px;
  background:rgba(244,242,237,.94);
  backdrop-filter:blur(5px);
}

.gb-login-card{
  width:min(430px,100%);
  padding:28px;
  border:1px solid #ddd8cf;
  border-radius:20px;
  background:#fff;
  box-shadow:0 22px 60px rgba(30,30,26,.12);
}

.gb-login-logo{
  width:58px;
  height:58px;
  display:grid;
  place-items:center;
  margin-bottom:14px;
  border-radius:15px;
  background:#f5f3ee;
}

.gb-login-logo img{
  width:48px;
  height:48px;
  object-fit:contain;
}

.gb-login-card h1{
  margin:0;
  font-size:28px;
  letter-spacing:-.03em;
}

.gb-login-card > p{
  margin:8px 0 18px;
  color:#777870;
  font-size:11px;
  line-height:1.55;
}

.gb-login-form{
  display:grid;
  gap:12px;
}

.gb-login-form label{
  display:grid;
  gap:6px;
}

.gb-login-form label span{
  color:#6c6d66;
  font-size:9px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.06em;
}

.gb-login-form input{
  width:100%;
  height:43px;
  padding:0 12px;
  border:1px solid #d9d5cc;
  border-radius:10px;
  background:#fff;
  color:#282926;
  outline:none;
}

.gb-login-form input:focus{
  border-color:#a89e8e;
  box-shadow:0 0 0 3px rgba(168,158,142,.12);
}

.gb-login-submit{
  height:44px;
  border:0;
  border-radius:10px;
  background:#20201f;
  color:#fff;
  cursor:pointer;
  font-weight:800;
}

.gb-login-submit:disabled{
  opacity:.55;
  cursor:wait;
}

.gb-login-error{
  margin-top:12px;
  padding:9px 10px;
  border:1px solid #eccdc7;
  border-radius:9px;
  background:#fcf2f0;
  color:#875b55;
  font-size:9px;
  line-height:1.5;
}

.gb-login-back{
  display:block;
  margin-top:15px;
  color:#72736d;
  font-size:9px;
  text-decoration:none;
}

.gb-login-back:hover{
  text-decoration:underline;
}


/* =========================================================
   PASO 3.3 · CARGA Y DESINTEGRACIÓN DOCUMENTAL
   ========================================================= */

.gb-upload-backdrop{
  z-index:120;
}

.gb-upload-modal{
  width:min(900px,100%);
  max-height:min(860px,calc(100dvh - 30px));
}

.gb-upload-progress-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:15px;
  margin-top:18px;
}

.gb-upload-progress-head>div{
  display:grid;
  gap:3px;
}

.gb-upload-progress-head strong{
  font-size:12px;
}

.gb-upload-progress-head span:not(.gb-upload-step){
  color:#81827b;
  font-size:9px;
}

.gb-upload-step{
  flex:0 0 auto;
  padding:4px 8px;
  border-radius:999px;
  background:#f0ede7;
  color:#64655f;
  font-size:8px;
  font-weight:800;
}

.gb-upload-progress-track{
  height:5px;
  overflow:hidden;
  margin-top:10px;
  border-radius:999px;
  background:#ece8e0;
}

.gb-upload-progress-bar{
  width:25%;
  height:100%;
  border-radius:inherit;
  background:#20201f;
  transition:width .25s ease;
}

.gb-upload-step-view{
  margin-top:18px;
}

.gb-dropzone{
  width:100%;
  min-height:250px;
  display:grid;
  place-items:center;
  align-content:center;
  gap:7px;
  padding:30px;
  border:2px dashed #d4cec3;
  border-radius:16px;
  background:#faf9f6;
  cursor:pointer;
  text-align:center;
}

.gb-dropzone:hover,
.gb-dropzone.is-dragging{
  border-color:#9f9688;
  background:#f5f2ec;
}

.gb-dropzone-icon{
  width:48px;
  height:48px;
  display:grid;
  place-items:center;
  margin-bottom:4px;
  border-radius:15px;
  background:#20201f;
  color:#fff;
  font-size:24px;
}

.gb-dropzone strong{
  font-size:14px;
}

.gb-dropzone>span:not(.gb-dropzone-icon){
  color:#767770;
  font-size:10px;
}

.gb-dropzone small{
  margin-top:5px;
  color:#9a9a93;
  font-size:8px;
}

.gb-upload-note,
.gb-upload-storage-note{
  display:flex;
  gap:10px;
  margin-top:12px;
  padding:11px 12px;
  border:1px solid #e6dfd1;
  border-radius:11px;
  background:#fcf8ef;
  color:#756b58;
}

.gb-upload-note{
  display:grid;
  gap:3px;
}

.gb-upload-note strong,
.gb-upload-storage-note strong{
  font-size:9px;
}

.gb-upload-note span,
.gb-upload-storage-note p{
  margin:0;
  font-size:8px;
  line-height:1.55;
}

.gb-processing-card{
  min-height:150px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:16px;
  padding:25px;
  border:1px solid #e2ded6;
  border-radius:15px;
  background:#fbfaf7;
}

.gb-processing-spinner{
  width:34px;
  height:34px;
  flex:0 0 auto;
  border:3px solid #e4e0d8;
  border-top-color:#20201f;
  border-radius:50%;
  animation:gbSpin .8s linear infinite;
}

@keyframes gbSpin{
  to{transform:rotate(360deg)}
}

.gb-processing-card strong{
  font-size:13px;
}

.gb-processing-card p{
  margin:5px 0 0;
  color:#797a73;
  font-size:9px;
  line-height:1.5;
}

.gb-processing-log{
  max-height:160px;
  overflow:auto;
  display:grid;
  gap:5px;
  margin-top:10px;
  padding:10px;
  border:1px solid #e6e2da;
  border-radius:10px;
  background:#fff;
  color:#777871;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:8px;
}

.gb-processing-log:empty{
  display:none;
}

.gb-processing-log div{
  padding-bottom:4px;
  border-bottom:1px solid #f0ede7;
}

.gb-analysis-summary{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:8px;
}

.gb-analysis-summary article{
  display:grid;
  gap:3px;
  padding:11px;
  border:1px solid #e2ded6;
  border-radius:11px;
  background:#fbfaf7;
}

.gb-analysis-summary strong{
  overflow:hidden;
  text-overflow:ellipsis;
  font-size:18px;
}

.gb-analysis-summary span{
  color:#86877f;
  font-size:8px;
  text-transform:uppercase;
  letter-spacing:.05em;
}

.gb-document-review-form{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:13px;
}

.gb-document-review-form label{
  display:grid;
  gap:5px;
}

.gb-document-review-form label.wide{
  grid-column:1/-1;
}

.gb-document-review-form label>span{
  color:#777871;
  font-size:8px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.05em;
}

.gb-document-review-form input,
.gb-document-review-form select{
  width:100%;
  height:38px;
  padding:0 10px;
  border:1px solid #dcd8cf;
  border-radius:9px;
  background:#fff;
  color:#383936;
  font-size:10px;
}

.gb-extraction-preview{
  margin-top:13px;
  overflow:hidden;
  border:1px solid #e0dcd4;
  border-radius:12px;
}

.gb-extraction-preview header{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:9px 11px;
  background:#f6f4ef;
  border-bottom:1px solid #e4e0d8;
}

.gb-extraction-preview header strong{
  font-size:9px;
}

.gb-extraction-preview header span{
  color:#86877f;
  font-size:8px;
}

.gb-extraction-preview pre{
  max-height:220px;
  overflow:auto;
  margin:0;
  padding:12px;
  white-space:pre-wrap;
  word-break:break-word;
  background:#fff;
  color:#4a4b47;
  font-family:"Google Sans",Arial,sans-serif;
  font-size:9px;
  line-height:1.55;
}

.gb-upload-storage-note>span{
  flex:0 0 auto;
  font-size:14px;
}

.gb-upload-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin-top:13px;
}

.gb-save-progress{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:12px;
}

.gb-save-progress-track{
  flex:1;
  height:7px;
  overflow:hidden;
  border-radius:999px;
  background:#ece8e0;
}

.gb-save-progress-bar{
  width:0;
  height:100%;
  border-radius:inherit;
  background:#20201f;
  transition:width .2s ease;
}

.gb-save-progress>span{
  min-width:36px;
  color:#75766f;
  font-size:9px;
  text-align:right;
}

.gb-upload-success{
  min-height:320px;
  display:grid;
  place-items:center;
  align-content:center;
  text-align:center;
  padding:35px;
}

.gb-upload-success-icon{
  width:58px;
  height:58px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:#edf6ee;
  color:#4d8155;
  font-size:25px;
  font-weight:900;
}

.gb-upload-success h3{
  margin:13px 0 5px;
  font-size:19px;
}

.gb-upload-success p{
  max-width:500px;
  margin:0;
  color:#7a7b74;
  font-size:10px;
  line-height:1.55;
}

.gb-upload-success .gb-primary{
  margin-top:18px;
}

@media(max-width:720px){
  .gb-analysis-summary{
    grid-template-columns:1fr 1fr;
  }

  .gb-document-review-form{
    grid-template-columns:1fr;
  }

  .gb-document-review-form label.wide{
    grid-column:auto;
  }

  .gb-upload-actions{
    flex-direction:column-reverse;
  }

  .gb-upload-actions button{
    width:100%;
  }
}


/* =========================================================
   GUTEN-BOT 3.3.2 · BASE ESTABLE
   ========================================================= */

/* El modal debe quedar por encima del header global (120)
   y del sidebar global (110). */
.gb-modal-backdrop{
  z-index:10000;
}

.gb-upload-backdrop{
  z-index:10100;
}

.gb-oa-popover{
  z-index:10200;
}

/* Al portarse a body, los modales usan toda la ventana. */
body > .gb-modal-backdrop{
  position:fixed;
  inset:0;
  width:100vw;
  height:100dvh;
  margin:0;
  padding:clamp(12px,2vw,24px);
}

body > .gb-modal-backdrop > .gb-modal{
  margin:0;
  max-width:calc(100vw - 24px);
  max-height:calc(100dvh - 24px);
}

body > #libraryModal > .gb-library-modal{
  width:min(1000px,calc(100vw - 24px));
}

body > #uploadModal > .gb-upload-modal{
  width:min(900px,calc(100vw - 24px));
}

/* Cuenta y salida propia de Guten-bot. */
.gb-account-actions{
  display:grid;
  justify-items:end;
  gap:5px;
}

.gb-account-logout{
  border:0;
  padding:0;
  background:transparent;
  color:#8a5a53;
  cursor:pointer;
  font-size:8px;
  font-weight:750;
  text-decoration:underline;
  text-underline-offset:2px;
}

.gb-account-logout:hover{
  color:#633e39;
}

@media(max-width:800px){
  body > .gb-modal-backdrop{
    padding:10px;
  }

  body > .gb-modal-backdrop > .gb-modal{
    width:100%;
    max-width:100%;
    max-height:calc(100dvh - 20px);
    border-radius:15px;
  }
}


/* =========================================================
   GUTEN-BOT 3.3.4 · TIPOGRAFÍA, LAYOUT Y REVISOR VISUAL
   ========================================================= */

:root{
  --gb-base-font:12px;
}

/* Google Sans oficial y mínimo funcional de 12px. */
.guten-bot-direct,
.guten-bot-direct button,
.guten-bot-direct input,
.guten-bot-direct select,
.guten-bot-direct textarea,
.guten-bot-direct .gb-modal{
  font-family:"Google Sans",sans-serif;
}

.guten-bot-direct{
  font-size:var(--gb-base-font);
  line-height:1.45;
}

/* Los textos funcionales dejan de caer a 7–10 px. */
.guten-bot-direct .gb-shell p,
.guten-bot-direct .gb-shell span,
.guten-bot-direct .gb-shell small,
.guten-bot-direct .gb-shell label,
.guten-bot-direct .gb-shell button,
.guten-bot-direct .gb-shell input,
.guten-bot-direct .gb-shell select,
.guten-bot-direct .gb-shell textarea,
.guten-bot-direct .gb-modal p,
.guten-bot-direct .gb-modal span,
.guten-bot-direct .gb-modal small,
.guten-bot-direct .gb-modal label,
.guten-bot-direct .gb-modal button,
.guten-bot-direct .gb-modal input,
.guten-bot-direct .gb-modal select,
.guten-bot-direct .gb-modal textarea{
  font-size:12px;
}

/* El menú global también mantiene legibilidad consistente. */
.guten-bot-direct .guten-link,
.guten-bot-direct .guten-group summary,
.guten-bot-direct .guten-submenu a{
  font-size:12px;
}

.guten-bot-direct .guten-side-brand{
  font-size:22px;
}

/* Más espacio útil para el chat. */
.guten-bot-direct .gb-shell{
  grid-template-columns:230px minmax(0,1fr);
}

.guten-bot-direct .gb-panel{
  padding:14px;
}

.guten-bot-direct .gb-brand{
  padding-bottom:12px;
}

.guten-bot-direct .gb-brand img{
  width:40px;
  height:40px;
}

.guten-bot-direct .gb-brand strong{
  font-size:16px;
}

.guten-bot-direct .gb-section{
  padding:12px 0;
}

.guten-bot-direct .gb-new{
  margin-top:12px;
  padding:10px 12px;
}

.guten-bot-direct .gb-create-grid button{
  min-height:52px;
}

.guten-bot-direct .gb-main{
  overflow:hidden;
  grid-template-rows:auto auto minmax(0,1fr) auto;
}

.guten-bot-direct .gb-main-header{
  padding:18px 24px 13px;
  gap:16px;
}

.guten-bot-direct .gb-main-header h1{
  font-size:clamp(26px,2.7vw,36px);
}

.guten-bot-direct .gb-main-header p{
  margin-top:6px;
}

.guten-bot-direct .gb-filters{
  padding:10px 24px;
  gap:8px;
}

.guten-bot-direct .gb-filters select,
.guten-bot-direct .gb-select-button{
  height:38px;
  font-size:12px;
}

.guten-bot-direct .gb-chat{
  padding:16px 24px;
  overflow:auto;
}

.guten-bot-direct .gb-bubble{
  padding:14px 15px;
}

.guten-bot-direct .gb-composer-wrap{
  padding:9px 24px 12px;
}

.guten-bot-direct .gb-composer textarea{
  min-height:44px;
  font-size:12px;
}

.guten-bot-direct .gb-send{
  min-height:44px;
  font-size:12px;
}

/* Modal de carga más ancho para revisión lado a lado. */
body > #uploadModal > .gb-upload-modal{
  width:min(1280px,calc(100vw - 28px));
  max-height:calc(100dvh - 24px);
}

.gb-review-workspace{
  display:grid;
  grid-template-columns:minmax(360px,.9fr) minmax(420px,1.1fr);
  gap:12px;
  margin-top:14px;
  min-height:520px;
}

.gb-review-pane{
  min-width:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border:1px solid #dedbd4;
  border-radius:13px;
  background:#fff;
}

.gb-review-pane-head{
  min-height:58px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:11px 12px;
  border-bottom:1px solid #e5e1d9;
  background:#f8f6f2;
}

.gb-review-pane-head>div{
  display:grid;
  gap:2px;
  min-width:0;
}

.gb-review-pane-head strong{
  font-size:14px;
}

.gb-review-pane-head span{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#777871;
}

.gb-review-section-nav{
  display:grid;
  grid-template-columns:38px minmax(0,1fr) 38px;
  gap:6px;
  padding:9px 10px;
  border-bottom:1px solid #e7e3dc;
}

.gb-review-section-nav button,
.gb-review-section-nav select{
  height:38px;
  border:1px solid #d9d5cd;
  border-radius:8px;
  background:#fff;
}

.gb-review-section-nav button{
  cursor:pointer;
  font-weight:700;
}

.gb-review-section-nav button:disabled{
  opacity:.35;
  cursor:not-allowed;
}

.gb-original-preview{
  flex:1;
  min-height:420px;
  overflow:auto;
  display:grid;
  place-items:start center;
  padding:12px;
  background:#e9e7e2;
}

.gb-original-preview canvas{
  display:block;
  max-width:100%;
  height:auto;
  background:#fff;
  box-shadow:0 6px 18px rgba(0,0,0,.12);
}

.gb-original-placeholder{
  width:100%;
  min-height:360px;
  display:grid;
  place-items:center;
  align-content:center;
  gap:7px;
  padding:28px;
  text-align:center;
  color:#777871;
  background:#f5f3ef;
  border:1px dashed #cbc5ba;
  border-radius:10px;
}

.gb-original-placeholder strong{
  color:#3f403c;
  font-size:14px;
}

.gb-editor-pane{
  min-height:520px;
}

.gb-editor-status{
  flex:0 0 auto;
  padding:4px 8px;
  border-radius:999px;
  background:#ece9e3;
  color:#696a64!important;
  font-weight:700;
}

.gb-editor-status.is-edited{
  background:#fff0d8;
  color:#8a601f!important;
}

.gb-editor-status.is-excluded{
  background:#f6e5e2;
  color:#87564f!important;
}

.gb-extraction-editor{
  flex:1;
  width:100%;
  min-height:380px;
  padding:14px;
  border:0;
  outline:0;
  resize:none;
  background:#fff;
  color:#292a27;
  font-family:"Google Sans",sans-serif;
  font-size:12px;
  line-height:1.55;
}

.gb-extraction-editor:disabled{
  color:#99958e;
  background:#f5f3ef;
}

.gb-editor-footer{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:9px 11px;
  border-top:1px solid #e6e2da;
  background:#faf9f6;
}

.gb-editor-footer>div{
  display:flex;
  gap:6px;
}

.gb-editor-footer .danger{
  color:#92584f;
}

.gb-editor-help{
  margin:0!important;
  padding:9px 11px;
  border-top:1px solid #e6e2da;
  color:#777871;
  background:#fff;
  line-height:1.5;
}

.gb-analysis-summary{
  margin-top:4px;
}

.gb-document-review-form input,
.gb-document-review-form select{
  height:40px;
  font-size:12px;
}

.gb-library-modal{
  font-size:12px;
}

@media(max-width:1100px){
  .gb-review-workspace{
    grid-template-columns:1fr;
  }

  .gb-original-preview{
    min-height:360px;
    max-height:520px;
  }

  .gb-editor-pane{
    min-height:440px;
  }
}

@media(max-width:980px){
  .guten-bot-direct .gb-shell{
    grid-template-columns:205px minmax(0,1fr);
  }

  .guten-bot-direct .gb-filters{
    grid-template-columns:1fr 1fr;
  }
}

@media(max-width:720px){
  .guten-bot-direct .gb-shell{
    display:block;
  }

  .gb-review-workspace{
    min-height:0;
  }

  .gb-original-preview{
    min-height:300px;
  }

  .gb-extraction-editor{
    min-height:320px;
  }

  .gb-editor-footer{
    align-items:flex-start;
    flex-direction:column;
  }
}


/* =========================================================
   GUTEN-BOT 3.3.5 · LAYOUT OPTIMIZADO
   ========================================================= */

/*
   CORRECCIÓN CRÍTICA:
   /assets/styles.css contiene `section { padding:78px 0; }`.
   .gb-main es un <section>, por lo que heredaba 78px arriba
   y abajo. Eso producía exactamente las franjas vacías.
*/
.guten-bot-direct .guten-app-main section.gb-main{
  padding:0!important;
}

/* El resto de las secciones internas ya tienen su propio padding. */
.guten-bot-direct .guten-app-main .gb-shell{
  width:100%;
  height:100%;
  min-height:0;
  grid-template-columns:300px minmax(0,1fr);
  align-items:stretch;
}

.guten-bot-direct .guten-app-main .gb-main{
  width:100%;
  height:100%;
  min-height:0;
  overflow:hidden;
  grid-template-rows:auto auto minmax(0,1fr) auto;
  background:#fff;
}

/* ---------------------------------------------------------
   BARRA INTERNA IZQUIERDA
   --------------------------------------------------------- */

.guten-bot-direct .gb-panel{
  height:100%;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  padding:14px;
  background:#fbfaf7;
  scrollbar-width:thin;
}

.guten-bot-direct .gb-brand{
  gap:10px;
  padding:2px 2px 12px;
}

.guten-bot-direct .gb-brand img{
  width:42px;
  height:42px;
  flex:0 0 42px;
}

.guten-bot-direct .gb-brand div{
  gap:1px;
}

.guten-bot-direct .gb-brand strong{
  font-size:18px;
  line-height:1.15;
}

.guten-bot-direct .gb-brand span{
  font-size:12px;
  line-height:1.25;
}

/* Cuenta: deja de sacrificar el nombre/correo para mostrar Admin/Salir. */
.guten-bot-direct .gb-account{
  grid-template-columns:40px minmax(0,1fr);
  grid-template-areas:
    "avatar copy"
    "actions actions";
  gap:8px 10px;
  align-items:start;
  margin-top:10px;
  padding:10px;
}

.guten-bot-direct .gb-account-avatar{
  grid-area:avatar;
  width:40px;
  height:40px;
  font-size:12px;
}

.guten-bot-direct .gb-account-copy{
  grid-area:copy;
  min-width:0;
  gap:2px;
  padding-top:2px;
}

.guten-bot-direct .gb-account-copy strong,
.guten-bot-direct .gb-account-copy span{
  overflow:visible;
  text-overflow:clip;
  white-space:normal;
  overflow-wrap:anywhere;
}

.guten-bot-direct .gb-account-copy strong{
  font-size:12px;
  line-height:1.25;
}

.guten-bot-direct .gb-account-copy span{
  font-size:12px;
  line-height:1.25;
}

.guten-bot-direct .gb-account-actions{
  grid-area:actions;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  width:100%;
  padding-top:3px;
}

.guten-bot-direct .gb-admin-badge{
  font-size:11px!important;
  padding:3px 7px;
}

.guten-bot-direct .gb-account-logout{
  font-size:12px!important;
}

/* Nueva planificación más compacta. */
.guten-bot-direct .gb-new{
  min-height:42px;
  margin:10px 0 0;
  padding:9px 11px;
  border-radius:10px;
}

/* Contexto: más información en menos alto, sin comprimir valores. */
.guten-bot-direct .gb-section{
  padding:12px 0;
}

.guten-bot-direct .gb-section-title{
  margin-bottom:8px;
  font-size:12px;
  letter-spacing:.06em;
}

.guten-bot-direct .gb-mini-link{
  font-size:12px;
}

.guten-bot-direct .gb-context{
  gap:6px;
}

.guten-bot-direct .gb-context>div{
  grid-template-columns:78px minmax(0,1fr);
  gap:7px;
  align-items:start;
}

.guten-bot-direct .gb-context span,
.guten-bot-direct .gb-context strong{
  font-size:12px;
  line-height:1.3;
}

.guten-bot-direct .gb-context strong{
  overflow-wrap:anywhere;
}

/* Herramientas: mantienen 2 columnas pero bajan la altura. */
.guten-bot-direct .gb-create-grid{
  gap:7px;
}

.guten-bot-direct .gb-create-grid button{
  min-height:48px;
  padding:8px 9px;
  gap:2px;
}

.guten-bot-direct .gb-create-grid button span{
  font-size:12px;
}

/* Historial usa el espacio restante sin empujar Biblioteca fuera. */
.guten-bot-direct .gb-history-section{
  padding-bottom:10px;
}

.guten-bot-direct .gb-history-empty{
  padding:9px;
  font-size:12px;
  line-height:1.35;
}

.guten-bot-direct .gb-coming{
  font-size:11px!important;
}

.guten-bot-direct .gb-panel-spacer{
  min-height:8px;
}

.guten-bot-direct .gb-admin{
  position:sticky;
  bottom:0;
  min-height:48px;
  margin-top:4px;
  padding:9px 10px;
  background:#fff;
  box-shadow:0 -7px 12px #fbfaf7;
}

.guten-bot-direct .gb-admin strong,
.guten-bot-direct .gb-admin small{
  font-size:12px;
}

/* ---------------------------------------------------------
   ZONA PRINCIPAL
   --------------------------------------------------------- */

.guten-bot-direct .gb-main-header{
  min-height:0;
  padding:16px 26px 13px;
  align-items:center;
}

.guten-bot-direct .gb-main-header>div:first-child{
  min-width:0;
}

.guten-bot-direct .gb-eyebrow{
  margin-bottom:5px;
  font-size:12px;
  letter-spacing:.12em;
}

.guten-bot-direct .gb-main-header h1{
  margin:0;
  font-size:clamp(28px,2.4vw,38px);
  line-height:1.05;
}

.guten-bot-direct .gb-main-header p{
  margin:5px 0 0;
  font-size:12px;
}

.guten-bot-direct .gb-status{
  flex:0 0 auto;
  font-size:12px;
  padding:7px 10px;
}

/* Filtros: una sola franja compacta. */
.guten-bot-direct .gb-filters{
  padding:9px 26px 10px;
  gap:9px;
}

.guten-bot-direct .gb-filters label{
  gap:4px;
}

.guten-bot-direct .gb-filters label>span:first-child{
  font-size:12px;
  letter-spacing:.05em;
}

.guten-bot-direct .gb-filters select,
.guten-bot-direct .gb-select-button{
  height:38px;
  font-size:12px;
}

/* Chat aprovecha TODO el espacio libre entre filtros y compositor. */
.guten-bot-direct .gb-chat{
  min-height:0;
  overflow:auto;
  padding:14px 26px;
}

.guten-bot-direct .gb-message{
  max-width:1120px;
  margin:0 auto 14px;
}

.guten-bot-direct .gb-bubble{
  width:min(920px,100%);
  padding:14px 16px;
}

.guten-bot-direct .gb-bubble p,
.guten-bot-direct .gb-examples button,
.guten-bot-direct .gb-source-note{
  font-size:12px;
}

.guten-bot-direct .gb-source-note{
  margin-top:12px;
  padding:9px 11px;
}

/* Compositor pegado abajo sin franja blanca sobrante. */
.guten-bot-direct .gb-composer-wrap{
  position:relative;
  bottom:auto;
  padding:8px 26px 10px;
  background:#fff;
  border-top:1px solid #e9e6df;
}

.guten-bot-direct .gb-context-strip{
  max-width:1120px;
  margin:0 auto 6px;
}

.guten-bot-direct .gb-context-strip span{
  font-size:12px;
}

.guten-bot-direct .gb-composer{
  max-width:1120px;
  margin:0 auto;
  min-height:52px;
}

.guten-bot-direct .gb-composer textarea{
  min-height:44px;
  max-height:120px;
  padding:12px 14px;
  font-size:12px;
}

.guten-bot-direct .gb-send{
  min-width:106px;
  min-height:44px;
  padding:0 16px;
}

.guten-bot-direct .gb-helper{
  max-width:1120px;
  margin:6px auto 0;
  font-size:12px;
}

/* En resoluciones medianas, un panel ligeramente más estrecho. */
@media(max-width:1200px){
  .guten-bot-direct .guten-app-main .gb-shell{
    grid-template-columns:270px minmax(0,1fr);
  }

  .guten-bot-direct .gb-main-header,
  .guten-bot-direct .gb-filters,
  .guten-bot-direct .gb-chat,
  .guten-bot-direct .gb-composer-wrap{
    padding-left:18px;
    padding-right:18px;
  }
}

/* Tablet: el panel sigue visible pero más compacto. */
@media(max-width:980px) and (min-width:721px){
  .guten-bot-direct .guten-app-main .gb-shell{
    grid-template-columns:235px minmax(0,1fr);
  }

  .guten-bot-direct .gb-brand span{
    display:none;
  }

  .guten-bot-direct .gb-account{
    grid-template-columns:36px minmax(0,1fr);
  }

  .guten-bot-direct .gb-account-avatar{
    width:36px;
    height:36px;
  }

  .guten-bot-direct .gb-filters{
    grid-template-columns:1fr 1fr;
  }
}

/* Móvil conserva el flujo vertical ya existente. */
@media(max-width:720px){
  .guten-bot-direct .guten-app-main section.gb-main{
    padding:0!important;
  }

  .guten-bot-direct .guten-app-main .gb-shell{
    display:block;
  }

  .guten-bot-direct .gb-main-header{
    align-items:flex-start;
  }
}


/* =========================================================
   GUTEN-BOT 3.4 · ESTRUCTURA CURRICULAR
   ========================================================= */

.gb-curriculum-guidance{
  margin:12px 0;
  padding:11px 12px;
  border:1px solid #e3ddcf;
  border-radius:10px;
  background:#fbf7ee;
  color:#756a57;
  font-size:12px;
  line-height:1.5;
}

.gb-curriculum-unit-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.gb-curriculum-unit-head small{
  max-width:45%;
  color:#85867f;
  text-align:right;
}

.gb-oa-item{
  display:grid;
  grid-template-columns:72px minmax(0,1fr);
  gap:8px;
  align-items:start;
}

.gb-oa-item b,
.gb-oa-item span{
  font-size:12px;
}

.gb-curriculum-import-modal{
  width:min(1120px,calc(100vw - 28px));
  max-height:calc(100dvh - 24px);
}

.gb-curriculum-source-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:16px;
}

.gb-curriculum-source-grid label,
.gb-curriculum-edit-card label{
  display:grid;
  gap:5px;
}

.gb-curriculum-source-grid .wide,
.gb-curriculum-edit-card .wide,
.gb-oa-unit-links{
  grid-column:1/-1;
}

.gb-curriculum-source-grid label>span,
.gb-curriculum-edit-card label>span{
  color:#777871;
  font-size:12px;
  font-weight:700;
}

.gb-curriculum-source-grid input,
.gb-curriculum-source-grid select,
.gb-curriculum-edit-card input,
.gb-curriculum-edit-card textarea{
  width:100%;
  padding:9px 10px;
  border:1px solid #dcd8d0;
  border-radius:8px;
  background:#fff;
  color:#292a27;
  font-family:"Google Sans",sans-serif;
  font-size:12px;
}

.gb-curriculum-source-note{
  display:grid;
  gap:4px;
  margin-top:12px;
  padding:11px 12px;
  border:1px solid #e4dfd5;
  border-radius:10px;
  background:#faf8f3;
}

.gb-curriculum-import-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin-top:14px;
}

.gb-curriculum-review-summary{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  margin-top:14px;
}

.gb-curriculum-review-summary article{
  display:grid;
  gap:3px;
  padding:12px;
  border:1px solid #e1ddd5;
  border-radius:10px;
  background:#faf9f6;
}

.gb-curriculum-review-summary strong{
  font-size:20px;
}

.gb-curriculum-review-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:18px 0 9px;
}

.gb-curriculum-review-head>div{
  display:grid;
  gap:2px;
}

.gb-curriculum-review-head span{
  color:#7c7d76;
}

.gb-curriculum-edit-list{
  display:grid;
  gap:8px;
}

.gb-curriculum-edit-card{
  display:grid;
  grid-template-columns:120px minmax(0,1fr);
  gap:9px;
  padding:11px;
  border:1px solid #dedad2;
  border-radius:10px;
  background:#fff;
}

.gb-curriculum-edit-card.is-excluded{
  opacity:.55;
  background:#f4f2ee;
}

.gb-curriculum-include{
  display:flex!important;
  align-items:center;
  gap:6px!important;
}

.gb-curriculum-include input{
  width:auto;
}

.gb-oa-edit-card{
  grid-template-columns:150px minmax(0,1fr);
}

.gb-oa-unit-links{
  display:grid;
  gap:5px;
}

.gb-oa-unit-links>span{
  color:#777871;
  font-weight:700;
}

.gb-oa-unit-links>div{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}

.gb-oa-unit-links label{
  display:flex;
  align-items:center;
  gap:5px;
  padding:5px 8px;
  border:1px solid #ddd9d1;
  border-radius:999px;
  background:#faf9f6;
}

.gb-oa-unit-links input{
  width:auto;
}

.gb-real-oa-list{
  display:grid;
  gap:7px;
  max-height:320px;
  overflow:auto;
}

.gb-real-oa-item{
  display:grid;
  grid-template-columns:18px minmax(0,1fr);
  gap:8px;
  align-items:start;
  padding:8px;
  border:1px solid #e0ddd6;
  border-radius:8px;
  background:#fff;
}

.gb-real-oa-item span{
  display:grid;
  gap:2px;
  line-height:1.45;
}

.gb-oa-empty{
  padding:10px;
  border:1px dashed #d9d5cd;
  border-radius:8px;
  background:#faf9f6;
  color:#7c7d76;
}

.gb-upload-oa-field{
  display:grid;
  gap:7px;
}

.gb-upload-oa-field>div:first-child{
  display:grid;
  gap:2px;
}

.gb-upload-oa-field>div:first-child>span{
  color:#777871;
  font-size:12px;
  font-weight:700;
}

.gb-upload-oa-field small{
  color:#888982;
}

.gb-upload-oa-options{
  display:grid;
  gap:6px;
  max-height:240px;
  overflow:auto;
  padding:8px;
  border:1px solid #e0dcd4;
  border-radius:9px;
  background:#faf9f6;
}

.gb-upload-oa-options label{
  display:grid;
  grid-template-columns:18px minmax(0,1fr);
  gap:7px;
  align-items:start;
  padding:7px;
  border-radius:7px;
  background:#fff;
}

.gb-upload-oa-options label span{
  display:grid;
  gap:2px;
  line-height:1.4;
}

.gb-muted{
  color:#85867f;
}

@media(max-width:760px){
  .gb-curriculum-source-grid,
  .gb-curriculum-review-summary{
    grid-template-columns:1fr;
  }

  .gb-curriculum-edit-card,
  .gb-oa-edit-card{
    grid-template-columns:1fr;
  }

  .gb-curriculum-source-grid .wide,
  .gb-curriculum-edit-card .wide,
  .gb-oa-unit-links{
    grid-column:auto;
  }

  .gb-curriculum-unit-head{
    display:grid;
  }

  .gb-curriculum-unit-head small{
    max-width:none;
    text-align:left;
  }
}


/* =========================================================
   GUTEN-BOT 3.4.1 · BOTÓN CURRÍCULUM INTEGRADO
   ========================================================= */

#importCurriculumButton{
  opacity:1!important;
  cursor:pointer!important;
}

.gb-curriculum-empty-source{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-top:12px;
  padding:14px;
  border:1px solid #ddd7ca;
  border-radius:11px;
  background:#faf7f0;
}

.gb-curriculum-empty-source>div{
  display:grid;
  gap:4px;
}

.gb-curriculum-empty-source strong{
  font-size:13px;
}

.gb-curriculum-empty-source span{
  max-width:680px;
  color:#777269;
  font-size:12px;
  line-height:1.5;
}

.gb-curriculum-empty-source button{
  flex:0 0 auto;
}

@media(max-width:720px){
  .gb-curriculum-empty-source{
    align-items:stretch;
    flex-direction:column;
  }
}


/* =========================================================
   GUTEN-BOT 3.4.2 · FUENTES CURRICULARES + PARSER MINEDUC
   ========================================================= */

.gb-curriculum-sources{
  margin:14px 0 18px;
  padding:0!important;
}

.gb-curriculum-sources-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-bottom:8px;
}

.gb-curriculum-sources-head>div{
  display:grid;
  gap:2px;
}

.gb-curriculum-sources-head strong{
  font-size:14px;
}

.gb-curriculum-sources-head span{
  color:#777871;
  line-height:1.45;
}

.gb-curriculum-source-cards{
  display:grid;
  gap:8px;
}

.gb-curriculum-source-card{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:14px;
  align-items:center;
  padding:12px;
  border:1px solid #ddd9d1;
  border-radius:11px;
  background:#fff;
}

.gb-curriculum-source-main{
  min-width:0;
  display:grid;
  gap:8px;
}

.gb-curriculum-source-main>div:first-child{
  display:grid;
  gap:2px;
}

.gb-curriculum-source-main strong{
  font-size:13px;
}

.gb-curriculum-source-main>div:first-child>span{
  color:#7f807a;
  overflow-wrap:anywhere;
}

.gb-curriculum-source-badges{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
}

.gb-curriculum-source-badges span{
  padding:4px 7px;
  border-radius:999px;
  background:#efede7;
  color:#777871;
  font-size:11px!important;
  font-weight:700;
}

.gb-curriculum-source-badges .is-pending{
  background:#fff0d9;
  color:#8c641f;
}

.gb-curriculum-source-badges .is-ready{
  background:#e9f5eb;
  color:#487553;
}

.gb-curriculum-structure-title{
  display:grid;
  gap:2px;
  margin:18px 0 9px;
  padding-top:14px;
  border-top:1px solid #e5e1d9;
}

.gb-curriculum-structure-title strong{
  font-size:14px;
}

.gb-curriculum-structure-title span{
  color:#7d7e78;
}

@media(max-width:720px){
  .gb-curriculum-source-card{
    grid-template-columns:1fr;
  }

  .gb-curriculum-source-card button{
    width:100%;
  }
}


/* =========================================================
   GUTEN-BOT 3.4.3 · GESTIÓN DE OA
   ========================================================= */

.gb-danger-button{
  min-height:34px;
  padding:7px 10px;
  border:1px solid #e5c5c0;
  border-radius:8px;
  background:#fff8f6;
  color:#9a4f45;
  font-family:"Google Sans",sans-serif;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
}

.gb-danger-button:hover{
  background:#fcecea;
  border-color:#dcaea7;
}

.gb-draft-destructive-actions{
  display:flex;
  justify-content:flex-end;
  padding-top:3px;
}

.gb-oa-managed-item{
  grid-template-columns:72px minmax(0,1fr);
}

.gb-oa-managed-content{
  min-width:0;
  display:grid;
  gap:9px;
}

.gb-oa-managed-content>span{
  line-height:1.5;
}

.gb-oa-management-actions{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  padding-top:2px;
}

.gb-oa-management-actions button{
  min-height:32px;
  padding:6px 9px;
  font-size:11px!important;
}

.gb-objective-editor-modal{
  width:min(760px,calc(100vw - 28px));
}

.gb-objective-editor-form{
  display:grid;
  gap:12px;
  margin-top:15px;
}

.gb-objective-editor-form label{
  display:grid;
  gap:5px;
}

.gb-objective-editor-form label>span{
  color:#777871;
  font-size:12px;
  font-weight:700;
}

.gb-objective-editor-form input,
.gb-objective-editor-form textarea{
  width:100%;
  padding:10px 11px;
  border:1px solid #dcd8d0;
  border-radius:8px;
  background:#fff;
  color:#292a27;
  font-family:"Google Sans",sans-serif;
  font-size:12px;
  line-height:1.5;
}

.gb-objective-editor-form textarea{
  resize:vertical;
  min-height:160px;
}

.gb-objective-editor-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin-top:14px;
}

@media(max-width:720px){
  .gb-oa-managed-item{
    grid-template-columns:1fr;
  }

  .gb-oa-management-actions{
    display:grid;
    grid-template-columns:1fr;
  }

  .gb-oa-management-actions button{
    width:100%;
  }
}


/* =========================================================
   GUTEN-BOT 3.4.4 · UNIDADES + ALTURA COMPLETA
   ========================================================= */

.guten-bot-direct > .guten-app-main{
  height:100dvh!important;
  min-height:100dvh!important;
}

.guten-bot-direct .gb-panel{
  /*
    El robot flotante vive en la esquina superior izquierda.
    Solo desplazamos el contenido de este panel, no el área del chat.
  */
  padding-top:72px!important;
}

.gb-curriculum-unit-head{
  align-items:flex-start;
}

.gb-curriculum-unit-title{
  min-width:0;
  display:grid;
  gap:3px;
}

.gb-curriculum-unit-title strong{
  line-height:1.35;
}

.gb-curriculum-unit-title small{
  max-width:none;
  text-align:left;
}

.gb-edit-unit-button{
  flex:0 0 auto;
  min-height:34px;
  padding:7px 10px;
}

.gb-unit-editor-modal{
  width:min(720px,calc(100vw - 28px));
}

.gb-unit-editor-context{
  margin-top:12px;
  padding:8px 10px;
  border:1px solid #e1ddd5;
  border-radius:8px;
  background:#faf9f6;
  color:#74756f;
  font-size:12px;
}

.gb-curriculum-source-badges .is-context-adjusted{
  background:#e8f1fb;
  color:#41698b;
}

/*
  El selector de Unidad usa el nivel/año del documento fuente cuando
  una importación anterior quedó guardada bajo un nivel incorrecto.
  Esto permite que III° medio muestre inmediatamente sus unidades.
*/
.guten-bot-direct .gb-filters select:disabled{
  cursor:not-allowed;
}

@media(max-width:720px){
  .guten-bot-direct .gb-panel{
    padding-top:64px!important;
  }

  .gb-curriculum-unit-head{
    display:grid;
    grid-template-columns:1fr;
  }

  .gb-edit-unit-button{
    width:max-content;
  }
}
