* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: #1c2733;
  background: #f4f6f8;
}
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: #14304a; color: #fff;
}
header h1 { font-size: 18px; margin: 0; }
header a, header button {
  color: #fff; background: transparent; border: 1px solid #4a6b8a;
  border-radius: 6px; padding: 6px 12px; cursor: pointer; font-size: 14px;
}
.center { max-width: 420px; margin: 12vh auto; padding: 24px; }
.card-box, .login-box {
  background: #fff; border-radius: 10px; padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.login-box input {
  width: 100%; padding: 10px; margin: 10px 0;
  border: 1px solid #c4ccd4; border-radius: 6px; font-size: 15px;
}
.login-box button, .send-row button {
  background: #14304a; color: #fff; border: 0; border-radius: 6px;
  padding: 10px 16px; font-size: 15px; cursor: pointer;
}
.error { color: #b00020; font-size: 14px; }
.agents { max-width: 720px; margin: 40px auto; padding: 0 16px; }
.agent-card {
  display: block; background: #fff; border-radius: 10px; padding: 18px;
  margin-bottom: 14px; text-decoration: none; color: inherit;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.agent-card h3 { margin: 0 0 6px; color: #14304a; }
.agent-card p { margin: 0; color: #51606e; font-size: 14px; }
.layout { display: flex; height: calc(100vh - 57px); }
.chat { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.messages { flex: 1; overflow-y: auto; padding: 20px; }
.msg { max-width: 760px; margin: 0 auto 16px; }
.msg .role { font-size: 12px; color: #8593a0; margin-bottom: 4px; }
.msg .body { background: #fff; border-radius: 10px; padding: 12px 16px; }
.msg.user .body { background: #dde7f0; }
.msg .body a[href^="#cite:"] { color: #14304a; font-weight: 600; }
.send-row {
  display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid #dde2e7;
  background: #fff;
}
.send-row textarea {
  flex: 1; resize: none; padding: 10px; border: 1px solid #c4ccd4;
  border-radius: 6px; font-size: 15px; font-family: inherit; height: 46px;
}
.panel {
  width: 380px; border-left: 1px solid #dde2e7; background: #fff;
  overflow-y: auto; padding: 20px; flex-shrink: 0;
}
.panel.hidden { display: none; }
.gutter {
  width: 4px; cursor: col-resize; background: transparent;
  flex-shrink: 0; transition: background-color 120ms;
}
.gutter:hover, .gutter:active { background: #c4ccd4; }
.gutter.hidden { display: none; }
.panel .close { float: right; cursor: pointer; border: 0; background: none; font-size: 18px; }
.sidebar {
  width: 240px; border-right: 1px solid #dde2e7; background: #fff;
  overflow-y: auto; padding: 12px; flex-shrink: 0;
}
.sidebar #new-chat {
  width: 100%; background: #14304a; color: #fff; border: 0;
  border-radius: 6px; padding: 9px; font-size: 14px; cursor: pointer;
}
.conv-list { list-style: none; margin: 12px 0 0; padding: 0; }
.conv-list li {
  display: flex; align-items: center; justify-content: space-between;
  border-radius: 6px; padding: 2px 4px 2px 8px;
}
.conv-list li.attiva { background: #eef2f6; }
.conv-list a {
  flex: 1; min-width: 0; padding: 6px 0; font-size: 13px; color: #1c2733;
  text-decoration: none; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
}
.conv-list .del {
  border: 0; background: none; color: #8593a0; cursor: pointer;
  font-size: 16px; line-height: 1;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 20px 0; }
.chip {
  display: flex; align-items: center; gap: 6px; background: #eef2f6;
  border-radius: 6px; padding: 4px 8px; font-size: 13px;
}
.chip.troncato { background: #fbeecc; }
.chip .rm {
  border: 0; background: none; cursor: pointer; font-size: 14px;
  line-height: 1; color: #51606e;
}
.avviso { margin: 8px 20px 0; color: #b00020; font-size: 13px; }
.avviso.hidden { display: none; }
#attach {
  background: transparent; border: 1px solid #c4ccd4; border-radius: 6px;
  font-size: 16px; cursor: pointer; padding: 0 12px;
}
.panel .originali {
  margin-top: 20px; border-top: 1px solid #dde2e7; padding-top: 14px;
}
.panel .originali h4 {
  margin: 0 0 8px; font-size: 13px; color: #51606e;
}
.panel .originali ul { list-style: none; margin: 0; padding: 0; }
.panel .originali li { margin: 6px 0; }
.panel .originali a {
  color: #14304a; text-decoration: none; font-size: 14px;
}
.panel .originali a:hover { text-decoration: underline; }
.chat-header {
  padding: 8px 20px; border-bottom: 1px solid #dde2e7;
  display: flex; align-items: center; gap: 10px;
}
.chat-header label {
  font-size: 13px; color: #51606e; display: flex; align-items: center; gap: 6px;
}
.chat-header select {
  font-size: 13px; padding: 4px 6px; border: 1px solid #c4ccd4;
  border-radius: 6px; font-family: inherit;
}
.chat-header .export-conv { font-size: 12px; color: #51606e; margin-left: auto; }
.chat-header .export-conv a { color: #14304a; margin-left: 6px; }
.msg-exp { font-size: 11px; color: #8593a0; margin-top: 6px; }
.kebab {
  border: 0; background: none; cursor: pointer;
  color: #8593a0; font-size: 18px; line-height: 1;
  padding: 0 6px; align-self: center;
}
.kebab:hover { color: #14304a; }
.kebab-menu {
  position: absolute; z-index: 10;
  background: #fff; border: 1px solid #c4ccd4; border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
  padding: 4px 0; min-width: 180px;
}
.kebab-menu .item {
  display: block; padding: 6px 14px; font-size: 13px;
  color: #1c2733; cursor: pointer; white-space: nowrap;
}
.kebab-menu .item:hover { background: #eef2f6; }
.kebab-menu .item.sep {
  border-top: 1px solid #dde2e7; padding: 0; margin-top: 4px;
}
.kebab-menu .submenu-trigger { position: relative; }
.kebab-menu .submenu {
  display: none; position: absolute; left: 100%; top: 0;
  background: #fff; border: 1px solid #c4ccd4; border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,.15); padding: 4px 0; min-width: 180px;
}
.kebab-menu .submenu-trigger:hover .submenu { display: block; }
.msg-exp a { color: #14304a; }

.conv-list .folder-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 4px 4px 6px; font-size: 13px; font-weight: 600;
  color: #14304a;
}
.conv-list .folder-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-list .in-folder { padding-left: 14px; }
.conv-list .senza-cartella-header {
  margin-top: 10px; padding: 6px 4px 4px 6px;
  font-size: 12px; color: #8593a0; text-transform: uppercase; letter-spacing: .03em;
}
.sidebar #new-folder {
  width: 100%; background: #fff; color: #14304a; border: 1px solid #c4ccd4;
  border-radius: 6px; padding: 9px; font-size: 14px; cursor: pointer;
  margin-top: 6px;
}
.msft-login, .btn-microsoft {
  display: inline-block; background: #14304a; color: #fff;
  padding: 10px 16px; border-radius: 6px; text-decoration: none;
  font-size: 15px; margin-top: 10px;
}
.msft-login:hover, .btn-microsoft:hover { background: #1c4670; }
.user-header {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 12px; padding: 8px 20px;
  background: #f4f6f8; border-bottom: 1px solid #dde2e7;
  font-size: 13px; color: #51606e;
}
.user-header button {
  background: transparent; border: 1px solid #c4ccd4; border-radius: 6px;
  padding: 4px 10px; cursor: pointer; font-size: 13px; color: #14304a;
}
