* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #020914;
  --panel: rgba(8, 27, 45, 0.72);
  --panel-strong: rgba(9, 35, 59, 0.92);
  --glass: rgba(255, 255, 255, 0.035);
  --line: rgba(45, 205, 255, 0.28);
  --line-strong: rgba(45, 205, 255, 0.65);
  --text: #edfaff;
  --muted: #8fb7c9;
  --cyan: #23d5ff;
  --blue: #168cff;
  --green: #20f0a0;
  --amber: #ffb21d;
  --red: #ff3b4f;
  --radius: 18px;
  --shadow: 0 0 30px rgba(35, 213, 255, 0.08), inset 0 0 22px rgba(35, 213, 255, 0.04);
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 70% 20%, rgba(35, 213, 255, 0.12), transparent 32%),
    radial-gradient(circle at 20% 70%, rgba(22, 140, 255, 0.16), transparent 38%),
    linear-gradient(135deg, #010711 0%, #031225 48%, #020812 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(35, 213, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(35, 213, 255, 0.035) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 92%);
}

body:not(.is-authenticated) .container,
body:not(.is-authenticated) .modal-backdrop {
  display: none;
}

body.is-authenticated .auth-screen {
  display: none;
}

.auth-screen {
  min-height: 100vh;
  padding: 32px;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
}

.auth-shell {
  width: min(560px, 100%);
  display: grid;
  gap: 22px;
}

.auth-brand {
  width: min(280px, 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
}

.auth-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(4, 17, 31, 0.82);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  padding: 26px;
  display: grid;
  gap: 16px;
}

.auth-card h1,
.auth-card h2 {
  margin: 8px 0;
  font-size: 32px;
}

.auth-card label {
  display: grid;
  gap: 8px;
}

.auth-card label span {
  color: #bdeeff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.auth-card input {
  width: 100%;
  border: 1px solid rgba(35, 213, 255, 0.24);
  border-radius: 12px;
  background: rgba(1, 9, 18, 0.72);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
  padding: 13px;
}

.auth-card input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(35, 213, 255, 0.08);
}

.auth-status {
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
}

.auth-status.success {
  color: var(--green);
}

.auth-status.error {
  color: var(--red);
}

.container {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 380px;
  gap: 24px;
  padding: 20px 22px;
}

.sidebar,
.action-tile,
.placeholder-panel,
.task-panel,
.chat-container {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.sidebar {
  min-height: calc(100vh - 40px);
  max-height: calc(100vh - 40px);
  position: sticky;
  top: 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand {
  border-radius: 16px;
  padding: 18px 16px;
  background: linear-gradient(135deg, rgba(35, 213, 255, 0.12), rgba(255, 255, 255, 0.02));
  letter-spacing: 2px;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 19px;
  line-height: 1.05;
}

.brand span {
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
}

.nav-menu {
  flex: 1;
}

.user-card {
  border: 1px solid rgba(35, 213, 255, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.user-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.user-card b {
  color: var(--text);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.user-card .chat-option {
  padding: 10px 12px;
  border-radius: 12px;
}

#mySettingsButton {
  color: var(--cyan);
}

.nav-menu ul {
  list-style: none;
  display: grid;
  gap: 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 14px;
  border-radius: 14px;
  color: #cdeaf6;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: 180ms ease;
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(143, 183, 201, 0.5);
  border-radius: 8px;
  font-size: 12px;
  color: var(--cyan);
}

.nav-item:hover,
.nav-item.active {
  color: var(--cyan);
  border-color: var(--line-strong);
  background: linear-gradient(90deg, rgba(35, 213, 255, 0.22), rgba(35, 213, 255, 0.03));
  box-shadow: inset 4px 0 0 var(--cyan), 0 0 20px rgba(35, 213, 255, 0.16);
}

.system-status {
  border-radius: 16px;
  padding: 14px;
}

.system-status > b {
  font-size: 11px;
  letter-spacing: .14em;
  color: #bdeeff;
  font-weight: 800;
  margin-bottom: 12px;
}

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(35, 213, 255, 0.18);
  color: var(--muted);
  font-size: 13px;
}

.status-indicator {
  color: var(--red);
  text-shadow: 0 0 12px currentColor;
}

.status-indicator.connected {
  color: var(--green);
}

.status-grid {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.status-grid b {
  display: inline-block;
  color: var(--green);
  margin-top: 4px;
}

.main-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.right-panel {
  min-height: calc(100vh - 40px);
  max-height: calc(100vh - 40px);
  position: sticky;
  top: 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: hidden;
}

.profile-card {
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-card strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}

.profile-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}

.notification {
  width: 28px;
  height: 28px;
  background: var(--red);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: bold;
  color: var(--bg);
}

.header {
  min-height: 132px;
  border-radius: var(--radius);
  padding: 26px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.eyebrow {
  display: block;
  color: #bdeeff;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .18em;
  font-weight: 800;
}

.subtext {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin-top: 8px;
}

.chat-header p,
.action-tile span,
.mini-card span {
  color: var(--muted);
}

.section-title {
  font-size: 14px;
  font-weight: 900;
  color: #d8f8ff;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 10px;
}

.actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.action-tile {
  border-radius: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(35, 213, 255, 0.08), rgba(255, 255, 255, 0.02));
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.3s ease;
}

.action-tile:hover {
  background: linear-gradient(135deg, rgba(35, 213, 255, 0.15), rgba(35, 213, 255, 0.05));
  border-color: var(--cyan);
  transform: translateY(-2px);
}

.tile-icon {
  font-size: 24px;
  color: var(--cyan);
  font-weight: bold;
}

.action-tile b {
  font-size: 13px;
  color: var(--text);
}

.action-tile span {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.model-info,
.connection-status,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(35, 213, 255, 0.07);
  color: #d8f8ff;
  font-size: 12px;
  white-space: nowrap;
}

.speak-button,
.chat-option,
.send-button {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 18px;
  text-align: center;
  color: #d8f8ff;
  background: rgba(255, 255, 255, .04);
  text-decoration: none;
  font-weight: 900;
  cursor: pointer;
  transition: 180ms ease;
}

.speak-button {
  color: #001018;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  border: none;
}

.chat-option:hover,
.speak-button:hover,
.send-button:hover {
  transform: translateY(-2px);
  border-color: var(--cyan);
  box-shadow: 0 0 22px rgba(35, 213, 255, 0.18);
}

.chat-container {
  min-width: 0;
  min-height: 500px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(4, 17, 31, 0.75);
  flex: 1;
}

.chat-header {
  padding: 20px;
  border-bottom: 1px solid rgba(35, 213, 255, 0.16);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.chat-header h2 {
  font-size: 22px;
  margin: 6px 0 4px;
}

.chat-header p {
  font-size: 13px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(35, 213, 255, 0.2);
  border-radius: 999px;
}

.message {
  animation: slideIn 0.25s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.message .timestamp {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.message p {
  padding: 14px 16px;
  border-radius: 18px;
  line-height: 1.55;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.user-message p {
  margin-left: auto;
  max-width: 88%;
  background: rgba(35, 213, 255, 0.14);
  border-color: rgba(35, 213, 255, 0.32);
}

.ai-message p {
  max-width: 92%;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(32, 240, 160, 0.18);
}

.system-message p {
  max-width: 96%;
  background: rgba(255, 178, 29, 0.08);
  border-color: rgba(255, 178, 29, 0.22);
  color: #ffe5ab;
}

.message-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.message-actions .chat-option {
  min-height: 36px;
  padding: 9px 12px;
  border-radius: 11px;
  font-size: 12px;
}

.chat-input-area {
  border-top: 1px solid rgba(35, 213, 255, 0.16);
  padding: 16px;
}

.input-wrapper {
  display: flex;
  gap: 10px;
}

.message-input {
  flex: 1;
  min-width: 0;
  padding: 14px 15px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(1, 9, 18, 0.72);
  color: var(--text);
  outline: none;
  font-size: 14px;
}

.message-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(35, 213, 255, 0.08), 0 0 22px rgba(35, 213, 255, 0.12);
}

.message-input::placeholder {
  color: rgba(143, 183, 201, 0.8);
}

.send-button {
  min-width: 86px;
  color: #001018;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  border: none;
}

.send-button:disabled {
  opacity: .55;
  cursor: wait;
  transform: none;
}

.dictation-button {
  width: 46px;
  min-width: 46px;
  min-height: 46px;
  padding: 0;
  border: 1px solid rgba(32, 240, 160, 0.34);
  border-radius: 12px;
  box-shadow: 0 0 18px rgba(32, 240, 160, 0.1);
}

.dictation-button.listening {
  color: #001018;
  background: linear-gradient(135deg, var(--amber), var(--green));
  box-shadow: 0 0 26px rgba(255, 178, 29, 0.2);
}

.dictation-button:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

.model-selector-section {
  width: min(100%, 285px);
  margin: 0;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(35, 213, 255, 0.18);
  background: rgba(1, 9, 18, 0.42);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.model-label {
  grid-column: 1 / -1;
  color: #bdeeff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.model-selector {
  position: relative;
  min-width: 0;
}

.model-dropdown {
  width: 100%;
  min-height: 38px;
  appearance: none;
  border: 1px solid rgba(35, 213, 255, 0.24);
  border-radius: 12px;
  background: rgba(1, 9, 18, 0.72);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  outline: none;
  padding: 9px 36px 9px 12px;
}

.model-selector-section .connection-status {
  min-height: 38px;
  padding: 8px 12px;
}

.model-dropdown:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(35, 213, 255, 0.08);
}

.selector-icon {
  position: absolute;
  top: 50%;
  right: 12px;
  color: #bdeeff;
  font-size: 11px;
  pointer-events: none;
  transform: translateY(-50%);
}

.connection-status.ready {
  color: var(--green);
  border-color: rgba(32, 240, 160, 0.25);
  background: rgba(32, 240, 160, 0.08);
}

.connection-status.loading {
  color: var(--cyan);
}

.connection-status.error {
  color: var(--red);
  border-color: rgba(255, 59, 79, .35);
  background: rgba(255, 59, 79, 0.08);
}

.quick-section {
  min-width: 0;
}

.section-title {
  color: #bdeeff;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: .08em;
  margin: 0 0 12px 6px;
  text-transform: uppercase;
}

.actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.action-tile {
  min-height: 154px;
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  transition: 180ms ease;
}

.action-tile:hover {
  transform: translateY(-4px);
  border-color: var(--cyan);
  background: rgba(12, 54, 88, 0.8);
}

.task-trigger {
  cursor: pointer;
}

.task-trigger:focus-visible {
  outline: 3px solid rgba(35, 213, 255, 0.28);
  outline-offset: 3px;
}

.tile-icon {
  font-size: 38px;
  color: var(--cyan);
  line-height: 1;
}

.action-tile b {
  font-size: 16px;
}

.action-tile span {
  font-size: 13px;
  line-height: 1.5;
}

.placeholder-panel {
  border-radius: var(--radius);
  padding: 18px;
}

.task-panel {
  border-radius: var(--radius);
  padding: 18px;
}

.tasks-board-page,
.knowledge-page {
  display: grid;
  gap: 18px;
}

.tasks-board-page[hidden],
.knowledge-page[hidden],
.home-view[hidden] {
  display: none;
}

.tasks-board-header,
.board-toolbar,
.kanban-column {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.tasks-board-header {
  border-radius: var(--radius);
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.tasks-board-header h2 {
  margin-top: 8px;
  font-size: 34px;
}

.board-toolbar {
  border-radius: 16px;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.board-toolbar label {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.board-toolbar label span {
  color: #bdeeff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.board-toolbar select {
  min-height: 42px;
  appearance: none;
  border: 1px solid rgba(35, 213, 255, 0.24);
  border-radius: 12px;
  background: rgba(1, 9, 18, 0.72);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  outline: none;
  padding: 10px 12px;
}

.kanban-board {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.kanban-column {
  min-height: 430px;
  border-radius: 16px;
  padding: 12px;
  transition: 180ms ease;
}

.kanban-column.drag-over {
  border-color: var(--cyan);
  background: rgba(35, 213, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(35, 213, 255, 0.22), var(--shadow);
}

.kanban-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(35, 213, 255, 0.16);
  color: #d8f8ff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.kanban-column-header b {
  min-width: 28px;
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(35, 213, 255, 0.2);
  background: rgba(35, 213, 255, 0.07);
  color: var(--green);
}

.kanban-items {
  display: grid;
  gap: 10px;
  padding-top: 12px;
}

.kanban-card {
  border: 1px solid rgba(35, 213, 255, .16);
  border-radius: 14px;
  background: rgba(255, 255, 255, .025);
  padding: 13px;
  cursor: pointer;
  transition: 180ms ease;
}

.kanban-card.dragging {
  opacity: 0.52;
  transform: scale(0.98);
}

.kanban-card:hover,
.kanban-card:focus-visible {
  border-color: var(--cyan);
  background: rgba(12, 54, 88, 0.62);
  transform: translateY(-2px);
}

.kanban-card:focus-visible {
  outline: 3px solid rgba(35, 213, 255, 0.22);
  outline-offset: 3px;
}

.kanban-card b,
.kanban-card span {
  display: block;
}

.kanban-card b {
  color: var(--text);
  font-size: 14px;
}

.kanban-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 7px;
}

.kanban-card .card-owner {
  color: var(--green);
  font-weight: 900;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(35, 213, 255, 0.16);
  font-size: 13px;
  font-weight: 900;
  color: #d8f8ff;
  text-transform: uppercase;
}

.placeholder-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding-top: 16px;
}

.quick-link-grid {
  grid-template-columns: repeat(4, 64px);
  justify-content: start;
  align-items: center;
  gap: 12px;
}

.mini-card {
  padding: 16px;
  border-radius: 8px;
  border: 1px solid rgba(35, 213, 255, .16);
  background: rgba(8, 27, 45, 0.48);
}

.quick-link-card,
.quick-link-card:link,
.quick-link-card:visited,
.quick-link-card:hover,
.quick-link-card:active {
  position: relative;
  width: 64px;
  height: 64px;
  min-height: 64px;
  padding: 9px;
  display: grid;
  place-items: center;
  color: var(--text) !important;
  text-decoration: none !important;
  transition: 180ms ease;
}

.quick-link-card *,
.quick-link-card:visited *,
.quick-link-card:hover * {
  text-decoration: none !important;
}

.quick-link-icon {
  width: 46px;
  height: 46px;
  display: grid !important;
  place-items: center;
  border: 1px solid rgba(35, 213, 255, 0.42);
  border-radius: 8px;
  color: var(--cyan) !important;
  font-size: 20px;
  background: rgba(35, 213, 255, 0.06);
  margin-top: 0 !important;
}

.quick-link-card[hidden] {
  display: none;
}

.quick-link-filter {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(35, 213, 255, 0.24);
  border-radius: 8px;
  background: rgba(1, 9, 18, 0.45);
}

.quick-link-filter-button {
  min-width: 70px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
}

.quick-link-card[aria-disabled="true"] {
  cursor: default;
  opacity: 0.7;
}

.quick-link-card[aria-disabled="true"]:hover,
.quick-link-card[aria-disabled="true"]:focus-visible {
  transform: none;
}

.knowledge-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.prompts-placeholder {
  min-height: 180px;
}

.prompt-library {
  display: grid;
  gap: 16px;
  padding-top: 16px;
}

.prompt-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  overflow: hidden;
}

.prompt-card-header {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.prompt-card h3 {
  color: var(--text);
  font-size: 18px;
}

.prompt-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 6px;
}

.prompt-card pre {
  max-height: 460px;
  overflow: auto;
  margin: 0;
  padding: 16px;
  color: var(--text);
  background: #f7f8fb;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.quick-link-filter-button:hover,
.quick-link-filter-button:focus-visible,
.quick-link-filter-button.active {
  color: var(--cyan);
  border-color: rgba(35, 213, 255, 0.42);
  background: rgba(35, 213, 255, 0.12);
  outline: none;
}

.quick-link-copy {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 5;
  min-width: max-content;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 17, 31, 0.96);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32), 0 0 18px rgba(35, 213, 255, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: 160ms ease;
}

.quick-link-copy b {
  color: #edfaff !important;
  font-size: 14px;
  line-height: 1.2;
}

.quick-link-copy small {
  display: none !important;
}

.quick-link-card:hover,
.quick-link-card:focus-visible {
  border-color: var(--line-strong);
  background: rgba(9, 35, 59, 0.72);
  box-shadow: 0 0 18px rgba(35, 213, 255, 0.14);
  transform: translateY(-2px);
  outline: none;
}

.quick-link-card:hover .quick-link-copy,
.quick-link-card:focus-visible .quick-link-copy {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mini-card b,
.mini-card span {
  display: block;
}

.mini-card span {
  margin-top: 7px;
  font-size: 13px;
}

.task-list {
  display: grid;
  gap: 10px;
  padding-top: 16px;
}

.task-sync-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding-top: 16px;
}

.task-sync-bar input {
  min-width: 0;
  border: 1px solid rgba(35, 213, 255, 0.24);
  border-radius: 12px;
  background: rgba(1, 9, 18, 0.72);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
  padding: 12px 13px;
}

.task-sync-bar input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(35, 213, 255, 0.08);
}

.task-row,
.empty-state {
  border: 1px solid rgba(35, 213, 255, .16);
  border-radius: 14px;
  background: rgba(255, 255, 255, .025);
  padding: 14px 16px;
}

.task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  cursor: pointer;
  transition: 180ms ease;
}

.task-row:hover,
.task-row:focus-visible {
  border-color: var(--cyan);
  background: rgba(12, 54, 88, 0.62);
  transform: translateY(-2px);
}

.task-row:focus-visible {
  outline: 3px solid rgba(35, 213, 255, 0.22);
  outline-offset: 3px;
}

.task-row b,
.task-row span {
  min-width: 0;
}

.task-row b {
  color: var(--text);
}

.task-row span,
.empty-state {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.empty-state-error {
  color: var(--red);
}

.task-sync-bar button:disabled {
  opacity: .55;
  cursor: wait;
  transform: none;
}

.task-row .task-meta {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(1, 9, 18, 0.72);
  backdrop-filter: blur(14px);
}

.modal-backdrop.open {
  display: grid;
}

.task-modal {
  width: min(760px, 100%);
  max-height: min(860px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(4, 17, 31, 0.96);
  box-shadow: 0 22px 90px rgba(0, 0, 0, 0.42), var(--shadow);
}

.settings-modal {
  width: min(620px, 100%);
}

.modal-header {
  padding: 22px 24px;
  border-bottom: 1px solid rgba(35, 213, 255, 0.16);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.modal-header h2 {
  margin-top: 8px;
  font-size: 28px;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.icon-button:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.task-form {
  padding: 22px 24px 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.task-form label {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.task-form label span {
  color: #bdeeff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.full-field,
.task-form-status,
.modal-actions {
  grid-column: 1 / -1;
}

.task-form input,
.task-form textarea,
.task-form select {
  width: 100%;
  border: 1px solid rgba(35, 213, 255, 0.24);
  border-radius: 12px;
  background: rgba(1, 9, 18, 0.72);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
  padding: 12px 13px;
}

.task-form input[type="file"] {
  min-height: 45px;
  color: var(--muted);
}

.task-form textarea {
  resize: vertical;
}

.task-form input:focus,
.task-form textarea:focus,
.task-form select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(35, 213, 255, 0.08);
}

.task-form input:read-only,
.task-form textarea:read-only {
  color: #d8f8ff;
  border-color: rgba(35, 213, 255, 0.14);
  background: rgba(255, 255, 255, 0.035);
}

.task-form-status {
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
}

.task-form-status.success {
  color: var(--green);
}

.task-form-status.error {
  color: var(--red);
}

.ai-task-draft {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f7f8fb;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.ai-task-draft-header {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.ai-task-draft-header p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin-top: 5px;
}

.ai-task-draft .send-button {
  white-space: nowrap;
}

.task-comments {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(35, 213, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.task-comments-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: #bdeeff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.task-comments-header b {
  min-width: 28px;
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(35, 213, 255, 0.2);
  background: rgba(35, 213, 255, 0.07);
  color: var(--green);
}

.task-comment-list {
  display: grid;
  gap: 10px;
}

.task-comment {
  border: 1px solid rgba(35, 213, 255, 0.14);
  border-radius: 8px;
  background: rgba(1, 9, 18, 0.45);
  padding: 12px;
}

.task-comment-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.task-comment-meta b {
  color: var(--text);
}

.task-comment p {
  margin-top: 8px;
  color: #d8f8ff;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.task-comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.task-comment-form textarea {
  min-height: 48px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.settings-profile {
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(35, 213, 255, 0.16);
}

.settings-avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--cyan);
  background: radial-gradient(circle at 50% 30%, rgba(35, 213, 255, 0.34), rgba(8, 27, 45, 0.82));
  box-shadow: 0 0 26px rgba(35, 213, 255, 0.18);
  font-weight: 900;
  font-size: 22px;
}

.settings-profile h3 {
  font-size: 22px;
  margin-bottom: 4px;
}

.settings-profile p {
  color: var(--muted);
  font-size: 13px;
}

.settings-grid {
  padding: 22px 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settings-field {
  min-width: 0;
  border: 1px solid rgba(35, 213, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  padding: 13px;
}

.settings-field span {
  display: block;
  color: #bdeeff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.settings-field b {
  display: block;
  margin-top: 7px;
  color: var(--text);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.settings-notice {
  grid-column: 1 / -1;
}

.settings-actions {
  padding: 0 24px 24px;
}

@media (max-width: 1280px) {
  .container {
    grid-template-columns: 90px minmax(0, 1fr) 340px;
    gap: 18px;
    padding: 16px;
  }

  .sidebar .brand strong,
  .sidebar .brand span,
  .sidebar .system-status > b,
  .sidebar .status span:last-child,
  .sidebar .status-grid,
  .nav-item span {
    display: none;
  }

  .sidebar {
    align-items: center;
    padding: 14px 10px;
  }

  .sidebar .brand {
    width: 58px;
    height: 58px;
    padding: 0;
  }

  .sidebar .brand::before {
    content: "BS";
    display: grid;
    place-items: center;
    height: 100%;
    color: var(--cyan);
    font-weight: 900;
  }

  .nav-item {
    justify-content: center;
  }

  .chat-container {
    min-height: 520px;
  }
}

@media (max-width: 900px) {
  .auth-screen {
    padding: 16px;
  }

  .auth-grid {
    grid-template-columns: 1fr;
  }

  .container {
    display: block;
    padding: 14px;
  }

  .sidebar {
    min-height: auto;
    max-height: none;
    position: relative;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
    border-radius: var(--radius);
    margin-bottom: 18px;
  }

  .sidebar .brand strong,
  .sidebar .brand span,
  .nav-item span {
    display: block;
  }

  .sidebar .brand {
    width: auto;
    height: auto;
    padding: 14px 16px;
  }

  .sidebar .brand::before {
    content: none;
  }

  .nav-menu ul {
    display: flex;
  }

  .system-status {
    display: none;
  }

  .main-content {
    gap: 18px;
  }

  .chat-header,
  .input-wrapper {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .right-panel {
    min-height: auto;
    max-height: none;
    position: relative;
    top: auto;
    border-radius: var(--radius);
    margin-top: 18px;
  }

  .actions,
  .placeholder-grid,
  .task-form {
    grid-template-columns: 1fr;
  }

  .task-row {
    grid-template-columns: 1fr;
  }

  .task-sync-bar {
    grid-template-columns: 1fr;
  }

  .tasks-board-header,
  .board-toolbar {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .chat-container {
    min-height: 620px;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 10px;
  }

  .sidebar {
    gap: 12px;
    padding: 12px;
  }

  .nav-menu {
    width: 100%;
  }

  .nav-menu ul {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav-item {
    min-height: 46px;
    padding: 10px 12px;
    white-space: nowrap;
  }

  .header {
    flex-direction: column;
    align-items: stretch;
    padding: 22px;
  }

  .quick-link-grid {
    grid-template-columns: repeat(4, 56px);
    gap: 10px;
  }

  .quick-link-card,
  .quick-link-card:link,
  .quick-link-card:visited,
  .quick-link-card:hover,
  .quick-link-card:active {
    width: 56px;
    height: 56px;
    min-height: 56px;
  }

  .quick-link-icon {
    width: 40px;
    height: 40px;
  }

  .settings-grid,
  .task-comment-form {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .task-modal {
    max-height: calc(100vh - 24px);
  }
}

/* Perch Group visual alignment */
:root {
  --bg: #f7f8fb;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --glass: #f3f6f8;
  --line: #e1e7eb;
  --line-strong: #1fac78;
  --text: #000829;
  --muted: #646f7d;
  --cyan: #2195dc;
  --blue: #2195dc;
  --green: #1fac78;
  --amber: #f5b416;
  --red: #c83a4b;
  --purple: #712d81;
  --radius: 22px;
  --shadow: 0 18px 50px rgba(0, 8, 41, 0.08);
}

body {
  color: var(--text);
  background: #f7f8fb;
}

body::before {
  display: none;
}

.auth-screen {
  background:
    linear-gradient(120deg, rgba(33, 149, 220, 0.12), rgba(31, 172, 120, 0.1)),
    #ffffff;
}

.container {
  background: #f7f8fb;
}

.sidebar,
.right-panel,
.action-tile,
.placeholder-panel,
.task-panel,
.chat-container,
.auth-card,
.tasks-board-header,
.board-toolbar,
.kanban-column,
.task-modal,
.profile-card,
.user-card,
.model-selector-section,
.status,
.settings-field,
.task-comment {
  border-color: var(--line);
  background: #ffffff;
  backdrop-filter: none;
  box-shadow: var(--shadow);
}

.sidebar,
.right-panel {
  border-radius: 28px;
}

.brand,
.auth-brand {
  border: 0;
  background: #ffffff;
  box-shadow: none;
  letter-spacing: 0;
  padding: 12px 10px;
}

.brand img {
  display: block;
  width: min(190px, 100%);
  height: auto;
}

.auth-brand img {
  width: min(220px, 100%);
}

.brand span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin-top: 9px;
}

.auth-card {
  border-radius: 28px;
  padding: 34px;
}

.auth-card h1,
.header h1 {
  color: var(--text);
  letter-spacing: 0;
}

.header {
  min-height: 190px;
  border: 0;
  border-radius: 30px;
  color: #ffffff;
  background:
    linear-gradient(110deg, rgba(0, 8, 41, 0.86), rgba(0, 8, 41, 0.5)),
    url("https://www.perchgroup.co.uk/wp-content/uploads/2024/01/hero-background.jpg") center / cover;
  box-shadow: var(--shadow);
}

.header h1,
.header .subtext,
.header .eyebrow,
.header .model-info {
  color: #ffffff;
}

.header h1 {
  font-size: clamp(34px, 4vw, 56px);
}

.eyebrow,
.section-title,
.panel-header,
.system-status > b,
.auth-card label span,
.model-label,
.board-toolbar label span,
.task-form label span,
.task-comments-header,
.settings-field span {
  color: var(--green);
  letter-spacing: .08em;
}

.subtext,
.chat-header p,
.action-tile span,
.mini-card span,
.task-row span,
.kanban-card span,
.profile-card span,
.settings-profile p,
.auth-status {
  color: var(--muted);
}

.nav-item {
  color: var(--text);
  border-radius: 999px;
}

.nav-icon {
  border: 0;
  border-radius: 999px;
  color: var(--green);
  background: #eef8f4;
}

.nav-item:hover,
.nav-item.active {
  color: #ffffff;
  border-color: var(--green);
  background: var(--green);
  box-shadow: 0 12px 28px rgba(31, 172, 120, 0.24);
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  color: var(--green);
  background: #ffffff;
}

.status,
.status-grid,
.user-card {
  color: var(--muted);
}

.status {
  background: #f7faf8;
}

.status-grid b,
.status-indicator.connected,
.connection-status.ready,
.kanban-card .card-owner,
.chip,
.auth-status.success {
  color: var(--green);
}

#mySettingsButton,
.connection-status.loading {
  color: var(--blue);
}

.connection-status.error,
.auth-status.error,
.task-form-status.error,
.empty-state-error {
  color: var(--red);
}

.action-tile {
  border-radius: 24px;
  background: #ffffff;
}

.action-tile:hover,
.kanban-card:hover,
.task-row:hover,
.quick-link-card:hover,
.quick-link-card:focus-visible {
  border-color: var(--green);
  background: #f7fbf9;
  box-shadow: 0 16px 36px rgba(31, 172, 120, 0.14);
}

.tile-icon,
.quick-link-icon {
  color: var(--green) !important;
}

.model-info,
.connection-status,
.chip,
.kanban-column-header b {
  border-color: #d6ebe2;
  background: #eef8f4;
  color: var(--green);
}

.speak-button,
.chat-option,
.send-button,
.quick-link-filter-button,
.icon-button {
  border-radius: 999px;
}

.send-button,
.speak-button,
.dictation-button.listening {
  color: #ffffff;
  background: var(--green);
  box-shadow: 0 12px 28px rgba(31, 172, 120, 0.22);
}

.chat-option,
.icon-button {
  color: var(--text);
  background: #ffffff;
  border-color: var(--line);
}

.chat-option:hover,
.speak-button:hover,
.send-button:hover,
.icon-button:hover {
  border-color: var(--green);
  box-shadow: 0 12px 28px rgba(31, 172, 120, 0.18);
}

.auth-card input,
.message-input,
.model-dropdown,
.board-toolbar select,
.task-sync-bar input,
.task-form input,
.task-form textarea,
.task-form select,
.task-comment-form textarea {
  color: var(--text);
  border-color: #dce5ea;
  background: #ffffff;
}

.auth-card input:focus,
.message-input:focus,
.model-dropdown:focus,
.board-toolbar select:focus,
.task-sync-bar input:focus,
.task-form input:focus,
.task-form textarea:focus,
.task-form select:focus,
.task-comment-form textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(31, 172, 120, 0.12);
}

.message-input::placeholder {
  color: #8b95a1;
}

.chat-container {
  background: #ffffff;
}

.chat-header,
.chat-input-area,
.panel-header,
.kanban-column-header,
.modal-header {
  border-color: var(--line);
}

.message p {
  border-color: var(--line);
}

.user-message p {
  color: #ffffff;
  background: var(--blue);
  border-color: var(--blue);
}

.ai-message p {
  background: #f5faf8;
  border-color: #d8eee4;
}

.system-message p {
  color: #6c4b00;
  background: #fff8e5;
  border-color: #f5df9a;
}

.model-selector-section,
.quick-link-filter {
  background: #f7f8fb;
}

.quick-link-filter {
  border-color: var(--line);
  border-radius: 999px;
}

.quick-link-filter-button {
  color: var(--text);
  letter-spacing: 0;
  text-transform: none;
  font-size: 13px;
}

.quick-link-filter-button:hover,
.quick-link-filter-button:focus-visible,
.quick-link-filter-button.active {
  color: #ffffff;
  border-color: var(--green);
  background: var(--green);
}

.mini-card,
.quick-link-card,
.quick-link-card:link,
.quick-link-card:visited,
.quick-link-card:hover,
.quick-link-card:active,
.kanban-card,
.task-row,
.task-comment {
  border-color: var(--line);
  background: #ffffff;
}

.quick-link-icon {
  border-color: #d6ebe2;
  background: #eef8f4;
}

.quick-link-copy {
  border-color: var(--line);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.quick-link-copy b {
  color: var(--text) !important;
}

.kanban-column.drag-over {
  border-color: var(--green);
  background: #f5faf8;
}

.modal-backdrop {
  background: rgba(0, 8, 41, 0.5);
}

.task-modal {
  color: var(--text);
}

.settings-avatar {
  color: #ffffff;
  background: var(--green);
  box-shadow: none;
}

.announcement-bar {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 80;
  width: min(720px, calc(100vw - 32px));
  min-height: 52px;
  padding: 12px 14px 12px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 6px solid var(--green);
  border-radius: 999px;
  box-shadow: 0 18px 48px rgba(0, 8, 41, 0.16);
  transform: translateX(-50%);
}

.announcement-bar[hidden] {
  display: none;
}

.announcement-bar.error {
  border-left-color: var(--red);
}

.announcement-bar.info {
  border-left-color: var(--blue);
}

.announcement-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  color: var(--text);
  background: #f0f3f5;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.announcement-close:hover,
.announcement-close:focus-visible {
  color: #ffffff;
  background: var(--green);
  outline: none;
}

.container {
  grid-template-columns: 260px minmax(0, 1fr);
  padding-right: 92px;
}

.dashboard-widgets {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.dashboard-widget {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.dashboard-widget.widget-size-full {
  grid-column: span 12;
}

.dashboard-widget.widget-size-half {
  grid-column: span 6;
}

.dashboard-widget.is-dragging {
  opacity: 0.65;
}

.widget-toolbar {
  min-height: 58px;
  padding: 12px 14px 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.widget-title {
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.widget-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.widget-control {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: #ffffff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.widget-control:hover,
.widget-control:focus-visible {
  color: #ffffff;
  border-color: var(--green);
  background: var(--green);
  outline: none;
}

[data-widget-drag] {
  cursor: grab;
}

.dashboard-widget.is-minimized .widget-body {
  display: none;
}

.dashboard-widget.is-minimized .widget-toolbar {
  border-bottom: 0;
}

.dashboard-widget .actions,
.dashboard-widget .placeholder-panel,
.dashboard-widget .task-panel {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.dashboard-widget .placeholder-panel,
.dashboard-widget .task-panel {
  padding: 18px;
}

.dashboard-widget .actions {
  padding: 18px;
}

.dashboard-widget.widget-size-half .actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-widget.widget-size-half .panel-header {
  align-items: flex-start;
  flex-direction: column;
  gap: 12px;
}

.dashboard-widget.widget-size-half .quick-link-grid {
  grid-template-columns: repeat(3, 64px);
}

.dashboard-widget.widget-size-half .task-sync-bar {
  grid-template-columns: 1fr;
}

.header .model-info {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.92);
}

.agent-chat-toggle {
  position: fixed;
  right: 18px;
  top: 50%;
  z-index: 52;
  min-width: 126px;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: var(--green);
  box-shadow: 0 18px 42px rgba(31, 172, 120, 0.28);
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: center;
}

.agent-chat-toggle:hover,
.agent-chat-toggle:focus-visible {
  background: var(--text);
  outline: none;
}

.right-panel {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 70;
  width: min(430px, calc(100vw - 28px));
  height: calc(100vh - 36px);
  min-height: auto;
  max-height: none;
  padding: 0;
  border-radius: 28px;
  transform: translateX(calc(100% + 28px));
  transition: transform 220ms ease;
}

body.agent-chat-open .right-panel {
  transform: translateX(0);
}

body.agent-chat-open .agent-chat-toggle {
  opacity: 0;
  pointer-events: none;
}

.right-panel .chat-container {
  height: 100%;
  min-height: 0;
}

.chat-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.chat-close-button {
  grid-column: 2;
  grid-row: 1;
}

.chat-header .model-selector-section {
  grid-column: 1 / -1;
  width: 100%;
}

.chat-messages {
  min-height: 0;
}

.system-message {
  display: none;
}

@media (max-width: 1180px) {
  .container {
    grid-template-columns: 1fr;
    padding-right: 92px;
  }

  .sidebar .brand {
    width: auto;
    height: auto;
    padding: 10px;
  }

  .sidebar .brand::before {
    content: none;
  }

  .sidebar .brand img {
    width: 54px;
  }

  .sidebar .brand span {
    display: none;
  }
}

@media (max-width: 760px) {
  .announcement-bar {
    top: 10px;
    width: calc(100vw - 20px);
    border-radius: 18px;
  }

  .container {
    padding-right: 10px;
  }

  .dashboard-widget .actions {
    grid-template-columns: 1fr;
  }

  .ai-task-draft {
    grid-template-columns: 1fr;
  }

  .ai-task-draft-header {
    flex-direction: column;
  }

  .dashboard-widget.widget-size-half,
  .dashboard-widget.widget-size-full {
    grid-column: 1 / -1;
  }

  .widget-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .widget-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .agent-chat-toggle {
    right: 10px;
    top: auto;
    bottom: 14px;
    transform: none;
  }

  .right-panel {
    top: 10px;
    right: 10px;
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
  }
}
