:root {
  color-scheme: dark;
  --bg: #090d0c;
  --bg-2: #101412;
  --surface: rgba(19, 24, 22, 0.92);
  --surface-2: rgba(27, 34, 31, 0.92);
  --surface-3: rgba(34, 42, 38, 0.92);
  --input: #0d1110;
  --line: rgba(172, 191, 178, 0.18);
  --line-strong: rgba(129, 222, 151, 0.36);
  --text: #f4f7f1;
  --muted: #b7c2b4;
  --soft: #859384;
  --green: #62d68a;
  --green-2: #1d3a27;
  --blue: #76c6ff;
  --blue-2: #142d43;
  --purple: #b89cff;
  --purple-2: #2b2443;
  --amber: #f2c14e;
  --amber-2: #3f3218;
  --danger: #ff7468;
  --danger-2: #3e1b1b;
  --light-bg: #f4f6f8;
  --light-bg-2: #eef2f5;
  --light-card: #ffffff;
  --light-card-soft: #f8fafb;
  --light-text: #17211c;
  --light-muted: #66746c;
  --light-soft: #8a9890;
  --light-line: rgba(20, 32, 25, 0.1);
  --radius: 8px;
  --radius-app: 18px;
  --shadow: 0 22px 55px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 12px 32px rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100svh;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(98, 214, 138, 0.09), transparent 18rem),
    linear-gradient(145deg, #090d0c 0%, #101412 48%, #17160f 100%);
  color: var(--text);
  font-family: "Segoe UI Variable Text", "Aptos", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body:has(#appShell:not(.hidden)) {
  background:
    linear-gradient(180deg, #07100d 0, #07100d 5.8rem, var(--light-bg-2) 5.8rem, var(--light-bg) 100%);
  color: var(--light-text);
}

body.mobile-menu-open {
  overflow: hidden;
}

.app-update-banner {
  position: fixed;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 220;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: min(calc(100% - 1.2rem), 42rem);
  padding: 0.72rem;
  border: 1px solid rgba(98, 214, 138, 0.32);
  border-radius: 8px;
  background: rgba(13, 22, 18, 0.97);
  color: #f4f7f1;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  transform: translateX(-50%);
}

.app-update-banner.hidden {
  display: none;
}

.app-update-banner div {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
  flex: 1;
}

.app-update-banner strong {
  font-size: 0.9rem;
}

.app-update-banner span {
  color: rgba(244, 247, 241, 0.78);
  font-size: 0.78rem;
  line-height: 1.25;
}

.app-update-banner button {
  min-height: 2.25rem;
  border: 0;
  border-radius: 8px;
  padding: 0 0.82rem;
  background: #daf1e4;
  color: #123320;
  cursor: pointer;
  font-weight: 950;
}

.app-update-banner .app-update-dismiss {
  width: 2.25rem;
  padding: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #f4f7f1;
}

@media (max-width: 560px) {
  .app-update-banner {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .app-update-banner div {
    flex-basis: 100%;
  }

  .app-update-banner button {
    flex: 1 1 auto;
  }

  .app-update-banner .app-update-dismiss {
    flex: 0 0 2.25rem;
  }
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-width: 0;
  touch-action: manipulation;
}

button:focus-visible,
textarea:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(98, 214, 138, 0.74);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  letter-spacing: 0;
}

h1 {
  margin-bottom: 0.1rem;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  line-height: 1;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.05rem, 2vw, 1.34rem);
  line-height: 1.15;
}

h3 {
  margin-bottom: 0;
  font-size: 0.98rem;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  width: min(100%, 90rem);
  margin: 0 auto;
  padding: 0.85rem;
}

.mobile-bottom-nav {
  display: none;
}

.login-screen {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.login-card {
  width: min(100%, 28rem);
  display: grid;
  gap: 0.95rem;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(98, 214, 138, 0.12), transparent 42%),
    rgba(19, 24, 22, 0.94);
  box-shadow: var(--shadow);
}

.login-brand {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  text-align: center;
}

.login-brand img {
  width: 4.8rem;
  height: auto;
  border: 1px solid rgba(242, 193, 78, 0.22);
  border-radius: var(--radius);
  object-fit: contain;
}

.login-brand .header-subtitle {
  margin: 0;
}

.login-brand p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.35;
}

.login-card label,
.user-form label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.login-card input,
.user-form input,
.user-form select {
  min-height: 2.55rem;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--input);
  color: var(--text);
  padding: 0 0.75rem;
}

.login-error {
  min-height: 1.1rem;
  margin: 0;
  color: #ffd2ce;
  font-size: 0.86rem;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.85rem;
  margin-bottom: 0.8rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(13, 17, 16, 0.96), rgba(13, 17, 16, 0.82));
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.brand-area,
.header-status,
.panel-heading,
.console-head,
.composer-footer,
.voice-controls,
.section-actions,
.item-actions,
.edit-actions,
.filter-tabs,
.quick-actions,
.record-meta,
.chip-row,
.section-metrics {
  display: flex;
}

.brand-area {
  align-items: center;
  min-width: 0;
  gap: 0.75rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
  overflow: hidden;
  border: 1px solid rgba(242, 193, 78, 0.48);
  border-radius: var(--radius);
  background: #05070b;
  color: #eaffef;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 950;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.eyebrow {
  margin: 0 0 0.2rem;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.header-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 700;
}

.header-status {
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.status-pill,
.context-pill,
.panel-badge,
.badge,
.meta-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(26, 33, 30, 0.82);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1;
  min-width: 0;
  white-space: nowrap;
}

.status-pill {
  padding: 0 0.75rem;
}

.status-pill.user-pill {
  gap: 0.42rem;
}

.status-pill.voice-ready {
  border-color: rgba(98, 214, 138, 0.32);
  color: #dfffe8;
}

.status-pill.listening {
  border-color: rgba(98, 214, 138, 0.68);
  background: rgba(30, 58, 39, 0.9);
  color: #f2fff5;
  box-shadow: 0 0 18px rgba(98, 214, 138, 0.22);
}

.status-pill.warning {
  border-color: rgba(242, 193, 78, 0.46);
  background: rgba(63, 50, 24, 0.75);
  color: #ffe6a3;
}

.status-pill.error {
  border-color: rgba(255, 116, 104, 0.48);
  background: rgba(62, 27, 27, 0.72);
  color: #ffd2ce;
}

.settings-button,
.icon-button,
.send-button,
.text-button,
.item-actions button,
.edit-actions button,
.quick-actions button,
.filter-tabs button,
.search-form button,
.user-form button,
.admin-actions button,
.share-actions button {
  min-height: 2.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 900;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.settings-button,
.icon-button {
  min-width: 2.75rem;
  padding: 0 0.78rem;
  background: var(--surface-2);
  color: var(--text);
}

.settings-button {
  min-width: 0;
  border-color: rgba(129, 215, 158, 0.22);
  background: linear-gradient(180deg, rgba(27, 48, 38, 0.92), rgba(16, 29, 24, 0.92));
  color: #eafff0;
}

.settings-button:hover,
.icon-button:hover,
.text-button:hover,
.item-actions button:hover,
.edit-actions button:hover,
.quick-actions button:hover,
.filter-tabs button:hover,
.search-form button:hover,
.user-form button:hover,
.admin-actions button:hover,
.share-actions button:hover {
  border-color: var(--line-strong);
  color: #ecfff1;
}

.mobile-menu-button {
  display: none;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(206, 235, 216, 0.14);
  border-radius: 50%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035)),
    rgba(8, 16, 13, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 26px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.mobile-menu-button span {
  display: block;
  width: 1rem;
  height: 2px;
  margin: 0.12rem 0;
  border-radius: 999px;
  background: #eefcf2;
}

.mobile-header-menu {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: max(0.8rem, env(safe-area-inset-top)) 0.8rem max(1rem, env(safe-area-inset-bottom));
}

.mobile-menu-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(1, 5, 4, 0.62);
  backdrop-filter: blur(8px);
}

.mobile-menu-sheet {
  position: relative;
  z-index: 1;
  width: min(100%, 27rem);
  margin-top: 0.65rem;
  padding: 1rem;
  border: 1px solid rgba(172, 224, 190, 0.3);
  border-radius: 28px;
  background:
    radial-gradient(circle at 14% 0%, rgba(98, 214, 138, 0.14), transparent 14rem),
    linear-gradient(145deg, rgba(12, 23, 19, 0.98), rgba(19, 30, 26, 0.96));
  color: #f4fff6;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
}

.mobile-menu-top,
.mobile-menu-brand,
.mobile-menu-actions,
.mobile-menu-item {
  display: flex;
  align-items: center;
}

.mobile-menu-top {
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.mobile-menu-brand {
  gap: 0.75rem;
  min-width: 0;
}

.mobile-menu-brand img {
  width: 3.3rem;
  height: 3.3rem;
  border: 1px solid rgba(242, 193, 78, 0.4);
  border-radius: 16px;
  background: #05070b;
  object-fit: cover;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.mobile-menu-brand h2 {
  margin: 0 0 0.12rem;
  color: #f7fff9;
  font-size: 1.55rem;
  line-height: 1;
}

.mobile-menu-brand p {
  margin: 0;
  color: rgba(223, 242, 229, 0.78);
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.1;
}

.mobile-menu-actions {
  gap: 0.55rem;
}

.mobile-admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 2.55rem;
  padding: 0 0.72rem;
  border: 1px solid rgba(206, 235, 216, 0.14);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.06);
  color: #f4fff6;
  font-size: 0.82rem;
  font-weight: 900;
}

.mobile-admin-badge::before,
.status-pill.user-pill::before {
  content: "";
  width: 0.46rem;
  height: 0.46rem;
  border-radius: 50%;
  background: #62d68a;
  box-shadow: 0 0 12px rgba(98, 214, 138, 0.6);
}

.mobile-menu-close {
  width: 2.55rem;
  height: 2.55rem;
  border: 1px solid rgba(206, 235, 216, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  color: #f5fff7;
  cursor: pointer;
  font-weight: 950;
}

.mobile-menu-list {
  overflow: hidden;
  border: 1px solid rgba(206, 235, 216, 0.09);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.055);
}

.mobile-menu-item {
  width: 100%;
  gap: 0.88rem;
  min-height: 4.38rem;
  padding: 0.8rem 0.95rem;
  border: 0;
  border-bottom: 1px solid rgba(206, 235, 216, 0.1);
  background: transparent;
  color: #f4fff6;
  text-align: left;
  cursor: pointer;
}

.mobile-menu-item:last-child {
  border-bottom: 0;
}

.mobile-menu-item:hover,
.mobile-menu-item:focus-visible {
  background: rgba(98, 214, 138, 0.08);
}

.mobile-menu-item > span:last-child {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.mobile-menu-item strong {
  color: #f7fff9;
  font-size: 0.98rem;
  line-height: 1.15;
}

.mobile-menu-item small {
  color: rgba(223, 242, 229, 0.72);
  font-size: 0.78rem;
  font-weight: 650;
}

.mobile-menu-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.09);
  color: #f4fff6;
  font-size: 0.85rem;
  font-weight: 950;
}

.mobile-menu-item.is-danger strong,
.mobile-menu-item.is-danger .mobile-menu-icon {
  color: #ff9b93;
}

.overview-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

.metric-card,
.console-card,
.side-panel,
.section-detail,
.panel-block,
.detail-card,
.edit-panel,
.message-bubble {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.metric-card {
  min-width: 0;
  padding: 0.62rem 0.72rem;
  background: rgba(18, 23, 21, 0.88);
  overflow: hidden;
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.metric-card strong {
  display: block;
  margin: 0.12rem 0 0.02rem;
  font-size: clamp(1.2rem, 2.4vw, 1.58rem);
  line-height: 1;
}

.tone-green {
  border-color: rgba(98, 214, 138, 0.34);
  background: linear-gradient(135deg, rgba(98, 214, 138, 0.16), rgba(18, 23, 21, 0.9) 48%);
}

.tone-blue {
  border-color: rgba(118, 198, 255, 0.34);
  background: linear-gradient(135deg, rgba(118, 198, 255, 0.14), rgba(18, 23, 21, 0.9) 50%);
}

.tone-purple {
  border-color: rgba(184, 156, 255, 0.34);
  background: linear-gradient(135deg, rgba(184, 156, 255, 0.14), rgba(18, 23, 21, 0.9) 50%);
}

.tone-amber {
  border-color: rgba(242, 193, 78, 0.36);
  background: linear-gradient(135deg, rgba(242, 193, 78, 0.14), rgba(18, 23, 21, 0.9) 50%);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 24.5rem);
  gap: 0.85rem;
  align-items: start;
  padding: 0.1rem;
  border-radius: calc(var(--radius-app) + 8px);
}

.main-column {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}

.console-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: calc(100svh - 11.2rem);
  background:
    radial-gradient(circle at top left, rgba(98, 214, 138, 0.12), transparent 18rem),
    linear-gradient(145deg, rgba(19, 24, 22, 0.96), rgba(12, 15, 14, 0.98));
  overflow: hidden;
}

.console-head {
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.context-pill {
  max-width: 16rem;
  padding: 0 0.7rem;
  overflow: hidden;
  color: #dfffe8;
  text-overflow: ellipsis;
}

.console-side {
  display: grid;
  justify-items: end;
  gap: 0.45rem;
  min-width: 0;
}

.console-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
}

.context-home-button {
  min-height: 2.15rem;
  padding: 0 0.78rem;
  border: 1px solid rgba(98, 214, 138, 0.55);
  border-radius: var(--radius);
  background: rgba(98, 214, 138, 0.14);
  color: #eaffef;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 950;
}

.context-home-button:hover {
  border-color: rgba(98, 214, 138, 0.85);
  background: rgba(98, 214, 138, 0.22);
}

.console-tools button,
.chat-history-head button {
  min-height: 2rem;
  padding: 0 0.58rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(31, 39, 35, 0.76);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 900;
}

.console-tools button:hover,
.chat-history-head button:hover {
  border-color: var(--line-strong);
  color: #ecfff1;
}

.quick-actions {
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.62rem 1rem 0;
}

.quick-actions button {
  min-height: 2.2rem;
  padding: 0 0.65rem;
  background: rgba(31, 39, 35, 0.76);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.15;
  white-space: normal;
}

.quick-actions button:first-child {
  border-color: rgba(98, 214, 138, 0.34);
  color: #dfffe8;
}

.conversation {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.72rem;
  min-height: 12rem;
  max-height: 28rem;
  overflow: auto;
  padding: 1rem;
  scroll-behavior: smooth;
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  max-width: min(48rem, 92%);
  min-width: 0;
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message.assistant {
  align-self: flex-start;
}

.message-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(26, 33, 30, 0.92);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
}

.message.user .message-avatar {
  border-color: rgba(118, 198, 255, 0.4);
  background: rgba(20, 45, 67, 0.86);
  color: #d9f1ff;
}

.message.assistant .message-avatar {
  border-color: rgba(98, 214, 138, 0.34);
  background: rgba(29, 58, 39, 0.78);
  color: #dfffe8;
}

.message-bubble {
  min-width: 0;
  padding: 0.82rem 0.9rem;
  background: rgba(26, 33, 30, 0.92);
  overflow-wrap: anywhere;
}

.message.user .message-bubble {
  border-color: rgba(118, 198, 255, 0.38);
  background: linear-gradient(135deg, rgba(118, 198, 255, 0.16), rgba(17, 31, 42, 0.92));
}

.message.error .message-bubble {
  border-color: rgba(255, 116, 104, 0.46);
  background: rgba(62, 27, 27, 0.74);
  color: #ffd2ce;
}

.message p {
  margin: 0;
  color: var(--text);
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.meta-line {
  display: block;
  margin-top: 0.5rem;
  color: var(--soft);
  font-size: 0.77rem;
  font-weight: 750;
}

.chat-history-panel {
  margin: 0 1rem 0.85rem;
  padding: 0.72rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(13, 17, 16, 0.62);
}

.chat-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.55rem;
}

.chat-history-head strong {
  font-size: 0.86rem;
}

.chat-history-list {
  display: grid;
  gap: 0.48rem;
  max-height: 16rem;
  overflow: auto;
}

.chat-history-row {
  display: grid;
  gap: 0.24rem;
  padding: 0.58rem;
  border: 1px solid rgba(172, 191, 178, 0.12);
  border-radius: var(--radius);
  background: rgba(27, 34, 31, 0.72);
}

.chat-history-row strong,
.chat-history-row span {
  overflow-wrap: anywhere;
}

.chat-history-row span,
.chat-history-row small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.composer {
  padding: 0.9rem;
  border-top: 1px solid var(--line);
  background: rgba(10, 13, 12, 0.68);
}

.composer textarea,
.search-form input,
.edit-panel input,
.edit-panel select,
.edit-panel textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--input);
  color: var(--text);
  outline: none;
}

.composer textarea {
  display: block;
  min-height: 6.8rem;
  max-height: 15rem;
  resize: none;
  padding: 0.85rem 0.9rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.composer textarea:focus,
.search-form input:focus,
.edit-panel input:focus,
.edit-panel select:focus,
.edit-panel textarea:focus {
  border-color: rgba(98, 214, 138, 0.66);
  box-shadow: 0 0 0 3px rgba(98, 214, 138, 0.11);
}

.composer-footer {
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-top: 0.65rem;
}

.voice-controls {
  flex: 0 0 auto;
  gap: 0.45rem;
}

.mic-button {
  border-color: rgba(98, 214, 138, 0.38);
  background: rgba(29, 58, 39, 0.92);
  color: #dfffe8;
}

.mic-button.is-recording {
  border-color: rgba(98, 214, 138, 0.86);
  box-shadow: 0 0 22px rgba(98, 214, 138, 0.28);
}

.stop-button {
  border-color: rgba(255, 116, 104, 0.34);
  background: rgba(62, 27, 27, 0.86);
  color: #ffd2ce;
}

.send-button {
  flex: 0 0 auto;
  min-width: 7.2rem;
  padding: 0 1rem;
  border-color: rgba(98, 214, 138, 0.62);
  background: var(--green);
  color: #071109;
  box-shadow: 0 12px 30px rgba(98, 214, 138, 0.17);
}

.send-button:hover {
  transform: translateY(-1px);
  background: #78e79c;
}

.composer-hint {
  min-width: 0;
  color: var(--soft);
  font-size: 0.78rem;
  font-weight: 760;
  line-height: 1.35;
}

.side-panel {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
  overflow: visible;
  background: transparent;
  box-shadow: none;
  border: 0;
}

.panel-block,
.section-detail {
  background: rgba(19, 24, 22, 0.88);
  min-width: 0;
  overflow: hidden;
}

.panel-block {
  padding: 0.82rem;
}

.today-panel {
  border-color: rgba(98, 214, 138, 0.36);
  background:
    linear-gradient(135deg, rgba(98, 214, 138, 0.16), rgba(19, 24, 22, 0.9) 50%);
  box-shadow: 0 16px 38px rgba(98, 214, 138, 0.08), var(--shadow-soft);
}

.search-panel {
  border-color: rgba(118, 198, 255, 0.28);
  background:
    linear-gradient(135deg, rgba(118, 198, 255, 0.08), rgba(19, 24, 22, 0.9) 48%);
}

.utility-panel {
  padding: 0;
}

.utility-panel summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.82rem;
  cursor: pointer;
  list-style: none;
}

.utility-panel summary::-webkit-details-marker {
  display: none;
}

.utility-panel summary span {
  color: var(--soft);
  font-size: 0.74rem;
  font-weight: 900;
}

.utility-panel[open] summary {
  border-bottom: 1px solid var(--line);
}

.utility-panel[open] summary span {
  color: var(--green);
}

.utility-panel > :not(summary) {
  margin-left: 0.82rem;
  margin-right: 0.82rem;
}

.utility-panel > :last-child {
  margin-bottom: 0.82rem;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.search-input-wrap {
  position: relative;
  min-width: 0;
}

.search-form input {
  min-height: 2.55rem;
  width: 100%;
  padding-right: 2.35rem;
}

.search-form button {
  padding: 0 0.82rem;
  background: linear-gradient(135deg, #62d68a, #31a2ff);
  color: #04100a;
}

.search-form .search-clear-button {
  position: absolute;
  top: 50%;
  right: 0.38rem;
  display: none;
  width: 1.8rem;
  height: 1.8rem;
  min-height: 0;
  padding: 0;
  transform: translateY(-50%);
  border-radius: 999px;
  border-color: rgba(20, 32, 25, 0.12);
  background: rgba(255, 255, 255, 0.78);
  color: #526159;
  font-size: 0.76rem;
  line-height: 1;
}

.search-form .search-clear-button.is-visible {
  display: inline-grid;
  place-items: center;
}

.panel-hint {
  margin: 0.55rem 0.82rem 0;
  color: var(--soft);
  font-size: 0.76rem;
  line-height: 1.35;
}

.search-active-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.62rem 0.72rem;
  border: 1px solid rgba(52, 211, 153, 0.18);
  border-radius: 14px;
  background: rgba(236, 253, 245, 0.78);
  color: #24483a;
  font-size: 0.8rem;
}

.search-active-banner button {
  border: 1px solid rgba(20, 32, 25, 0.12);
  border-radius: 999px;
  background: #ffffff;
  color: #17643d;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.38rem 0.62rem;
}

.search-result {
  display: grid;
  gap: 0.44rem;
  cursor: pointer;
}

.search-result:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.search-result.is-history {
  opacity: 0.78;
}

.result-topline {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
}

.result-topline em,
.audit-row em {
  color: var(--soft);
  font-size: 0.73rem;
  font-style: normal;
  font-weight: 850;
}

.result-snippet {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.panel-heading {
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.panel-badge {
  min-width: 2rem;
  padding: 0 0.5rem;
  color: #dfffe8;
}

.action-list,
.mini-list,
.section-grid,
.detail-list,
.search-results,
.audit-list,
.user-list,
.share-list {
  display: grid;
  gap: 0.62rem;
  margin-top: 0.75rem;
}

.mini-item,
.action-item,
.section-tile,
.search-result,
.audit-row {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(27, 34, 31, 0.84);
  color: inherit;
  text-align: left;
}

.mini-item,
.action-item,
.search-result,
.audit-row {
  padding: 0.72rem;
}

.mini-item {
  display: grid;
  gap: 0.42rem;
  border-left: 3px solid rgba(118, 198, 255, 0.36);
}

.mini-reminder {
  border-left-color: rgba(242, 193, 78, 0.54);
  background: linear-gradient(135deg, rgba(242, 193, 78, 0.09), rgba(27, 34, 31, 0.86) 52%);
}

.mini-task {
  border-left-color: rgba(118, 198, 255, 0.46);
  background: linear-gradient(135deg, rgba(118, 198, 255, 0.07), rgba(27, 34, 31, 0.86) 54%);
}

.mini-giro {
  border-left-color: rgba(184, 156, 255, 0.5);
  background: linear-gradient(135deg, rgba(184, 156, 255, 0.09), rgba(27, 34, 31, 0.86) 54%);
}

.mini-item strong,
.action-item strong,
.section-tile strong,
.search-result strong,
.audit-row strong {
  display: block;
  color: var(--text);
  font-size: 0.91rem;
  line-height: 1.25;
}

.section-kind-badge {
  display: inline-flex;
  max-width: 100%;
  min-height: 1.45rem;
  margin-left: 0.25rem;
  padding: 0.08rem 0.42rem;
  border: 1px solid rgba(172, 191, 178, 0.14);
  border-radius: var(--radius);
  background: rgba(13, 17, 16, 0.54);
  color: var(--soft);
  font-size: 0.7rem;
  font-weight: 900;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.mini-item span,
.mini-item small,
.action-item span,
.section-tile span,
.search-result span,
.audit-row span,
.audit-row em {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.mini-when {
  color: #eaf7ec;
  font-size: 0.82rem;
  font-weight: 850;
}

.mini-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.mini-item-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.38rem;
}

.mini-link {
  min-height: 1.9rem;
  padding: 0 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(13, 17, 16, 0.7);
  color: #dfffe8;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 900;
}

.mini-link.success {
  border-color: rgba(36, 143, 91, 0.22);
  background: #daf1e4;
  color: #15542f;
}

.mini-link.danger {
  border-color: rgba(210, 87, 72, 0.2);
  background: #fff0ee;
  color: #9a372f;
}

.today-panel .mini-list {
  gap: 0.45rem;
}

.today-compact-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.62rem;
  min-height: 4.1rem;
  padding: 0.72rem 0.72rem 0.72rem 0.86rem;
  border: 1px solid rgba(24, 54, 42, 0.1);
  border-left: 4px solid rgba(37, 143, 91, 0.48);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(18, 34, 28, 0.08);
  color: #101816;
}

.today-compact-row.is-sortable {
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding-left: 0.52rem;
}

.today-compact-row.is-reordering {
  z-index: 6;
  border-color: rgba(37, 143, 91, 0.38);
  background: #f7fffb;
  box-shadow: 0 18px 42px rgba(18, 34, 28, 0.18);
  transform: scale(1.01);
}

body.today-reordering,
body.today-reordering * {
  user-select: none;
}

.today-drag-handle {
  display: inline-grid;
  place-items: center;
  width: 2.3rem;
  height: 2.75rem;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: rgba(23, 50, 38, 0.58);
  cursor: grab;
  font-size: 1.32rem;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.today-drag-handle:active {
  cursor: grabbing;
}

.today-drag-handle:focus-visible {
  outline: 2px solid rgba(37, 143, 91, 0.45);
  outline-offset: 2px;
}

.today-order-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.2rem 0.15rem 0.35rem;
  color: #577067;
  font-size: 0.72rem;
  font-weight: 850;
}

.today-order-tools button {
  min-height: 2rem;
  padding: 0 0.72rem;
  border: 1px solid rgba(23, 47, 37, 0.12);
  border-radius: 999px;
  background: #eef4f1;
  color: #173226;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 900;
}

.today-compact-row.is-overdue {
  border-left-color: rgba(205, 97, 52, 0.65);
}

.today-compact-main {
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}

.today-compact-title {
  color: #0f1715;
  font-size: clamp(0.88rem, 2.7vw, 1rem);
  font-weight: 950;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.today-compact-meta {
  color: #60706a;
  font-size: 0.76rem;
  font-weight: 760;
  line-height: 1.25;
}

.today-action-wrap {
  position: relative;
  display: flex;
  justify-content: flex-end;
}

.today-menu-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(23, 47, 37, 0.12);
  border-radius: 999px;
  background: #eef4f1;
  color: #173226;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 950;
  letter-spacing: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.today-action-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 95;
  width: min(15rem, calc(100vw - 2.2rem));
  max-height: min(20rem, calc(100vh - 8rem));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.42rem;
  border: 1px solid rgba(21, 47, 37, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 48px rgba(7, 18, 13, 0.22);
}

.today-action-menu-floating {
  position: fixed;
  top: auto;
  right: auto;
  z-index: 320;
  overscroll-behavior: contain;
}

.today-action-item {
  width: 100%;
  min-height: 2.4rem;
  padding: 0 0.72rem;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #14241d;
  cursor: pointer;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 900;
}

.today-action-item:hover,
.today-action-item:focus-visible {
  background: #edf6f1;
  outline: none;
}

.today-action-item.danger {
  color: #a33c34;
}

.today-action-item.danger:hover,
.today-action-item.danger:focus-visible {
  background: #fff0ee;
}

.today-action-sheet {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: grid;
  place-items: end center;
  padding: 0.75rem 0.75rem calc(0.75rem + env(safe-area-inset-bottom));
}

.today-action-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(3, 10, 7, 0.58);
  cursor: pointer;
}

.today-action-sheet-card {
  position: relative;
  z-index: 1;
  width: min(28rem, 100%);
  max-height: min(78dvh, 34rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.7rem;
  border: 1px solid rgba(190, 225, 206, 0.22);
  border-radius: 26px;
  background:
    radial-gradient(circle at 12% 0%, rgba(86, 204, 143, 0.12), transparent 36%),
    linear-gradient(145deg, rgba(18, 34, 27, 0.98), rgba(8, 16, 13, 0.98));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.44);
  color: #edf8f2;
}

.today-action-sheet-handle {
  width: 3.2rem;
  height: 0.28rem;
  margin: 0.1rem auto 0.78rem;
  border-radius: 999px;
  background: rgba(225, 241, 234, 0.28);
}

.today-action-sheet-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0 0.1rem 0.7rem;
  border-bottom: 1px solid rgba(225, 241, 234, 0.12);
}

.today-action-sheet-head h2 {
  margin: 0;
  color: #f5fff9;
  font-size: 1.02rem;
  letter-spacing: 0;
}

.today-action-sheet-head p {
  margin: 0.25rem 0 0;
  color: rgba(225, 241, 234, 0.72);
  font-size: 0.82rem;
  font-weight: 780;
  line-height: 1.35;
}

.today-action-sheet-close {
  display: inline-grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid rgba(225, 241, 234, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f7fff9;
  cursor: pointer;
  font-size: 1.45rem;
  line-height: 1;
}

.today-action-sheet-actions {
  display: grid;
  gap: 0.38rem;
  padding-top: 0.7rem;
}

.today-action-sheet .today-action-item {
  min-height: 3rem;
  padding: 0 0.95rem;
  border-radius: 16px;
  color: #f4fff8;
  background: rgba(255, 255, 255, 0.07);
  font-size: 0.93rem;
}

.today-action-sheet .today-action-item:hover,
.today-action-sheet .today-action-item:focus-visible {
  background: rgba(98, 214, 138, 0.18);
}

.today-action-sheet .today-action-item.danger {
  color: #ffb5ad;
}

.today-action-sheet .today-action-item.danger:hover,
.today-action-sheet .today-action-item.danger:focus-visible {
  background: rgba(191, 65, 53, 0.18);
}

body.has-open-sheet {
  overflow: hidden;
}

.section-compact-group {
  display: grid;
  gap: 0.55rem;
}

.section-compact-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.1rem 0.08rem;
}

.section-compact-head h3 {
  margin: 0;
  color: var(--light-text);
  font-size: clamp(1rem, 2.6vw, 1.18rem);
  letter-spacing: 0;
}

.section-compact-head span {
  color: var(--light-muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.section-compact-list {
  display: grid;
  gap: 0.5rem;
}

.section-compact-row {
  min-height: 3.85rem;
}

.section-secondary {
  padding: 0.78rem;
}

.section-secondary > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--light-text);
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}

.section-secondary > summary::-webkit-details-marker {
  display: none;
}

.section-secondary .chip-row {
  margin-top: 0.72rem;
}

.assign-panel {
  position: fixed;
  inset: 0;
  z-index: 125;
  display: grid;
  place-items: end center;
  padding: clamp(0.7rem, 3vw, 1.2rem);
}

.assign-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(2, 8, 6, 0.58);
  cursor: pointer;
}

.assign-sheet {
  position: relative;
  z-index: 1;
  width: min(34rem, 100%);
  max-height: min(88vh, 44rem);
  overflow: auto;
  padding: 1rem;
  border: 1px solid rgba(206, 235, 216, 0.18);
  border-radius: 24px;
  background: linear-gradient(180deg, #0a1712, #10221a 9rem, #f7faf8 9.05rem, #fff 100%);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.44);
}

.assign-head {
  display: flex;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.2rem 0 1.15rem;
  color: #f5fff8;
}

.assign-head h2 {
  margin: 0.1rem 0;
  color: #fff;
  font-size: 1.35rem;
}

.assign-head p {
  margin: 0;
  color: rgba(238, 255, 244, 0.72);
}

body.item-detail-open {
  overflow: hidden;
}

.item-detail-sheet {
  width: min(46rem, 100%);
}

.item-detail-content {
  display: grid;
  gap: 0.78rem;
}

.item-detail-summary {
  display: grid;
  gap: 0.75rem;
  padding: 0.88rem;
  border: 1px solid rgba(16, 34, 26, 0.12);
  border-radius: 16px;
  background: #fff;
  color: var(--light-text);
}

.item-detail-summary strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 1.06rem;
  line-height: 1.25;
}

.item-detail-summary span {
  color: var(--light-soft);
  font-size: 0.86rem;
}

.item-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.58rem;
}

.item-detail-field,
.item-detail-block {
  border: 1px solid rgba(16, 34, 26, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--light-text);
}

.item-detail-field {
  display: grid;
  gap: 0.18rem;
  padding: 0.68rem;
}

.item-detail-field span,
.item-detail-event span,
.item-detail-related span {
  color: var(--light-soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.item-detail-field strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.item-detail-block {
  display: grid;
  gap: 0.48rem;
  padding: 0.78rem;
}

.item-detail-block h3 {
  margin: 0;
  font-size: 0.86rem;
}

.item-detail-block p {
  margin: 0;
  color: var(--light-soft);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.item-detail-events,
.item-detail-related {
  display: grid;
  gap: 0.42rem;
}

.item-detail-event {
  display: grid;
  gap: 0.12rem;
  padding-left: 0.55rem;
  border-left: 3px solid rgba(45, 121, 74, 0.28);
}

.item-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  padding-top: 0.12rem;
}

@media (max-width: 700px) {
  .item-detail-panel {
    place-items: end stretch;
    padding: 0;
  }

  .item-detail-sheet {
    width: 100%;
    max-height: 88vh;
    border-radius: 22px 22px 0 0;
    padding: 0.9rem;
  }

  .item-detail-grid {
    grid-template-columns: 1fr;
  }

  .item-detail-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .item-detail-actions button {
    min-height: 2.65rem;
  }
}

.panel-heading-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.panel-heading-action {
  min-height: 2.15rem;
  padding: 0 0.72rem;
  font-size: 0.78rem;
  white-space: nowrap;
}

.assign-current {
  margin: 0 0 0.72rem;
  color: #244239;
  font-weight: 900;
}

.collaborator-list,
.collaborator-summary-list {
  display: grid;
  gap: 0.48rem;
}

.collaborator-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  min-height: 2.8rem;
  padding: 0 0.75rem;
  border: 1px solid rgba(20, 51, 38, 0.12);
  border-radius: 14px;
  background: #f5f8f6;
  color: #13261f;
  cursor: pointer;
  text-align: left;
}

.collaborator-option strong {
  font-size: 0.92rem;
  font-weight: 950;
}

.collaborator-option span {
  color: #64756f;
  font-size: 0.72rem;
  font-weight: 850;
}

.collaborator-option:disabled {
  cursor: default;
  opacity: 0.66;
}

.collaborator-create-form {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(22, 47, 37, 0.12);
}

.section-create-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.65rem;
}

.section-create-form label {
  display: grid;
  gap: 0.32rem;
  color: #274139;
  font-size: 0.8rem;
  font-weight: 900;
}

.section-create-form input,
.section-create-form textarea {
  width: 100%;
  border: 1px solid rgba(20, 51, 38, 0.16);
  border-radius: 14px;
  padding: 0.72rem 0.75rem;
  background: #fff;
  color: #111916;
  font-size: 16px;
  resize: vertical;
}

.collaborator-create-form label {
  display: grid;
  gap: 0.3rem;
  color: #274139;
  font-size: 0.8rem;
  font-weight: 900;
}

.collaborator-create-form input {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid rgba(20, 51, 38, 0.16);
  border-radius: 14px;
  padding: 0 0.75rem;
  background: #fff;
  color: #111916;
  font-size: 16px;
}

.collaborator-create-form button {
  min-height: 2.8rem;
  border: 0;
  border-radius: 14px;
  background: #2dbe72;
  color: #06100b;
  cursor: pointer;
  font-weight: 950;
}

.collaborator-chip {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.58rem 0.72rem;
  border: 1px solid rgba(20, 51, 38, 0.12);
  border-radius: 14px;
  background: #f7faf8;
  color: #12231d;
  font-weight: 950;
}

.collaborator-chip small {
  color: #687871;
  font-size: 0.7rem;
}

.settings-panel {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: clamp(0.7rem, 3vw, 1.4rem);
}

.settings-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(2, 8, 6, 0.62);
  cursor: pointer;
}

.settings-sheet {
  position: relative;
  z-index: 1;
  width: min(42rem, 100%);
  max-height: min(88vh, 48rem);
  overflow: auto;
  border: 1px solid rgba(206, 235, 216, 0.18);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(12, 24, 18, 0.98), rgba(8, 16, 13, 0.98) 11rem, #eef3ef 11.05rem, #f7faf8 100%);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.42);
}

.settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.15rem 0.9rem;
  color: #f5fff8;
}

.settings-head h2,
.settings-head p {
  margin: 0;
}

.settings-head p:last-child {
  margin-top: 0.22rem;
  color: rgba(224, 241, 229, 0.76);
}

.settings-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  padding: 0 1.15rem 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-padding-inline: 1.15rem;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.settings-tabs button {
  flex: 0 0 auto;
  min-height: 2.3rem;
  border: 1px solid rgba(206, 235, 216, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(238, 255, 242, 0.82);
  cursor: pointer;
  font-weight: 900;
  white-space: nowrap;
  padding: 0 0.85rem;
}

.settings-tabs::-webkit-scrollbar {
  height: 0.35rem;
}

.settings-tabs::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(215, 240, 224, 0.28);
}

.settings-tabs button.is-active {
  border-color: rgba(129, 215, 158, 0.3);
  background: #daf1e4;
  color: #15462c;
}

.settings-body {
  padding: 0 1.15rem 1.15rem;
}

.settings-pane {
  display: none;
}

.settings-pane.is-active {
  display: grid;
  gap: 0.82rem;
}

.account-summary-card,
.settings-pane .admin-panel,
.settings-pane .maintenance-card {
  border: 1px solid rgba(20, 32, 25, 0.1);
  border-radius: 18px;
  background: #ffffff;
  color: var(--light-text);
  box-shadow: 0 16px 34px rgba(38, 54, 46, 0.12);
  padding: 0.95rem;
}

.account-summary-card h3,
.account-summary-card p {
  margin: 0;
}

.account-summary-card p:last-child {
  margin-top: 0.35rem;
  color: var(--light-muted);
}

.app-version-card {
  box-shadow: none;
}

.app-version-card h3 {
  font-size: 1rem;
  line-height: 1.25;
}

.app-version-card span {
  overflow-wrap: anywhere;
}

.settings-pane .admin-panel summary {
  color: var(--light-text);
}

.settings-pane .user-form input,
.settings-pane .user-form select {
  border-color: rgba(20, 32, 25, 0.12);
  background: #f8faf8;
  color: var(--light-text);
}

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

.section-tile {
  display: grid;
  gap: 0.45rem;
  padding: 0.78rem;
  border-left-width: 4px;
  cursor: pointer;
}

.section-owner-line {
  color: var(--soft);
  font-size: 0.74rem;
  font-weight: 800;
}

.section-tile-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.34rem;
}

.section-tile-counts span {
  min-height: 1.55rem;
  padding: 0.2rem 0.42rem;
  border: 1px solid rgba(172, 191, 178, 0.14);
  border-radius: var(--radius);
  background: rgba(13, 17, 16, 0.44);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.section-tile:hover,
.section-tile.selected {
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.2);
}

.section-tile em {
  color: var(--green);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 900;
}

.filter-tabs {
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.72rem;
}

.filter-tabs button {
  min-height: 2rem;
  padding: 0 0.58rem;
  background: rgba(13, 17, 16, 0.72);
  color: var(--soft);
  font-size: 0.74rem;
}

.filter-tabs button.is-active {
  border-color: rgba(98, 214, 138, 0.56);
  background: rgba(29, 58, 39, 0.78);
  color: #dfffe8;
}

.see-all-button {
  width: 100%;
  min-height: 2rem;
  border: 1px solid rgba(172, 191, 178, 0.16);
  border-radius: var(--radius);
  background: rgba(13, 17, 16, 0.58);
  color: #dfffe8;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 900;
}

.see-all-button:hover {
  border-color: var(--line-strong);
}

.action-report.ok {
  border-left: 4px solid var(--green);
}

.action-report.warn {
  border-left: 4px solid var(--amber);
}

.empty {
  margin: 0;
  color: var(--soft);
  font-size: 0.86rem;
  line-height: 1.4;
}

.empty-state {
  display: grid;
  gap: 0.55rem;
  padding: 0.9rem;
  border: 1px dashed rgba(172, 191, 178, 0.22);
  border-radius: var(--radius);
  background: rgba(13, 17, 16, 0.5);
}

.empty-state strong {
  color: var(--text);
}

.empty-state button {
  justify-self: start;
}

.section-detail {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
}

.section-detail-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: start;
}

.section-detail-header p {
  margin: 0.32rem 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.section-actions,
.item-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.text-button,
.item-actions button,
.edit-actions button {
  padding: 0 0.75rem;
  background: rgba(27, 34, 31, 0.9);
  color: var(--text);
}

.text-button.muted,
.text-button.danger,
.item-actions button.danger,
.item-actions button[data-delete-item],
.section-actions [data-action="delete-section"] {
  color: #ffd2ce;
}

.text-button.primary,
.edit-actions button[type="submit"] {
  border-color: rgba(98, 214, 138, 0.5);
  background: rgba(29, 58, 39, 0.86);
  color: #dfffe8;
}

.section-metrics,
.chip-row,
.record-meta {
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.access-block {
  display: grid;
  gap: 0.65rem;
}

.access-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.section-metrics-compact {
  flex-wrap: nowrap;
  gap: 0.32rem;
  overflow-x: auto;
  padding-bottom: 0.05rem;
  scrollbar-width: none;
}

.section-metrics-compact::-webkit-scrollbar {
  display: none;
}

.section-metrics-compact span {
  flex: 0 0 auto;
  min-height: 1.38rem;
  padding: 0.16rem 0.48rem;
  border-radius: 999px;
  font-size: 0.72rem;
  white-space: nowrap;
}

.section-management-block {
  border: 1px solid rgba(20, 32, 25, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--light-text);
  padding: 0.72rem;
}

.section-management-block > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  list-style: none;
}

.section-management-block > summary::-webkit-details-marker {
  display: none;
}

.section-management-block > summary span:first-child {
  display: grid;
  gap: 0.12rem;
}

.section-management-block > summary strong {
  color: var(--light-text);
}

.section-management-block > summary small {
  color: var(--light-muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.section-management-content {
  display: grid;
  gap: 0.72rem;
  margin-top: 0.72rem;
}

.management-card {
  display: grid;
  gap: 0.24rem;
  padding: 0.7rem;
  border: 1px solid rgba(20, 32, 25, 0.08);
  border-radius: 14px;
  background: #f8faf8;
}

.management-card p {
  margin: 0;
  color: var(--light-muted);
}

.management-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.user-form {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.82rem;
}

.user-form button {
  justify-self: start;
  background: rgba(29, 58, 39, 0.86);
  color: #dfffe8;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  padding: 0.72rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(27, 34, 31, 0.84);
}

.user-main,
.share-summary {
  min-width: 0;
}

.user-row strong,
.user-row span,
.share-row strong,
.share-row span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.user-row span,
.share-row span {
  color: var(--muted);
  font-size: 0.78rem;
}

.user-status {
  justify-self: end;
  align-self: start;
}

.user-extra {
  grid-column: 1 / -1;
  min-width: 0;
}

.inline-admin-form,
.share-row {
  display: grid;
  gap: 0.62rem;
  padding: 0.68rem;
  border: 1px solid rgba(172, 191, 178, 0.12);
  border-radius: var(--radius);
  background: rgba(13, 17, 16, 0.36);
}

.inline-admin-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inline-admin-form label {
  display: grid;
  gap: 0.32rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.inline-admin-form .checkline {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.inline-admin-form input,
.inline-admin-form select,
.share-actions select {
  min-height: 2.35rem;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(13, 17, 16, 0.82);
  color: var(--text);
}

.admin-actions,
.share-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.admin-actions {
  grid-column: 1 / -1;
}

.admin-actions button,
.share-actions button {
  min-height: 2.2rem;
  padding: 0 0.62rem;
  background: rgba(27, 34, 31, 0.9);
  color: var(--text);
}

.admin-actions button.danger,
.share-actions button.danger {
  color: #ffd2ce;
}

.share-row {
  grid-template-columns: minmax(0, 1fr) minmax(12rem, auto);
  align-items: center;
}

.share-actions {
  justify-content: flex-end;
}

.admin-share-list {
  margin-top: 0;
}

.section-metrics span,
.chip-row span,
.badge,
.meta-pill {
  padding: 0 0.55rem;
}

.section-metrics span {
  border-color: rgba(118, 198, 255, 0.24);
  background: rgba(20, 45, 67, 0.56);
  color: #d9f1ff;
}

.detail-block {
  display: grid;
  gap: 0.62rem;
}

.detail-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.detail-count {
  color: var(--soft);
  font-size: 0.78rem;
  font-weight: 850;
}

.detail-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: start;
  padding: 0.86rem;
  background: rgba(27, 34, 31, 0.86);
}

.detail-card[data-type="reminder"] {
  border-color: rgba(242, 193, 78, 0.34);
  background: linear-gradient(135deg, rgba(242, 193, 78, 0.1), rgba(27, 34, 31, 0.86) 46%);
}

.detail-card[data-type="task"] {
  border-color: rgba(118, 198, 255, 0.3);
  background: linear-gradient(135deg, rgba(118, 198, 255, 0.08), rgba(27, 34, 31, 0.86) 48%);
}

.detail-card[data-type="note"] {
  border-color: rgba(184, 156, 255, 0.28);
  background: linear-gradient(135deg, rgba(184, 156, 255, 0.08), rgba(27, 34, 31, 0.86) 48%);
}

.giro-list,
.giro-step-list {
  display: grid;
  gap: 0.62rem;
}

.giro-card,
.giro-step-card {
  display: grid;
  gap: 0.75rem;
  align-items: start;
  border: 1px solid rgba(184, 156, 255, 0.24);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(184, 156, 255, 0.08), rgba(27, 34, 31, 0.86) 52%);
  padding: 0.82rem;
}

.giro-card {
  grid-template-columns: minmax(0, 1fr) auto;
}

.giro-step-card {
  grid-template-columns: 2.25rem minmax(0, 1fr) auto;
}

.giro-step-card.is-muted {
  opacity: 0.72;
  filter: saturate(0.78);
}

.giro-position {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(184, 156, 255, 0.32);
  border-radius: 999px;
  background: rgba(43, 36, 67, 0.56);
  color: #efe7ff;
  font-weight: 950;
}

.giro-step-main {
  min-width: 0;
}

.giro-step-actions {
  max-width: 13rem;
}

.detail-card:has(.badge.completed) {
  opacity: 0.86;
}

.detail-card:has(.badge.archived) {
  opacity: 0.68;
  filter: saturate(0.75);
}

.audit-row {
  display: grid;
  gap: 0.3rem;
  border-left: 3px solid rgba(98, 214, 138, 0.32);
}

.record-title {
  display: block;
  margin-bottom: 0.42rem;
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.25;
}

.record-client {
  display: block;
  margin: -0.12rem 0 0.44rem;
  color: var(--soft);
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.25;
}

.record-description {
  margin: 0.52rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.42;
}

.badge.today {
  border-color: rgba(98, 214, 138, 0.45);
  background: rgba(29, 58, 39, 0.74);
  color: #dfffe8;
}

.badge.urgent,
.badge.overdue {
  border-color: rgba(255, 116, 104, 0.42);
  background: rgba(62, 27, 27, 0.72);
  color: #ffd2ce;
}

.badge.completed {
  border-color: rgba(98, 214, 138, 0.25);
  background: rgba(29, 58, 39, 0.38);
  color: var(--green);
}

.badge.reminder {
  border-color: rgba(242, 193, 78, 0.34);
  background: rgba(63, 50, 24, 0.48);
  color: #ffe6a3;
}

.badge.task {
  border-color: rgba(118, 198, 255, 0.3);
  background: rgba(20, 45, 67, 0.42);
  color: #d9f1ff;
}

.badge.note {
  border-color: rgba(184, 156, 255, 0.28);
  background: rgba(43, 36, 67, 0.42);
  color: #e4d9ff;
}

.badge.giro {
  border-color: rgba(184, 156, 255, 0.34);
  background: rgba(43, 36, 67, 0.46);
  color: #efe7ff;
}

.badge.archived {
  border-color: rgba(172, 191, 178, 0.18);
  background: rgba(26, 33, 30, 0.46);
  color: var(--soft);
}

.badge.assigned {
  border-color: rgba(118, 198, 255, 0.32);
  color: #d9f1ff;
}

body:has(#appShell:not(.hidden)) .side-panel,
body:has(#appShell:not(.hidden)) .section-detail {
  color: var(--light-text);
}

body:has(#appShell:not(.hidden)) .metric-card {
  border-color: var(--light-line);
  background:
    radial-gradient(circle at 8% 0%, rgba(98, 214, 138, 0.1), transparent 9rem),
    linear-gradient(180deg, #ffffff, #f7faf8);
  color: var(--light-text);
  box-shadow: 0 10px 26px rgba(15, 27, 20, 0.08);
}

body:has(#appShell:not(.hidden)) .metric-card span,
body:has(#appShell:not(.hidden)) .metric-card small {
  color: var(--light-muted);
}

body:has(#appShell:not(.hidden)) .metric-card strong {
  color: var(--light-text);
}

body:has(#sectionDetail:not(.hidden)) .console-card {
  min-height: 20rem;
}

body:has(#appShell:not(.hidden)) .console-card {
  color: var(--text);
}

body:has(#appShell:not(.hidden)) .console-head h2,
body:has(#appShell:not(.hidden)) .console-card strong,
body:has(#appShell:not(.hidden)) .console-card .message-bubble p {
  color: var(--text);
}

body:has(#appShell:not(.hidden)) .console-card .header-subtitle,
body:has(#appShell:not(.hidden)) .console-card .meta-line,
body:has(#appShell:not(.hidden)) .console-card .composer-hint {
  color: var(--muted);
}

body:has(#appShell:not(.hidden)) .panel-block,
body:has(#appShell:not(.hidden)) .section-detail {
  border-color: var(--light-line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 0%, rgba(98, 214, 138, 0.08), transparent 13rem),
    linear-gradient(180deg, var(--light-card), var(--light-card-soft));
  color: var(--light-text);
  box-shadow: 0 16px 38px rgba(15, 27, 20, 0.09);
}

body:has(#appShell:not(.hidden)) .today-panel,
body:has(#appShell:not(.hidden)) .giro-panel,
body:has(#appShell:not(.hidden)) .search-panel {
  border-color: rgba(36, 143, 91, 0.13);
  background:
    radial-gradient(circle at 10% 0%, rgba(98, 214, 138, 0.1), transparent 12rem),
    linear-gradient(180deg, #ffffff, #f7faf8);
}

body:has(#appShell:not(.hidden)) .mini-item,
body:has(#appShell:not(.hidden)) .action-item,
body:has(#appShell:not(.hidden)) .section-tile,
body:has(#appShell:not(.hidden)) .search-result,
body:has(#appShell:not(.hidden)) .audit-row,
body:has(#appShell:not(.hidden)) .detail-card,
body:has(#appShell:not(.hidden)) .giro-card,
body:has(#appShell:not(.hidden)) .giro-step-card {
  border-color: var(--light-line);
  border-radius: 16px;
  background: var(--light-card);
  color: var(--light-text);
  box-shadow: 0 12px 30px rgba(15, 27, 20, 0.08);
}

body:has(#appShell:not(.hidden)) .mini-reminder,
body:has(#appShell:not(.hidden)) .detail-card[data-type="reminder"] {
  border-color: rgba(190, 138, 27, 0.18);
  background: linear-gradient(180deg, #ffffff, #fffaf0);
}

body:has(#appShell:not(.hidden)) .mini-task,
body:has(#appShell:not(.hidden)) .detail-card[data-type="task"] {
  border-color: rgba(31, 125, 184, 0.16);
  background: linear-gradient(180deg, #ffffff, #f4fbff);
}

body:has(#appShell:not(.hidden)) .mini-giro,
body:has(#appShell:not(.hidden)) .detail-card[data-type="note"],
body:has(#appShell:not(.hidden)) .giro-card,
body:has(#appShell:not(.hidden)) .giro-step-card {
  border-color: rgba(103, 85, 171, 0.16);
  background: linear-gradient(180deg, #ffffff, #f8f6ff);
}

body:has(#appShell:not(.hidden)) .panel-heading .eyebrow,
body:has(#appShell:not(.hidden)) .section-detail-header .eyebrow {
  color: #248f5b;
}

body:has(#appShell:not(.hidden)) .panel-heading h2,
body:has(#appShell:not(.hidden)) .section-detail-header h2,
body:has(#appShell:not(.hidden)) .detail-block-head h3,
body:has(#appShell:not(.hidden)) .mini-item strong,
body:has(#appShell:not(.hidden)) .action-item strong,
body:has(#appShell:not(.hidden)) .section-tile strong,
body:has(#appShell:not(.hidden)) .search-result strong,
body:has(#appShell:not(.hidden)) .audit-row strong,
body:has(#appShell:not(.hidden)) .record-title,
body:has(#appShell:not(.hidden)) .giro-card strong {
  color: var(--light-text);
}

.record-info {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.7rem;
  margin: 0.18rem 0 0.58rem;
  color: var(--light-muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.record-info span {
  color: inherit;
}

body:has(#appShell:not(.hidden)) .mini-item span,
body:has(#appShell:not(.hidden)) .mini-item small,
body:has(#appShell:not(.hidden)) .action-item span,
body:has(#appShell:not(.hidden)) .section-tile span,
body:has(#appShell:not(.hidden)) .search-result span,
body:has(#appShell:not(.hidden)) .audit-row span,
body:has(#appShell:not(.hidden)) .audit-row em,
body:has(#appShell:not(.hidden)) .section-detail-header p,
body:has(#appShell:not(.hidden)) .detail-count,
body:has(#appShell:not(.hidden)) .record-description,
body:has(#appShell:not(.hidden)) .empty {
  color: var(--light-muted);
}

body:has(#appShell:not(.hidden)) .record-title {
  margin-bottom: 0.26rem;
  font-size: clamp(1.02rem, 1.3vw, 1.18rem);
  font-weight: 950;
  letter-spacing: 0;
}

body:has(#appShell:not(.hidden)) .record-client {
  margin: 0 0 0.2rem;
  color: #31483a;
  font-size: 0.9rem;
  font-weight: 900;
}

body:has(#appShell:not(.hidden)) .mini-when {
  color: #1d6a43;
  font-size: 0.84rem;
}

body:has(#appShell:not(.hidden)) .badge,
body:has(#appShell:not(.hidden)) .meta-pill,
body:has(#appShell:not(.hidden)) .section-kind-badge,
body:has(#appShell:not(.hidden)) .section-tile-counts span,
body:has(#appShell:not(.hidden)) .section-metrics span,
body:has(#appShell:not(.hidden)) .panel-badge {
  min-height: 1.55rem;
  border-color: rgba(20, 32, 25, 0.08);
  border-radius: 10px;
  background: #f1f5f3;
  color: #526159;
  font-size: 0.74rem;
}

body:has(#appShell:not(.hidden)) .section-metrics span {
  background: rgba(118, 198, 255, 0.13);
  color: #1f648f;
}

body:has(#appShell:not(.hidden)) .badge.today {
  border-color: rgba(36, 143, 91, 0.22);
  background: rgba(36, 143, 91, 0.1);
  color: #17643d;
}

body:has(#appShell:not(.hidden)) .badge.urgent,
body:has(#appShell:not(.hidden)) .badge.overdue {
  border-color: rgba(210, 87, 72, 0.24);
  background: rgba(210, 87, 72, 0.1);
  color: #a53b31;
}

body:has(#appShell:not(.hidden)) .badge.completed {
  border-color: rgba(36, 143, 91, 0.15);
  background: rgba(36, 143, 91, 0.07);
  color: #2f7550;
}

body:has(#appShell:not(.hidden)) .badge.reminder {
  border-color: rgba(190, 138, 27, 0.2);
  background: rgba(242, 193, 78, 0.16);
  color: #8a6212;
}

body:has(#appShell:not(.hidden)) .badge.task {
  border-color: rgba(31, 125, 184, 0.18);
  background: rgba(118, 198, 255, 0.16);
  color: #1f648f;
}

body:has(#appShell:not(.hidden)) .badge.note,
body:has(#appShell:not(.hidden)) .badge.giro,
body:has(#appShell:not(.hidden)) .badge.assigned {
  border-color: rgba(103, 85, 171, 0.16);
  background: rgba(184, 156, 255, 0.14);
  color: #564799;
}

body:has(#appShell:not(.hidden)) .filter-tabs button,
body:has(#appShell:not(.hidden)) .item-actions button,
body:has(#appShell:not(.hidden)) .section-actions button,
body:has(#appShell:not(.hidden)) .giro-step-actions button,
body:has(#appShell:not(.hidden)) .mini-link,
body:has(#appShell:not(.hidden)) .see-all-button,
body:has(#appShell:not(.hidden)) .section-detail-header .text-button {
  border-color: rgba(20, 32, 25, 0.09);
  background: #eef4f1;
  color: #24352c;
}

body:has(#appShell:not(.hidden)) .filter-tabs button.is-active,
body:has(#appShell:not(.hidden)) .item-actions button:first-child:not(:disabled),
body:has(#appShell:not(.hidden)) .text-button.primary,
body:has(#appShell:not(.hidden)) .section-actions .text-button.primary {
  border-color: rgba(36, 143, 91, 0.24);
  background: #daf1e4;
  color: #17643d;
}

body:has(#appShell:not(.hidden)) .item-actions button.danger,
body:has(#appShell:not(.hidden)) .item-actions button[data-delete-item],
body:has(#appShell:not(.hidden)) .section-actions [data-action="delete-section"],
body:has(#appShell:not(.hidden)) .giro-step-actions button.danger {
  background: #fff0ee;
  color: #a53b31;
}

body:has(#appShell:not(.hidden)) .empty-state {
  border-color: rgba(20, 32, 25, 0.08);
  background: #f7faf8;
  color: var(--light-text);
}

body:has(#appShell:not(.hidden)) .empty-state strong {
  color: var(--light-text);
}

body:has(#appShell:not(.hidden)) .search-form input {
  border-color: rgba(20, 32, 25, 0.11);
  background: #ffffff;
  color: var(--light-text);
}

.edit-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 0.9rem;
  border-left: 4px solid var(--green);
  background: rgba(12, 15, 14, 0.86);
}

.edit-panel label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.edit-panel input,
.edit-panel select,
.edit-panel textarea {
  min-height: 2.55rem;
  padding: 0.65rem 0.7rem;
}

.edit-panel textarea {
  min-height: 5.1rem;
  resize: vertical;
}

.edit-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 0.45rem;
}

@media (max-width: 1120px) {
  .workspace-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .console-card {
    min-height: 34rem;
  }

  .side-panel {
    max-height: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .actions-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  body {
    padding-bottom: calc(5.4rem + env(safe-area-inset-bottom));
    background:
      radial-gradient(circle at 50% -12rem, rgba(98, 214, 138, 0.13), transparent 25rem),
      linear-gradient(180deg, #07100d 0%, #0a0e0d 48%, #070908 100%);
  }

  body:has(#loginScreen:not(.hidden)) {
    padding-bottom: 0;
  }

  .login-screen {
    min-height: 100svh;
    padding:
      max(0.85rem, env(safe-area-inset-top))
      max(0.72rem, env(safe-area-inset-right))
      max(0.95rem, env(safe-area-inset-bottom))
      max(0.72rem, env(safe-area-inset-left));
  }

  .login-card {
    width: min(100%, 22rem);
    gap: 0.72rem;
    padding: 0.88rem;
    border-color: rgba(172, 191, 178, 0.12);
    border-radius: var(--radius-app);
    background:
      radial-gradient(circle at 50% 0%, rgba(98, 214, 138, 0.14), transparent 11rem),
      rgba(12, 17, 15, 0.96);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.32);
  }

  .login-brand {
    gap: 0.24rem;
  }

  .login-brand img {
    width: 3.85rem;
    border-radius: 16px;
  }

  .login-brand h1 {
    margin-bottom: 0;
    font-size: 1.55rem;
    line-height: 0.98;
  }

  .login-brand .header-subtitle {
    color: rgba(183, 194, 180, 0.82);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.1;
  }

  .login-brand p:last-child {
    max-width: 15rem;
    color: rgba(183, 194, 180, 0.72);
    font-size: 0.78rem;
  }

  .login-card label {
    gap: 0.28rem;
    font-size: 0.76rem;
  }

  .login-card input {
    min-height: 2.82rem;
    padding: 0 0.78rem;
    border-color: rgba(172, 191, 178, 0.14);
    border-radius: 14px;
    background: rgba(7, 10, 9, 0.82);
    font-size: 1rem;
  }

  .login-card > .send-button {
    grid-column: auto;
    width: 100%;
    min-width: 0;
    min-height: 2.86rem;
    margin-top: 0.06rem;
    border-radius: 14px;
  }

  .login-error {
    min-height: 0.95rem;
    font-size: 0.78rem;
    text-align: center;
  }

  .app-shell {
    width: min(100%, 30rem);
    padding: 0.58rem 0.5rem calc(5.9rem + env(safe-area-inset-bottom));
  }

  .app-shell[data-mobile-view="search"],
  .app-shell[data-mobile-view="sections"],
  .app-shell[data-mobile-view="section-detail"],
  .app-shell[data-mobile-view="giro"],
  .app-shell[data-mobile-view="giro-detail"] {
    border-radius: calc(var(--radius-app) + 8px);
    background:
      linear-gradient(180deg, rgba(244, 246, 248, 0.98), rgba(238, 242, 245, 0.98));
  }

  .app-header {
    position: sticky;
    top: 0.45rem;
    align-items: center;
    flex-direction: row;
    min-height: 4.25rem;
    padding: 0.68rem 0.74rem;
    margin-bottom: 0.72rem;
    gap: 0.62rem;
    border-color: rgba(196, 236, 211, 0.15);
    border-radius: 22px;
    background:
      radial-gradient(circle at 14% 0%, rgba(98, 214, 138, 0.16), transparent 13rem),
      linear-gradient(135deg, rgba(5, 13, 10, 0.98), rgba(12, 25, 20, 0.96));
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.34);
  }

  .brand-area {
    flex: 1 1 auto;
    gap: 0.72rem;
    min-width: 0;
  }

  .brand-area > div {
    min-width: 0;
    display: grid;
    gap: 0.02rem;
  }

  .brand-mark {
    width: 3rem;
    height: 3rem;
    border-radius: 16px;
    border-color: rgba(242, 193, 78, 0.36);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 20px rgba(0, 0, 0, 0.22);
  }

  .brand-area h1 {
    font-size: 1.52rem;
    font-weight: 950;
    line-height: 0.95;
  }

  .status-pill.voice-ready,
  .status-pill.engine {
    display: none;
  }

  .brand-area .header-subtitle {
    display: block;
    max-width: 10.5rem;
    overflow: hidden;
    color: rgba(225, 243, 230, 0.82);
    font-size: 0.7rem;
    font-weight: 750;
    line-height: 1.08;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-status {
    flex: 0 0 auto;
    justify-content: flex-end;
    gap: 0.52rem;
  }

  .status-pill.user-pill {
    gap: 0.42rem;
    max-width: none;
    min-height: 2.55rem;
    padding: 0 0.78rem;
    border-color: rgba(206, 235, 216, 0.14);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.06);
    color: #f4fff6;
    font-size: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }

  .status-pill.user-pill::after {
    content: attr(data-short-label);
    font-size: 0.82rem;
    font-weight: 900;
  }

  #logoutButton,
  #adminUsersButton,
  .settings-button,
  .status-pill.engine,
  .status-pill.voice-ready {
    display: none;
  }

  .mobile-menu-button {
    display: grid;
  }

  .overview-strip {
    display: none;
  }

  .workspace-grid {
    display: flex;
    flex-direction: column;
    gap: 0.62rem;
  }

  .main-column,
  .console-card,
  .side-panel {
    width: 100%;
  }

  .side-panel {
    grid-template-columns: 1fr;
    gap: 0.58rem;
  }

  .side-panel > .panel-block {
    display: none;
  }

  .app-shell[data-mobile-view="home"] #todayPanel,
  .app-shell[data-mobile-view="search"] #searchPanel,
  .app-shell[data-mobile-view="sections"] #sectionsPanel,
  .app-shell[data-mobile-view="giro"] #giroPanel {
    display: block;
  }

  .app-shell[data-mobile-view="search"] .console-card,
  .app-shell[data-mobile-view="sections"] .console-card,
  .app-shell[data-mobile-view="giro"] .console-card,
  .app-shell[data-mobile-view="account"] .console-card {
    display: none;
  }

  .app-shell[data-mobile-view="section-detail"] .side-panel,
  .app-shell[data-mobile-view="giro-detail"] .side-panel {
    display: none;
  }

  .console-card {
    min-height: 0;
    border-color: rgba(172, 191, 178, 0.12);
    border-radius: var(--radius-app);
    background:
      radial-gradient(circle at 12% 0%, rgba(98, 214, 138, 0.14), transparent 15rem),
      linear-gradient(180deg, rgba(18, 25, 22, 0.96), rgba(9, 13, 12, 0.94));
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.25);
    overflow: hidden;
  }

  .console-head {
    padding: 0.68rem 0.68rem 0.58rem;
    gap: 0.5rem;
    border-bottom-color: rgba(172, 191, 178, 0.1);
  }

  .console-head .eyebrow {
    margin-bottom: 0.12rem;
    color: rgba(129, 222, 151, 0.84);
    font-size: 0.66rem;
    text-transform: none;
  }

  .console-head h2 {
    font-size: 1.12rem;
    line-height: 1.12;
  }

  .quick-actions {
    display: none;
  }

  .console-head,
  .composer-footer,
  .section-detail-header,
  .detail-card,
  .giro-card,
  .user-row,
  .share-row,
  .giro-step-card {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .context-pill {
    max-width: 100%;
    min-height: 1.75rem;
    padding: 0 0.58rem;
    border-color: rgba(172, 191, 178, 0.1);
    background: rgba(255, 255, 255, 0.045);
    color: var(--muted);
    font-size: 0.7rem;
  }

  .app-shell[data-mobile-view="home"] .context-pill {
    display: none;
  }

  .console-side {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.34rem;
  }

  .context-home-button {
    width: auto;
    min-height: 1.95rem;
    padding: 0 0.68rem;
    font-size: 0.72rem;
  }

  .console-tools {
    display: flex;
    margin-left: auto;
    justify-content: flex-start;
    gap: 0.28rem;
  }

  .console-tools button,
  .chat-history-head button {
    min-height: 1.75rem;
    padding: 0 0.25rem;
    border-color: transparent;
    background: transparent;
    color: var(--soft);
    font-size: 0.68rem;
    text-decoration: underline;
  }

  .message {
    max-width: 100%;
    width: 100%;
  }

  .conversation {
    min-height: 4.3rem;
    max-height: 7.8rem;
    padding: 0.62rem 0.68rem;
    gap: 0.42rem;
    background: rgba(7, 10, 9, 0.2);
  }

  .message-bubble {
    padding: 0.6rem 0.68rem;
    border-color: rgba(172, 191, 178, 0.1);
    border-radius: 14px;
    background: rgba(25, 34, 29, 0.78);
    box-shadow: none;
  }

  .message-bubble p {
    font-size: 0.9rem;
    line-height: 1.38;
  }

  .meta-line {
    margin-top: 0.28rem;
    font-size: 0.72rem;
  }

  .composer {
    position: relative;
    z-index: 1;
    padding: 0.62rem 0.68rem 0.68rem;
    background: rgba(8, 12, 11, 0.76);
    border-top: 1px solid rgba(172, 191, 178, 0.1);
  }

  .composer textarea {
    min-height: 3.2rem;
    padding: 0.72rem 0.78rem;
    border-color: rgba(172, 191, 178, 0.14);
    border-radius: 14px;
    background: rgba(7, 10, 9, 0.82);
    font-size: 1rem;
    line-height: 1.35;
  }

  .composer-footer {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.42rem;
    margin-top: 0.52rem;
  }

  .voice-controls {
    display: contents;
  }

  .composer .send-button {
    grid-column: 3;
    width: 100%;
    min-width: 0;
    min-height: 2.72rem;
    padding: 0 0.68rem;
    border-radius: 14px;
  }

  .mic-button,
  .stop-button {
    width: 100%;
    min-height: 2.72rem;
    padding: 0 0.62rem;
    border-radius: 14px;
  }

  .mic-button {
    grid-column: 1;
    background: rgba(29, 58, 39, 0.74);
  }

  .stop-button {
    grid-column: 2;
    background: rgba(62, 27, 27, 0.66);
  }

  .composer-hint {
    display: none;
  }

  #todayPanel {
    order: 1;
  }

  #giroPanel {
    order: 2;
  }

  #sectionsPanel {
    order: 3;
  }

  #searchPanel {
    order: 4;
  }

  .side-panel > .panel-block:not(#todayPanel):not(#giroPanel):not(#sectionsPanel):not(#searchPanel) {
    order: 5;
  }

  .panel-block {
    padding: 0.72rem;
    border-color: var(--light-line);
    border-radius: 16px;
    background: linear-gradient(180deg, var(--light-card), var(--light-card-soft));
    color: var(--light-text);
    box-shadow: 0 12px 34px rgba(10, 20, 16, 0.08);
  }

  .today-panel,
  .giro-panel {
    border-color: rgba(36, 143, 91, 0.14);
    background:
      radial-gradient(circle at 10% 0%, rgba(98, 214, 138, 0.12), transparent 11rem),
      linear-gradient(180deg, #ffffff, #f7faf8);
  }

  .utility-panel summary {
    padding: 0.68rem;
  }

  .panel-heading {
    align-items: center;
  }

  .panel-heading .eyebrow {
    margin-bottom: 0.1rem;
    color: #248f5b;
    font-size: 0.64rem;
    text-transform: none;
  }

  .panel-heading h2 {
    color: var(--light-text);
    font-size: 1rem;
  }

  .panel-badge {
    min-width: 1.75rem;
    min-height: 1.75rem;
    padding: 0 0.42rem;
    border-color: rgba(36, 143, 91, 0.16);
    background: rgba(36, 143, 91, 0.08);
    color: #1d6a43;
    font-size: 0.72rem;
  }

  .mini-list,
  .section-grid,
  .search-results {
    gap: 0.5rem;
    margin-top: 0.55rem;
  }

  .mini-item,
  .section-tile,
  .search-result {
    padding: 0.72rem;
    border-color: var(--light-line);
    background: var(--light-card);
    color: var(--light-text);
    box-shadow: 0 9px 22px rgba(15, 27, 20, 0.07);
  }

  .mini-item strong,
  .section-tile strong,
  .record-title {
    color: var(--light-text);
    font-size: 0.98rem;
    line-height: 1.25;
  }

  .mini-item span,
  .mini-item small,
  .section-tile span,
  .search-result span,
  .audit-row span,
  .audit-row em,
  .record-description,
  .empty {
    color: var(--light-muted);
  }

  .record-client {
    color: #31483a;
    font-size: 0.86rem;
  }

  .mini-when {
    color: #1d6a43;
  }

  .section-kind-badge,
  .section-tile-counts span,
  .meta-pill {
    border-color: rgba(20, 32, 25, 0.08);
    background: #f1f5f3;
    color: #526159;
  }

  .badge.today {
    border-color: rgba(36, 143, 91, 0.22);
    background: rgba(36, 143, 91, 0.1);
    color: #17643d;
  }

  .badge.urgent,
  .badge.overdue {
    border-color: rgba(210, 87, 72, 0.24);
    background: rgba(210, 87, 72, 0.1);
    color: #a53b31;
  }

  .badge.completed {
    border-color: rgba(36, 143, 91, 0.15);
    background: rgba(36, 143, 91, 0.07);
    color: #2f7550;
  }

  .badge.reminder {
    border-color: rgba(190, 138, 27, 0.2);
    background: rgba(242, 193, 78, 0.16);
    color: #8a6212;
  }

  .badge.task {
    border-color: rgba(31, 125, 184, 0.18);
    background: rgba(118, 198, 255, 0.16);
    color: #1f648f;
  }

  .badge.note,
  .badge.giro,
  .badge.assigned {
    border-color: rgba(103, 85, 171, 0.16);
    background: rgba(184, 156, 255, 0.14);
    color: #564799;
  }

  .mini-item-footer {
    align-items: center;
  }

  .mini-link,
  .see-all-button {
    min-height: 2.35rem;
    border-color: rgba(20, 32, 25, 0.1);
    background: #ecf3ef;
    color: #1d6a43;
  }

  .empty-state {
    gap: 0.46rem;
    padding: 0.78rem;
    border-style: solid;
    border-color: rgba(20, 32, 25, 0.08);
    border-radius: 14px;
    background: #f7faf8;
  }

  .empty-state strong {
    color: var(--light-text);
    font-size: 0.95rem;
  }

  .empty-state .text-button.primary {
    min-height: 2.32rem;
    border-radius: 12px;
  }

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

  .section-tile-counts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .item-actions,
  .section-actions,
  .giro-step-actions,
  .edit-actions,
  .admin-actions,
  .share-actions {
    justify-content: stretch;
    max-width: none;
  }

  .item-actions button,
  .section-actions button,
  .giro-step-actions button,
  .edit-actions button,
  .admin-actions button,
  .share-actions button {
    flex: 1 1 auto;
  }

  .edit-panel,
  .inline-admin-form {
    grid-template-columns: 1fr;
  }

  .giro-step-card {
    grid-template-columns: 2.15rem minmax(0, 1fr);
  }

  .giro-step-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
  }

  .giro-step-actions button {
    min-height: 2.6rem;
  }

  .section-detail {
    border: 1px solid var(--light-line);
    border-radius: var(--radius-app);
    background:
      radial-gradient(circle at 12% 0%, rgba(98, 214, 138, 0.09), transparent 14rem),
      linear-gradient(180deg, var(--light-card), var(--light-bg-2));
    color: var(--light-text);
    box-shadow: 0 14px 36px rgba(10, 20, 16, 0.08);
  }

  .section-detail-header h2,
  .detail-block-head h3,
  .giro-card strong {
    color: var(--light-text);
  }

  .section-detail-header p,
  .detail-count {
    color: var(--light-muted);
  }

  .section-metrics span {
    border-color: rgba(31, 125, 184, 0.14);
    background: rgba(118, 198, 255, 0.13);
    color: #1f648f;
  }

  .filter-tabs button {
    border-color: rgba(20, 32, 25, 0.08);
    background: rgba(255, 255, 255, 0.76);
    color: #526159;
  }

  .filter-tabs button.is-active {
    border-color: rgba(36, 143, 91, 0.24);
    background: #e5f3eb;
    color: #17643d;
  }

  .search-form input {
    border-color: rgba(20, 32, 25, 0.11);
    background: #ffffff;
    color: var(--light-text);
  }

  .search-form input::placeholder {
    color: var(--light-soft);
  }

  .detail-card,
  .giro-card,
  .giro-step-card,
  .audit-row,
  .user-row,
  .share-row {
    border-color: var(--light-line);
    background: var(--light-card);
    color: var(--light-text);
    box-shadow: 0 10px 26px rgba(15, 27, 20, 0.07);
  }

  .detail-card[data-type="reminder"] {
    border-color: rgba(190, 138, 27, 0.18);
    background: linear-gradient(180deg, #ffffff, #fffaf0);
  }

  .detail-card[data-type="task"] {
    border-color: rgba(31, 125, 184, 0.16);
    background: linear-gradient(180deg, #ffffff, #f4fbff);
  }

  .detail-card[data-type="note"] {
    border-color: rgba(103, 85, 171, 0.15);
    background: linear-gradient(180deg, #ffffff, #f8f6ff);
  }

  .giro-position {
    border-color: rgba(103, 85, 171, 0.16);
    background: #f1edff;
    color: #564799;
  }

  .item-actions button,
  .section-actions button,
  .giro-step-actions button,
  .section-detail-header .text-button {
    border-color: rgba(20, 32, 25, 0.09);
    background: #eef4f1;
    color: #24352c;
  }

  .section-detail-header > .text-button {
    width: auto;
    min-height: 2.35rem;
    justify-self: start;
    padding: 0 0.82rem;
  }

  .item-actions button:first-child:not(:disabled),
  .text-button.primary,
  .section-actions .text-button.primary {
    border-color: rgba(36, 143, 91, 0.24);
    background: #daf1e4;
    color: #17643d;
  }

  .item-actions button.danger,
  .item-actions button[data-delete-item],
  .section-actions [data-action="delete-section"],
  .giro-step-actions button.danger {
    background: #fff0ee;
    color: #a53b31;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: max(0.55rem, env(safe-area-inset-left));
    right: max(0.55rem, env(safe-area-inset-right));
    bottom: calc(0.5rem + env(safe-area-inset-bottom));
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.22rem;
    width: min(calc(100% - 1.1rem), 29rem);
    margin: 0 auto;
    padding: 0.26rem;
    border: 1px solid rgba(172, 191, 178, 0.13);
    border-radius: 22px;
    background: rgba(8, 12, 11, 0.94);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
    backdrop-filter: blur(18px);
  }

  .mobile-bottom-nav button {
    min-width: 0;
    min-height: 2.55rem;
    border: 0;
    border-radius: 17px;
    background: transparent;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 950;
  }

  .mobile-bottom-nav button.is-active,
  .mobile-bottom-nav button[aria-current="true"] {
    background: rgba(98, 214, 138, 0.16);
    color: #eaffef;
    box-shadow: inset 0 0 0 1px rgba(98, 214, 138, 0.16);
  }

  .mobile-bottom-nav button:focus-visible,
  .mobile-bottom-nav button:hover {
    background: rgba(98, 214, 138, 0.12);
    color: #eaffef;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100%, 30rem);
  }
}

@media (max-width: 520px) {
  .app-shell,
  .app-header,
  .overview-strip,
  .workspace-grid,
  .console-card,
  .side-panel,
  .panel-block,
  .section-detail,
  .conversation,
  .composer {
    max-width: 100%;
  }

  .overview-strip,
  .side-panel {
    grid-template-columns: 1fr;
  }

  .brand-area {
    align-items: center;
    gap: 0.55rem;
  }

  .header-status {
    display: flex;
    justify-content: flex-end;
    gap: 0.26rem;
  }

  .settings-button {
    max-width: 5.4rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .status-pill {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .quick-actions {
    display: none;
  }

  .quick-actions button {
    width: 100%;
  }

  .admin-actions,
  .share-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .user-status {
    justify-self: start;
  }

  .conversation {
    min-height: 4.15rem;
    max-height: 7.4rem;
    padding: 0.56rem;
  }

  .message-bubble {
    max-width: calc(100vw - 4.5rem);
  }

  .message-avatar {
    display: none;
  }

  .composer {
    padding: 0.58rem 0.6rem 0.62rem;
  }

  .settings-panel {
    padding: max(0.5rem, env(safe-area-inset-top)) 0.5rem max(0.5rem, env(safe-area-inset-bottom));
  }

  .settings-sheet {
    width: calc(100vw - 1rem);
    max-height: calc(100dvh - 1rem);
    border-radius: 20px;
  }

  .settings-head {
    gap: 0.72rem;
    padding: 0.92rem 0.82rem 0.72rem;
  }

  .settings-tabs {
    gap: 0.38rem;
    padding: 0 0.82rem 0.78rem;
    scroll-padding-inline: 0.82rem;
  }

  .settings-tabs button {
    min-height: 2.38rem;
    padding: 0 0.72rem;
    font-size: 0.8rem;
  }

  .settings-body {
    padding: 0 0.82rem 0.95rem;
  }

  .mobile-bottom-nav {
    left: 0.5rem;
    right: 0.5rem;
    width: auto;
  }

  .panel-block,
  .section-detail {
    padding: 0.72rem;
  }
}

@media (max-width: 1120px) and (min-width: 821px) {
  body:has(#sectionDetail:not(.hidden)) .console-card {
    min-height: 20rem;
  }

  body:has(#sectionDetail:not(.hidden)) .conversation {
    min-height: 7rem;
    max-height: 12rem;
  }
}

body:has(#appShell:not(.hidden)) .console-card {
  border-color: var(--light-line);
  background:
    radial-gradient(circle at 9% 0%, rgba(98, 214, 138, 0.12), transparent 14rem),
    linear-gradient(180deg, #ffffff, #f7faf8);
  color: var(--light-text);
  box-shadow: 0 16px 42px rgba(15, 27, 20, 0.1);
}

body:has(#appShell:not(.hidden)) .console-head {
  border-bottom-color: rgba(20, 32, 25, 0.09);
}

body:has(#appShell:not(.hidden)) .console-head .eyebrow {
  color: #248f5b;
}

body:has(#appShell:not(.hidden)) .console-head h2,
body:has(#appShell:not(.hidden)) .console-card strong,
body:has(#appShell:not(.hidden)) .console-card .message-bubble p {
  color: var(--light-text);
}

body:has(#appShell:not(.hidden)) .console-card .header-subtitle,
body:has(#appShell:not(.hidden)) .console-card .meta-line,
body:has(#appShell:not(.hidden)) .console-card .composer-hint {
  color: var(--light-muted);
}

body:has(#appShell:not(.hidden)) .context-pill,
body:has(#appShell:not(.hidden)) .context-home-button,
body:has(#appShell:not(.hidden)) .console-tools button,
body:has(#appShell:not(.hidden)) .chat-history-head button,
body:has(#appShell:not(.hidden)) .quick-actions button {
  border-color: rgba(20, 32, 25, 0.09);
  background: #eef4f1;
  color: #24352c;
}

body:has(#appShell:not(.hidden)) .context-home-button,
body:has(#appShell:not(.hidden)) .quick-actions button:first-child {
  border-color: rgba(36, 143, 91, 0.22);
  background: #daf1e4;
  color: #17643d;
}

body:has(#appShell:not(.hidden)) .conversation {
  background: #f8faf8;
  box-shadow: inset 0 1px 0 rgba(20, 32, 25, 0.06);
}

body:has(#appShell:not(.hidden)) .message-avatar {
  border-color: rgba(20, 32, 25, 0.08);
  background: #eef4f1;
  color: #526159;
}

body:has(#appShell:not(.hidden)) .message.assistant .message-avatar {
  border-color: rgba(36, 143, 91, 0.2);
  background: #daf1e4;
  color: #17643d;
}

body:has(#appShell:not(.hidden)) .message.user .message-avatar {
  border-color: rgba(31, 125, 184, 0.2);
  background: #e3f3ff;
  color: #1f648f;
}

body:has(#appShell:not(.hidden)) .message-bubble,
body:has(#appShell:not(.hidden)) .chat-history-panel,
body:has(#appShell:not(.hidden)) .chat-history-row {
  border-color: var(--light-line);
  background: #ffffff;
  color: var(--light-text);
  box-shadow: 0 8px 20px rgba(15, 27, 20, 0.06);
}

body:has(#appShell:not(.hidden)) .message.user .message-bubble {
  border-color: rgba(31, 125, 184, 0.16);
  background: #f1f9ff;
}

body:has(#appShell:not(.hidden)) .message.error .message-bubble {
  border-color: rgba(210, 87, 72, 0.24);
  background: #fff0ee;
  color: #a53b31;
}

body:has(#appShell:not(.hidden)) .composer {
  border-top-color: rgba(20, 32, 25, 0.09);
  background: #ffffff;
}

body:has(#appShell:not(.hidden)) .composer textarea {
  border-color: rgba(20, 32, 25, 0.11);
  background: #f8fafb;
  color: var(--light-text);
}

body:has(#appShell:not(.hidden)) .composer textarea::placeholder {
  color: var(--light-soft);
}

/* Balanced premium theme refinement */
body:has(#appShell:not(.hidden)) {
  --light-bg: #e7ece8;
  --light-bg-2: #dfe7e2;
  --light-card: #fffefd;
  --light-card-soft: #f6f8f6;
  --light-text: #101a15;
  --light-muted: #586a60;
  --light-soft: #849189;
  --light-line: rgba(20, 32, 25, 0.14);
  background:
    radial-gradient(circle at 16% 0%, rgba(38, 179, 148, 0.16), transparent 22rem),
    linear-gradient(180deg, #06100d 0, #07120e 5.85rem, #dfe7e2 5.86rem, #e9eee9 100%);
}

body:has(#appShell:not(.hidden)) .app-header {
  border-color: rgba(171, 222, 190, 0.18);
  background:
    linear-gradient(135deg, rgba(9, 20, 16, 0.98), rgba(14, 35, 28, 0.94) 58%, rgba(7, 13, 11, 0.96)),
    radial-gradient(circle at 12% 20%, rgba(98, 214, 138, 0.18), transparent 18rem);
  box-shadow: 0 18px 46px rgba(4, 10, 8, 0.34);
}

body:has(#appShell:not(.hidden)) .brand-area {
  position: relative;
  padding-right: 1.05rem;
}

body:has(#appShell:not(.hidden)) .brand-area::after {
  content: "";
  width: 1px;
  align-self: stretch;
  background: linear-gradient(180deg, transparent, rgba(199, 239, 214, 0.2), transparent);
}

body:has(#appShell:not(.hidden)) .brand-mark {
  width: 3.05rem;
  height: 3.05rem;
  border-color: rgba(242, 193, 78, 0.38);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(4, 8, 7, 0.86));
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

body:has(#appShell:not(.hidden)) .brand-area h1 {
  color: #f5fff8;
  font-weight: 950;
  text-shadow: 0 1px 16px rgba(98, 214, 138, 0.2);
}

body:has(#appShell:not(.hidden)) .brand-area .header-subtitle {
  color: rgba(224, 241, 229, 0.82);
}

body:has(#appShell:not(.hidden)) .header-status .status-pill,
body:has(#appShell:not(.hidden)) .header-status .text-button,
body:has(#appShell:not(.hidden)) .header-status .icon-button {
  border-color: rgba(206, 235, 216, 0.13);
  background: rgba(255, 255, 255, 0.055);
  color: rgba(237, 250, 240, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

body:has(#appShell:not(.hidden)) .side-panel,
body:has(#appShell:not(.hidden)) .section-detail {
  color: var(--light-text);
}

body:has(#appShell:not(.hidden)) .panel-block,
body:has(#appShell:not(.hidden)) .section-detail,
body:has(#appShell:not(.hidden)) .console-card {
  border-color: rgba(20, 32, 25, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 247, 0.96));
  box-shadow: 0 16px 38px rgba(25, 41, 32, 0.12);
}

body:has(#appShell:not(.hidden)) .console-card {
  border-color: rgba(21, 80, 54, 0.12);
  background:
    radial-gradient(circle at 8% 0%, rgba(45, 191, 136, 0.16), transparent 17rem),
    linear-gradient(180deg, #ffffff, #f4f8f5);
}

body:has(#appShell:not(.hidden)) .today-panel,
body:has(#appShell:not(.hidden)) .giro-panel,
body:has(#appShell:not(.hidden)) .search-panel,
body:has(#appShell:not(.hidden)) .account-panel {
  border-color: rgba(36, 143, 91, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 247, 0.98));
}

body:has(#appShell:not(.hidden)) .mini-item,
body:has(#appShell:not(.hidden)) .section-tile,
body:has(#appShell:not(.hidden)) .search-result,
body:has(#appShell:not(.hidden)) .detail-card,
body:has(#appShell:not(.hidden)) .giro-step-card,
body:has(#appShell:not(.hidden)) .giro-card,
body:has(#appShell:not(.hidden)) .maintenance-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(20, 32, 25, 0.12);
  border-left: 4px solid var(--tone-accent, #75a38f);
  border-radius: 18px;
  background:
    linear-gradient(90deg, var(--tone-bg, rgba(53, 119, 93, 0.08)), transparent 34%),
    linear-gradient(180deg, #ffffff, #fbfcfb);
  box-shadow: 0 14px 30px rgba(38, 54, 46, 0.11);
}

body:has(#appShell:not(.hidden)) .mini-item:hover,
body:has(#appShell:not(.hidden)) .section-tile:hover,
body:has(#appShell:not(.hidden)) .search-result:hover {
  border-color: rgba(20, 32, 25, 0.18);
  box-shadow: 0 18px 38px rgba(38, 54, 46, 0.16);
}

.tone-pool {
  --tone-accent: #21aa9a;
  --tone-bg: rgba(33, 170, 154, 0.12);
}

.tone-reminder {
  --tone-accent: #4d93d6;
  --tone-bg: rgba(77, 147, 214, 0.12);
}

.tone-health {
  --tone-accent: #e17467;
  --tone-bg: rgba(225, 116, 103, 0.12);
}

.tone-work,
.tone-garden {
  --tone-accent: #d59632;
  --tone-bg: rgba(213, 150, 50, 0.12);
}

.tone-home {
  --tone-accent: #8b79cf;
  --tone-bg: rgba(139, 121, 207, 0.12);
}

.tone-neutral {
  --tone-accent: #7ea08e;
  --tone-bg: rgba(126, 160, 142, 0.11);
}

body:has(#appShell:not(.hidden)) .record-title,
body:has(#appShell:not(.hidden)) .mini-item strong,
body:has(#appShell:not(.hidden)) .section-tile strong,
body:has(#appShell:not(.hidden)) .search-result strong {
  color: #111a15;
  font-weight: 920;
}

body:has(#appShell:not(.hidden)) .record-client {
  color: #314b3d;
  font-weight: 850;
}

body:has(#appShell:not(.hidden)) .record-info,
body:has(#appShell:not(.hidden)) .record-description,
body:has(#appShell:not(.hidden)) .section-owner-line,
body:has(#appShell:not(.hidden)) .cleanup-status,
body:has(#appShell:not(.hidden)) .maintenance-card p {
  color: var(--light-muted);
}

body:has(#appShell:not(.hidden)) .badge,
body:has(#appShell:not(.hidden)) .meta-pill,
body:has(#appShell:not(.hidden)) .section-kind-badge,
body:has(#appShell:not(.hidden)) .section-tile-counts span,
body:has(#appShell:not(.hidden)) .panel-badge {
  border-color: rgba(20, 32, 25, 0.08);
  background: rgba(255, 255, 255, 0.66);
  color: #3f574b;
}

.account-panel {
  display: grid;
  gap: 0.75rem;
}

.maintenance-card {
  display: grid;
  gap: 0.8rem;
  padding: 0.9rem;
}

.maintenance-card h3 {
  margin: 0 0 0.2rem;
  color: var(--light-text);
  font-size: 1rem;
}

.maintenance-card p {
  margin: 0;
  line-height: 1.45;
  font-size: 0.86rem;
}

.maintenance-control {
  display: grid;
  gap: 0.35rem;
  color: var(--light-muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.maintenance-control select {
  min-height: 2.55rem;
  width: 100%;
  border: 1px solid rgba(20, 32, 25, 0.12);
  border-radius: 14px;
  background: #f8faf8;
  color: var(--light-text);
  font-size: 1rem;
  font-weight: 850;
  padding: 0 0.75rem;
}

.maintenance-card button {
  min-height: 2.55rem;
  border: 1px solid rgba(36, 143, 91, 0.22);
  border-radius: 14px;
  background: linear-gradient(180deg, #e2f5eb, #d1edde);
  color: #15462c;
  cursor: pointer;
  font-weight: 900;
}

.cleanup-status {
  min-height: 1.1rem;
  font-size: 0.8rem;
  font-weight: 750;
}

@media (max-width: 820px) {
  body:has(#appShell:not(.hidden)) {
    background:
      linear-gradient(180deg, #06100d 0, #07120e 5.15rem, #dfe7e2 5.16rem, #e9eee9 100%);
  }

  body:has(#appShell:not(.hidden)) .app-header {
    background:
      radial-gradient(circle at 14% 0%, rgba(98, 214, 138, 0.16), transparent 13rem),
      linear-gradient(135deg, rgba(5, 13, 10, 0.98), rgba(12, 25, 20, 0.96));
  }

  body:has(#appShell:not(.hidden)) .brand-area {
    padding-right: 0;
  }

  body:has(#appShell:not(.hidden)) .brand-area::after {
    display: none;
  }

  .maintenance-card {
    padding: 0.78rem;
  }
}
