
:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;
}

html,
body,
#root {
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
}

body {
  min-width: 320px;
  min-height: 100vh;
}

#root {
  min-height: 100vh;
}

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

:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #fff;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

html, body, #root {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  background: #102b35;
}

button, input, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

:focus-visible {
  outline: 3px solid #ffe59b;
  outline-offset: 4px;
}

/* Full-screen landscape */

.brian-environment {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(
      180deg,
      rgba(5, 22, 30, 0.22) 0%,
      rgba(5, 22, 30, 0.08) 42%,
      rgba(5, 22, 30, 0.56) 100%
    ),
    var(--brian-background, url("/images/brian-background.jpg"))
      center / cover no-repeat;
}


/* Living Glass — polished optical surface */

.glass {
  position: relative;
  isolation: isolate;

  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.20) 0%,
      rgba(255, 255, 255, 0.055) 27%,
      rgba(8, 28, 40, 0.24) 65%,
      rgba(5, 22, 34, 0.38) 100%
    );

border: 1px solid rgba(255, 255, 255, 0.16);
border-radius: 32px;

  -webkit-backdrop-filter: blur(20px) saturate(175%);
  backdrop-filter: blur(20px) saturate(175%);

  box-shadow:
    0 22px 55px rgba(0, 0, 0, 0.24),
    0 4px 12px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.70),
    inset 0 -1px 0 rgba(255, 255, 255, 0.12),
    inset 1px 0 0 rgba(255, 255, 255, 0.20),
    inset -1px 0 0 rgba(255, 255, 255, 0.10);

  color: #ffffff;
}

/* Reflected light across the surface */

.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;

  background:
    radial-gradient(
      ellipse at 15% 0%,
      rgba(255, 255, 255, 0.32),
      transparent 55%
    ),
    linear-gradient(
      115deg,
      rgba(255, 255, 255, 0.14),
      transparent 35%
    );

  opacity: 0.5;
}

/* Fine illuminated rim */


.glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;

  box-shadow:
    inset 0 2px 5px -2px rgba(255, 255, 255, 0.42),
    inset 0 -2px 6px -2px rgba(255, 255, 255, 0.10),
    inset 2px 0 6px -3px rgba(255, 255, 255, 0.18),
    inset -2px 0 6px -3px rgba(255, 255, 255, 0.18);
}


/* Keep content above the optical layers */

.glass > * {
  position: relative;
  z-index: 1;
}

/* Accessibility fallback */

@media (prefers-reduced-transparency: reduce) {
  .glass {
    background: #102b35;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .glass::before,
  .glass::after {
    display: none;
  }
}


/* Draggable widgets */

.brian-widget {
  position: absolute;
  width: 280px;
  padding: 20px;
  touch-action: none;
  user-select: none;
  transition:
  left 550ms cubic-bezier(0.22, 1, 0.36, 1),
  top 550ms cubic-bezier(0.22, 1, 0.36, 1),
  transform 550ms cubic-bezier(0.22, 1, 0.36, 1);
}

.brian-widget.is-dragging {
  z-index: 20;
  transition: none;
  cursor: grabbing;
}

.brian-widget.is-focused {
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Widget content reveal */

.widget-detail {
  opacity: 1;
  transition: opacity 200ms ease;
}

.widget-detail.is-hidden {
  opacity: 0;
  pointer-events: none;
}

/* Brian's greeting */

.brian-identity {
  position: absolute;
  top: 32px;
  left: 36px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brian-avatar {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(10, 29, 39, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-size: 32px;
}

.brian-identity h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 650;
}

.brian-identity p {
  margin: 4px 0 0;
  color: #e1ebed;
  font-size: 14px;
}

/* Clock */

.brian-clock {
  position: absolute;
  top: 36px;
  right: 40px;
  text-align: right;
  color: white;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}

.brian-clock-time {
  font-size: clamp(38px, 4vw, 62px);
  font-weight: 300;
  letter-spacing: -2px;
}

.brian-clock-date {
  font-size: 15px;
}

/* Conversation dock */

.brian-dock {
  position: fixed;
  z-index: 50;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, calc(100vw - 32px));
  padding: 12px;
  border-radius: 28px;
}

.brian-dock-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brian-dock-input {
  flex: 1;
  min-width: 0;
  padding: 13px 12px;
  color: #fff;
  background: transparent;
  border: none;
  outline: none;
  font-size: 16px;
}

.brian-dock-input::placeholder {
  color: #d7e4e6;
}

.brian-dock-input:focus-visible {
  outline: 2px solid #ffe59b;
  border-radius: 12px;
}

.brian-icon-button {
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.brian-icon-button:hover {
  background: rgba(255, 255, 255, 0.24);
}

/* Responsive foundation */

@media (max-width: 700px) {
  .brian-identity {
    top: 18px;
    left: 18px;
  }

  .brian-avatar {
    width: 48px;
    height: 48px;
    font-size: 26px;
  }

  .brian-identity h1 {
    font-size: 19px;
  }

  .brian-clock {
    top: 100px;
    right: 20px;
  }

  .brian-widget {
    max-width: calc(100vw - 32px);
  }

  .brian-dock {
    bottom: 12px;
  }
}

/* Accessibility */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .glass {
    background: #102b35;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* Smooth progressive disclosure */

.widget-reveal {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: 0;
  transition:
    grid-template-rows 300ms ease,
    opacity 250ms ease,
    margin-top 300ms ease;
}

.widget-reveal.is-visible {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 14px;
}

.widget-reveal-inner {
  min-height: 0;
  overflow: hidden;
}

/* Keep movement accessible */

@media (prefers-reduced-motion: reduce) {
  .widget-reveal {
    transition: none;
  }
}

.widget-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 12px;
}

.widget-controls .brian-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  border-radius: 8px;
}

.widget-controls .brian-icon-button svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 180ms ease;
}

.widget-controls .brian-icon-button:hover svg,
.widget-controls .brian-icon-button:focus-visible svg {
  opacity: 1;
}
.widget-controls .brian-icon-button[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.18);
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
}

.widget-controls .brian-icon-button[aria-pressed="true"] svg {
  opacity: 1;
}
.brian-widget.is-dragging {
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .brian-widget {
    transition: none;
  }
}

/* Living Glass — mobile widget layout */
@media (max-width: 700px) {
  .brian-widget {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;

    width: calc(100% - 32px) !important;
    max-width: none !important;
    box-sizing: border-box;

    margin: 0 16px 16px;
    cursor: default !important;
  }
}

/* Living Glass — mobile page flow */
@media (max-width: 700px) {
  .brian-environment {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;

    height: auto !important;
    min-height: 100dvh !important;
    overflow: visible !important;

    padding-top: 24px !important;
    padding-bottom: 32px !important;
    box-sizing: border-box;
  }

  .brian-identity,
  .brian-clock {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    transform: none !important;
  }

  .brian-identity {
    margin: 0 16px 24px !important;
  }

  .brian-clock {
    margin: 0 16px 32px !important;
  }
}

/* Mobile widget expand/collapse control */

/* Mobile widget controls */
.mobile-expand-button {
  display: none;
}

@media (max-width: 700px) {
  /* Hide desktop Move and Focus controls */
  .brian-widget .widget-controls {
    display: none !important;
  }

  /* Smaller, centred expand/collapse button */
  .mobile-expand-button {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;
    padding: 0;
    flex-shrink: 0;

    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: inherit;

    font-size: 16px;
    line-height: 1;
    font-family: Arial, sans-serif;
    cursor: pointer;
  }
}

/* Mobile widget ordering toolbar */
.mobile-widget-toolbar {
  display: none;
}

@media (max-width: 700px) {
  .mobile-widget-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 16px 16px;
    gap: 12px;
  }

  .mobile-widget-toolbar span {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.75;
  }

  .mobile-reorder-button {
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    padding: 7px 14px;
    background: rgba(255, 255, 255, 0.1);
    color: inherit;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
  }
}



/* Mobile drag-to-reorder handle */
.mobile-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 32px;
  height: 32px;
  padding: 0;
  flex-shrink: 0;

  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.65;

  cursor: grab;
  touch-action: none;
}

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

.mobile-drag-handle svg {
  display: block;
}
/* Mobile widget list container */
.mobile-widget-list {
  display: contents;
}

@media (max-width: 700px) {
  .mobile-widget-list {
    display: flex;
    flex-direction: column;
    width: 100%;
  }
}/* Brian Settings button */

.brian-settings-button {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 100;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 46px;
  height: 46px;

  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 14px;

  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);

  color: white;
  cursor: pointer;

  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.brian-settings-button:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.05);
}

@media (max-width: 700px) {
  .brian-settings-button {
    top: 20px;
    right: 16px;
    width: 42px;
    height: 42px;
  }
}@media (min-width: 701px) {
  .brian-settings-button {
    left: auto;
    right: 40px;
    top: 120px;
  }
}/* Brian Settings — sliding glass sidebar */

.brian-settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
}

.brian-settings-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: rgba(0, 0, 0, 0.2);
  cursor: default;
}

.brian-settings-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;

  width: min(400px, 100%);
  box-sizing: border-box;
  padding: 28px;

  overflow-y: auto;

  background: rgba(25, 30, 45, 0.68);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);

  border-left: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: -15px 0 50px rgba(0, 0, 0, 0.2);

  color: white;

}

@keyframes brian-settings-slide-in {
  from {
    transform: translateX(100%);
    opacity: 0.7;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.brian-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
}

.brian-settings-header h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 500;
}

.brian-settings-close {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
justify-content: center;
}

.brian-settings-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.brian-settings-content > button {
  width: 100%;
  padding: 18px 20px;

  text-align: left;
  font: inherit;
  font-size: 15px;
  color: white;

  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);

  cursor: pointer;
  transition: background 0.2s ease;
}

.brian-settings-content > button:hover {
  background: rgba(255, 255, 255, 0.16);
}

@media (max-width: 700px) {
  .brian-settings-panel {
    width: min(360px, 92vw);
    padding: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brian-settings-panel {
    animation: none;
  }
}/* Appearance — background gallery */

.brian-background-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.brian-background-option {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  min-width: 0;

  border: 2px solid transparent;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  cursor: pointer;

  transition: background 0.2s ease, border-color 0.2s ease;
}

.brian-background-option:hover {
  background: rgba(255, 255, 255, 0.16);
}

.brian-background-option.is-selected {
  border-color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.18);
}

.brian-background-option img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
}

.brian-background-option span {
  font-size: 13px;
  text-align: center;
}/* Settings — widget visibility */

.brian-widget-visibility-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.brian-widget-visibility-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: background 0.2s ease;
}

.brian-widget-visibility-item:hover {
  background: rgba(255, 255, 255, 0.15);
}

.brian-widget-visibility-name {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brian-widget-visibility-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 23px;
}

.brian-widget-visibility-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brian-widget-visibility-text strong {
  font-size: 15px;
  font-weight: 500;
}

.brian-widget-visibility-text small {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
}

.brian-widget-toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.brian-widget-toggle {
  position: relative;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.25);
  transition: background 0.25s ease;
}

.brian-widget-toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s ease;
}

.brian-widget-toggle-input:checked + .brian-widget-toggle {
  background: #3b9e88;
}

.brian-widget-toggle-input:checked + .brian-widget-toggle::after {
  transform: translateX(20px);
}

.brian-widget-visibility-item:has(
  .brian-widget-toggle-input:focus-visible
) {
  outline: 2px solid white;
  outline-offset: 3px;
}/* ========================================
   BRIAN — LOGIN SCREEN
   ======================================== */

.brian-login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;

  background-image:
    linear-gradient(
      135deg,
      rgba(10, 15, 30, 0.22),
      rgba(10, 15, 30, 0.48)
    ),
    url("/images/brian-background.jpg");

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.brian-login-panel {
  width: 100%;
  max-width: 420px;
  padding: 44px 40px;

  display: flex;
  flex-direction: column;
  gap: 12px;

  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);

  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 28px;

  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);

  color: white;
}

.brian-login-symbol {
  font-size: 48px;
  text-align: center;
  margin-bottom: 8px;
  color: white;
}

.brian-login-panel h1 {
  margin: 0;
  text-align: center;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.8px;
}

.brian-login-panel > p {
  margin: 0 0 22px;
  text-align: center;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.8);
}

.brian-login-panel label {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

.brian-login-panel input {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;

  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;

  background: rgba(255, 255, 255, 0.12);
  color: white;

  font: inherit;
  font-size: 16px;
  outline: none;

  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.brian-login-panel input:focus {
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.18);
}

.brian-login-panel button[type="submit"] {
  margin-top: 22px;
  padding: 15px;

  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 14px;

  background: rgba(255, 255, 255, 0.9);
  color: #202638;

  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;

  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.brian-login-panel button[type="submit"]:hover {
  background: white;
  transform: translateY(-1px);
}

.brian-login-panel button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.brian-login-panel .brian-login-error {
  margin: 8px 0 0;
  color: #ffe0e0;
  font-size: 13px;
  text-align: left;
}

@media (max-width: 480px) {
  .brian-login-panel {
    padding: 32px 24px;
    border-radius: 22px;
  }

  .brian-login-panel h1 {
    font-size: 26px;
  }
}/* ========================================
   BRIAN — PASSWORD RESET
   ======================================== */

.brian-login-panel form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.brian-login-panel form h1 {
  margin: 0;
}

.brian-login-panel form > p {
  margin: 0 0 22px;
  text-align: center;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.8);
}

.brian-login-panel .brian-reset-button {
  margin-top: 22px;
  padding: 15px;
  width: 100%;

  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 14px;

  background: rgba(255, 255, 255, 0.9);
  color: #202638;

  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.brian-login-panel .brian-reset-button:hover {
  background: white;
}/* Brian — Forgot password link */

.brian-login-panel .brian-forgot-password {
  align-self: center;
  margin-top: 6px;
  padding: 8px 12px;

  background: transparent;
  border: none;

  color: rgba(255, 255, 255, 0.85);
  font: inherit;
  font-size: 14px;

  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.brian-login-panel .brian-forgot-password:hover {
  color: white;
}

.brian-login-panel .brian-forgot-password:focus-visible {
  outline: 2px solid white;
  outline-offset: 3px;
  border-radius: 6px;
}/* Brian conversation panel */

.brian-chat-panel {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;

  width: min(720px, calc(100vw - 32px));
  height: min(750px, calc(100dvh - 120px));

  display: flex;
  flex-direction: column;

  overflow: hidden;
  margin: 0;
  padding: 20px;
  box-sizing: border-box;

  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.brian-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.brian-chat-message {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  overflow-wrap: anywhere;
}

.brian-chat-message strong {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  opacity: 0.7;
}

.brian-chat-message p {
  margin: 0;
  line-height: 1.5;
  white-space: pre-wrap;
}

.brian-chat-user {
  align-self: flex-end;
  background: rgba(100, 160, 255, 0.2);
}

.brian-chat-assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.1);
}.brian-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.brian-chat-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}.brian-chat-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.brian-chat-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.brian-chat-close svg {
  display: block;
}.brian-usage-summary {
  margin-top: 0px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 12px;
}

.brian-usage-heading {
  font-weight: 600;
  margin-bottom: 10px;
  opacity: 0.8;
}

.brian-usage-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
}

.brian-usage-row span:last-child {
  font-variant-numeric: tabular-nums;
  text-align: right;
  opacity: 0.8;
}.brian-chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.brian-chat-header,
.brian-usage-summary {
  flex-shrink: 0;
}

.brian-mic-active {
  background: rgba(80, 160, 255, 0.25);
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(80, 160, 255, 0.5);
}/* Brian voice activity */

@keyframes brian-listening-pulse {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(80, 160, 255, 0.4);
  }

  50% {
    box-shadow: 0 0 0 5px rgba(80, 160, 255, 0.12);
  }
}

@keyframes brian-speaking-pulse {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(120, 220, 180, 0.4);
  }

  50% {
    box-shadow: 0 0 0 5px rgba(120, 220, 180, 0.12);
  }
}

.brian-mic-listening {
  animation: brian-listening-pulse 1.5s ease-in-out infinite;
}

.brian-mic-speaking {
  animation: brian-speaking-pulse 1s ease-in-out infinite;
}

.brian-mic-thinking {
  opacity: 0.7;
}

@media (prefers-reduced-motion: reduce) {
  .brian-mic-listening,
  .brian-mic-speaking {
    animation: none;
  }
}/* Voice error notification */

.brian-voice-error {
  position: absolute;
  bottom: 65px;
  right: 12px;
  max-width: 280px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(90, 30, 35, 0.92);
  border: 1px solid rgba(255, 130, 130, 0.35);
  color: #ffe0e0;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  z-index: 100;
}
/* Manage Memory navigation */

.brian-manage-memory {
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  width: 100%;
  flex-shrink: 0;

  padding: 16px 0;
  margin: 0;

  background: transparent;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;

  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;

  transition: background 0.2s ease;
}

.brian-manage-memory:hover {
  background: rgba(255, 255, 255, 0.06);
}

.brian-manage-memory:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

.brian-memory-link-content {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-width: 0;
}

.brian-memory-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.8;
}

.brian-memory-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.brian-memory-label strong {
  font-size: 13px;
  font-weight: 600;
}

.brian-memory-label small {
  font-size: 11px;
  font-weight: 400;
  opacity: 0.6;
}

.brian-memory-chevron {
  font-size: 20px;
  opacity: 0.65;
  margin-left: 12px;
}
.brian-memory-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brian-memory-back {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.brian-memory-back:hover {
  background: rgba(255, 255, 255, 0.15);
}
/* Sliding Conversation History and Memory Manager */

.brian-panel-navigation {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.brian-panel-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.brian-panel-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.brian-panel-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.brian-panel-screen .brian-chat-header {
  padding-right: 42px;
  min-height: 64px;
  padding-bottom: 12px;
  margin-bottom: 20px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.brian-memory-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 0 12px;
}

.brian-memory-count {
  font-size: 12px;
  opacity: 0.65;
  margin: 4px 0 16px;
}

/* Memory Manager cards and actions */

.brian-memory-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  padding: 14px 16px;
  margin-bottom: 10px;
  border-radius: 12px;

  background: rgba(255, 255, 255, 0.07);
  font-size: 13px;
  line-height: 1.5;
}

.brian-memory-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.brian-memory-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.brian-memory-action {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 32px;
  height: 32px;
  padding: 0;

  border: none;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  opacity: 0.65;

  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.brian-memory-action:hover {
  background: rgba(255, 255, 255, 0.12);
  opacity: 1;
}

.brian-memory-action:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.brian-memory-delete:hover {
  color: #ff9999;
  background: rgba(255, 100, 100, 0.12);
}/* Inline memory editing */

.brian-memory-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.brian-memory-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 90px;
  padding: 12px;

  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.12);

  color: inherit;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}

.brian-memory-input:focus {
  outline: none;
  border-color: rgba(160, 200, 255, 0.75);
}

.brian-memory-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.brian-memory-cancel,
.brian-memory-save {
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.brian-memory-save {
  background: rgba(100, 160, 255, 0.25);
}

.brian-memory-cancel:hover,
.brian-memory-save:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
}

.brian-memory-save:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}/* Memory deletion confirmation */

.brian-memory-confirm {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-width: 0;
  font-size: 13px;
}

.brian-memory-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.brian-memory-confirm-delete {
  padding: 8px 16px;
  border: 1px solid #c83e46;
  border-radius: 8px;
  background: #c83e46;
  color: #ffffff;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.brian-memory-confirm-delete:hover {
  background: #e04b54;
  border-color: #e04b54;
}

.brian-memory-confirm-delete:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.brian-memory-confirm-delete:hover {
  background: rgba(255, 100, 100, 0.3);
}

/* ========================================
   BRIAN — TASK WORKSPACE
   ======================================== */

.brian-task-workspace {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  width: min(1100px, 88vw);
  height: min(760px, 82vh);

  display: flex;
  flex-direction: column;

  background: rgba(20, 30, 45, 0.55);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);

  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 24px;

  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);

  color: white;
  overflow: hidden;
  z-index: 200;
}

.brian-task-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 22px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brian-task-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
}

.brian-task-header button {
  width: 36px;
  height: 36px;

  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;

  background: rgba(255, 255, 255, 0.08);
  color: white;

  cursor: pointer;
}

.brian-task-header button:hover {
  background: rgba(255, 255, 255, 0.18);
}

.brian-task-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 28px;
}

@media (max-width: 700px) {
  .brian-task-workspace {
    width: 94vw;
    height: 85vh;
    border-radius: 18px;
  }

  .brian-task-header {
    padding: 16px 20px;
  }

  .brian-task-content {
    padding: 20px;
  }
}

/* Task Workspace tabs */

.brian-task-tabs {
  display: flex;
  gap: 8px;
  padding: 14px 24px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  overflow-x: auto;
}

.brian-task-tab {
  flex-shrink: 0;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 12px 12px 0 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.brian-task-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.brian-task-tab.is-active {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.18);
  border-bottom-color: transparent;
  color: white;
  font-weight: 600;
}

/* Create task button */

.brian-task-add {
  flex-shrink: 0;
  align-self: center;
  width: 32px;
  height: 32px;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;

}

.brian-task-add:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Task tab renaming */

.brian-task-rename-input {
  width: 150px;
  padding: 3px 6px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 5px;
  outline: none;
  background: rgba(0, 0, 0, 0.25);
  color: white;
  font: inherit;
}

/* TASK WORKSPACE — FIX TAB AND CLOSE BUTTON LAYOUT */

.brian-task-tab-wrapper {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  position: relative;
  border: 1px solid transparent;
  border-radius: 12px 12px 0 0;
  background: transparent;
  transition: background 0.2s;
}

.brian-task-tab-wrapper.is-active {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.18);
  border-bottom-color: transparent;
}

.brian-task-tab-wrapper .brian-task-tab {
  display: flex;
  align-items: center;
  padding: 12px 8px 12px 18px;
  border: none;
  border-radius: 0;
  background: transparent;
  font-weight: 400;
}

.brian-task-tab-wrapper .brian-task-tab.is-active {
  background: transparent;
  border: none;
  font-weight: 600;
}

.brian-task-tab-wrapper .brian-task-tab-close {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  margin: 0 10px 0 0;
  padding: 0;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s, color 0.2s;
}

.brian-task-tab-wrapper:hover .brian-task-tab-close,
.brian-task-tab-wrapper.is-active .brian-task-tab-close,
.brian-task-tab-close:focus-visible {
  opacity: 1;
}

.brian-task-tab-wrapper .brian-task-tab-close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: white;
}

/* TASK WORKSPACE — OVERFLOW DROPDOWN */

.brian-task-tabs {
  position: relative;
  overflow: visible;
}

.brian-task-overflow {
  position: relative;
  flex-shrink: 0;
  align-self: center;
  margin-bottom: 8px;
}

.brian-task-overflow-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  cursor: pointer;
}

.brian-task-overflow-button:hover {
  background: rgba(255, 255, 255, 0.18);
}

.brian-task-overflow-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 500;
  width: 260px;
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  background: rgba(25, 35, 50, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.brian-task-overflow-heading {
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  font-weight: 600;
}

.brian-task-overflow-item {
  display: block;
  width: 100%;
  padding: 11px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  text-align: left;
  font-size: 14px;
  cursor: pointer;
}

.brian-task-overflow-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.brian-task-overflow-item.is-active {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-weight: 600;
}

/* TASK WORKSPACE — FIXED CONTROLS AND SCROLLABLE TAB AREA */

.brian-task-tabs {
  display: flex;
  align-items: stretch;
  gap: 8px;
  overflow: visible;
}

.brian-task-tabs-scroll {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.brian-task-tabs-scroll::-webkit-scrollbar {
  display: none;
}

.brian-task-overflow,
.brian-task-add {
  flex-shrink: 0;
}

/* TASK WORKSPACE — MOBILE LAYOUT */

@media (max-width: 700px) {
  .brian-task-workspace {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .brian-task-header {
    padding: 18px 16px;
  }

  .brian-task-header h2 {
    font-size: 18px;
  }

  .brian-task-tabs {
    padding: 10px 12px 0;
    gap: 6px;
  }

  .brian-task-tabs-scroll {
    gap: 6px;
  }

  .brian-task-tab-wrapper .brian-task-tab {
    padding: 10px 6px 10px 12px;
    font-size: 13px;
  }

  .brian-task-tab-wrapper .brian-task-tab-close {
    opacity: 1;
    width: 30px;
    height: 30px;
    margin-right: 4px;
  }

  .brian-task-overflow-button,
  .brian-task-add {
    width: 36px;
    height: 36px;
  }

  .brian-task-content {
    padding: 18px 16px;
    overflow-y: auto;
  }

  .brian-task-overflow-menu {
    width: min(280px, 85vw);
    max-height: 50dvh;
  }
}

/* TASK PLANNER — SECTION LAYOUT */

.brian-task-planner-intro {
  margin-bottom: 28px;
}

.brian-task-planner-intro h3 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 500;
  color: white;
}

.brian-task-planner-intro p {
  margin: 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 14px;
  line-height: 1.6;
}

.brian-task-planner-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.brian-task-planner-sections section {
  min-height: 150px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
  transition: background 0.2s, border-color 0.2s;
}

.brian-task-planner-sections section:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.25);
}

.brian-task-planner-sections h4 {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 500;
  color: white;
}

.brian-task-planner-sections section p {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  line-height: 1.6;
}

/* TASK PLANNER — MOBILE */

@media (max-width: 700px) {
  .brian-task-planner-intro {
    margin-bottom: 20px;
  }

  .brian-task-planner-intro h3 {
    font-size: 21px;
  }

  .brian-task-planner-sections {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .brian-task-planner-sections section {
    min-height: 110px;
    padding: 18px;
  }
}

/* TASK PLANNER — LOCATIONS */

.brian-planner-location-list {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.brian-planner-location-list li {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
}

.brian-planner-location-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brian-planner-location-form input {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.16);
  color: white;
  font-size: 14px;
  outline: none;
}

.brian-planner-location-form input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.brian-planner-location-form input:focus {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.24);
}

.brian-planner-location-form button {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 22px;
  font-weight: 300;
  cursor: pointer;
}

.brian-planner-location-form button:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Consistent SVG alignment for planner add buttons */

.brian-planner-location-form button svg {
  display: block;
  flex-shrink: 0;
}

/* TASK PLANNER — REMOVE LOCATION */

.brian-planner-location-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brian-planner-location-list li span {
  flex: 1;
  min-width: 0;
}

.brian-planner-location-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s, color 0.2s;
}

.brian-planner-location-remove svg {
  display: block;
}

.brian-planner-location-list li:hover .brian-planner-location-remove,
.brian-planner-location-remove:focus-visible {
  opacity: 1;
}

.brian-planner-location-remove:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

/* Keep removal buttons accessible on touchscreens */

@media (hover: none) {
  .brian-planner-location-remove {
    opacity: 1;
    width: 36px;
    height: 36px;
  }
}

/* TASK PLANNER — EDIT LOCATION */

.brian-planner-location-edit {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 6px;
  outline: none;
  background: rgba(0, 0, 0, 0.25);
  color: white;
  font: inherit;
  font-size: 14px;
}

.brian-planner-location-list li span {
  cursor: text;
}

/* TASK PLANNER — EDIT LOCATION BUTTON */

.brian-planner-location-edit-button {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s, color 0.2s;
}

.brian-planner-location-edit-button svg {
  display: block;
}

.brian-planner-location-list li:hover .brian-planner-location-edit-button,
.brian-planner-location-edit-button:focus-visible {
  opacity: 1;
}

.brian-planner-location-edit-button:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

/* Always show editing controls on touchscreens */

@media (hover: none) {
  .brian-planner-location-edit-button {
    opacity: 1;
    width: 36px;
    height: 36px;
  }
}

/* TASK PLANNER — OVERVIEW NAVIGATION */

.brian-planner-overview-card {
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.brian-planner-overview-card:hover,
.brian-planner-overview-card:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  outline: none;
}

.brian-planner-card-action {
  display: inline-block;
  margin-top: 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
}

.brian-planner-detail-view {
  grid-column: 1 / -1;
  min-width: 0;
}

.brian-planner-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.brian-planner-back:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

/* TASK PLANNER — STORIES */

.brian-planner-stories-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.brian-planner-stories-header h4 {
  margin-top: 0;
}

.brian-planner-story-add {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  cursor: pointer;
}

.brian-planner-story-add:hover {
  background: rgba(255, 255, 255, 0.18);
}

.brian-planner-story-add svg {
  display: block;
}

.brian-planner-story-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.brian-planner-story-list li {
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
}

.brian-planner-stories-empty {
  opacity: 0.65;
}

/* TASK PLANNER — STORY EDITOR */

.brian-planner-story-editor {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.brian-planner-story-title-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.07);
  color: white;
  font: inherit;
  font-size: 22px;
  font-weight: 600;
  outline: none;
}

.brian-planner-story-content-input {
  width: 100%;
  min-height: 360px;
  box-sizing: border-box;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  color: white;
  font: inherit;
  font-size: 15px;
  line-height: 1.7;
  resize: vertical;
  outline: none;
}

.brian-planner-story-title-input:focus,
.brian-planner-story-content-input:focus {
  border-color: rgba(255, 255, 255, 0.45);
}

.brian-planner-story-save-status {
  margin: 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.brian-planner-story-open {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.brian-planner-story-open:hover {
  color: white;
}

/* TASK PLANNER — DELETE STORY */

.brian-planner-story-list li {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brian-planner-story-open {
  flex: 1;
  min-width: 0;
}

.brian-planner-story-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s, color 0.2s;
}

.brian-planner-story-remove svg {
  display: block;
}

.brian-planner-story-list li:hover .brian-planner-story-remove,
.brian-planner-story-remove:focus-visible {
  opacity: 1;
}

.brian-planner-story-remove:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

@media (hover: none) {
  .brian-planner-story-remove {
    opacity: 1;
    width: 36px;
    height: 36px;
  }
}

/* Compact Task Workspace shortcut */
.brian-greeting-row { display: flex; align-items: center; gap: 14px; }
.brian-task-count-button {
  appearance: none;
  border: 1px solid rgba(255,255,255,.32);
  background: rgba(255,255,255,.13);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 999px;
  padding: 7px 13px;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.brian-task-count-button:hover { background: rgba(255,255,255,.24); }
.brian-task-count-button:focus-visible { outline: 2px solid white; outline-offset: 3px; }
@media (max-width: 700px) {
  .brian-mobile-clock-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 16px 32px;
  }
  .brian-mobile-clock-row .brian-clock { margin: 0 !important; }
}

/* Task counter states — grey when empty, Living Glass blue when active */
.brian-task-count-button.no-tasks {
  background: linear-gradient(145deg, rgba(118, 130, 143, .34), rgba(55, 66, 77, .32));
  border-color: rgba(211, 220, 229, .28);
  color: #e0e5ea;
}
.brian-task-count-button.has-tasks {
  background: linear-gradient(145deg, rgba(62, 147, 235, .72), rgba(22, 86, 168, .75));
  border-color: rgba(154, 209, 255, .62);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.24), 0 3px 14px rgba(15, 85, 170, .18);
}
.brian-task-count-button.no-tasks:hover {
  background: linear-gradient(145deg, rgba(138, 151, 164, .43), rgba(72, 85, 98, .44));
}
.brian-task-count-button.has-tasks:hover {
  background: linear-gradient(145deg, rgba(82, 168, 252, .88), rgba(36, 112, 202, .88));
  border-color: rgba(192, 228, 255, .8);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 4px 18px rgba(35, 116, 213, .28);
}


/* Brian Task Planner — visual Living Glass overview */
.brian-task-planner-sections > .brian-planner-overview-card { min-height: 252px; display:flex; flex-direction:column; overflow:hidden; position:relative; padding:18px 20px; background:linear-gradient(145deg,rgba(255,255,255,.13),rgba(255,255,255,.045) 55%,rgba(8,28,49,.17)); border:1px solid rgba(255,255,255,.23); box-shadow:inset 0 1px rgba(255,255,255,.23),0 12px 26px rgba(0,0,0,.09); }
.brian-task-planner-sections > .brian-planner-overview-card:hover,.brian-task-planner-sections > .brian-planner-overview-card:focus-visible {background:linear-gradient(145deg,rgba(255,255,255,.19),rgba(255,255,255,.07)); border-color:rgba(190,222,255,.58); transform:translateY(-2px); outline:2px solid transparent;}
.brian-planner-card-heading {display:flex;align-items:center;gap:10px;}
.brian-task-planner-sections .brian-planner-card-heading h4 {margin:0;font-size:17px;font-weight:600;}
.brian-planner-card-icon {display:grid;place-items:center;width:35px;height:35px;border-radius:12px;background:rgba(115,186,255,.19);border:1px solid rgba(180,220,255,.28);color:#c9e8ff;font-size:23px;line-height:1;}
.brian-planner-card-chevron {margin-left:auto;color:rgba(255,255,255,.65);font-size:19px;}
.brian-planner-card-footer {margin-top:auto;padding-top:12px;display:flex;justify-content:space-between;gap:8px;align-items:center;color:rgba(255,255,255,.69);font-size:12px;}
.brian-planner-card-footer span:last-child {color:#b9ddff;white-space:nowrap;}
.brian-planner-polaroids {height:142px;position:relative;margin-top:12px;}
.brian-planner-polaroid {position:absolute;width:43%;height:103px;background:#f5f6f3;padding:5px 5px 20px;border-radius:3px;box-shadow:0 6px 13px rgba(0,0,0,.32);transform-origin:center;}
.brian-planner-polaroid-1 {left:4%;top:15px;transform:rotate(-10deg);z-index:2;}
.brian-planner-polaroid-2 {left:29%;top:2px;transform:rotate(6deg);z-index:3;}
.brian-planner-polaroid-3 {left:52%;top:25px;transform:rotate(-5deg);z-index:4;}
.brian-planner-polaroid-4 {left:40%;top:36px;transform:rotate(12deg);z-index:5;}
.brian-planner-polaroid-art {height:100%;display:grid;place-items:center;background:linear-gradient(160deg,#a7c5ce 0%,#7899a5 46%,#3b6676 47%,#244c59 70%,#193744 100%);color:rgba(255,255,255,.8);font-size:30px;}
.brian-planner-polaroid:nth-child(2) .brian-planner-polaroid-art {background:linear-gradient(150deg,#d1c3ad,#879da0 45%,#486b6c 46%,#284f5e);}
.brian-planner-polaroid:nth-child(3) .brian-planner-polaroid-art {background:linear-gradient(160deg,#c5d4dc,#879cb2 52%,#476577 53%,#264252);}
.brian-planner-polaroid:nth-child(4) .brian-planner-polaroid-art {background:linear-gradient(145deg,#c7c1b3,#9ca8a0 45%,#637e72 46%,#294c4d);}
.brian-planner-polaroid-label {display:block;color:#273442;font-size:8px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;text-align:center;line-height:17px;font-weight:600;}
.brian-planner-collage-empty {height:110px;display:grid;place-items:center;text-align:center;color:rgba(255,255,255,.55);font-size:13px;border:1px dashed rgba(255,255,255,.2);border-radius:12px;}
.brian-planner-story-preview {flex:1;min-height:130px;display:grid;place-items:center;perspective:500px;padding:8px 0;}
.brian-planner-story-paper {width:75%;height:114px;display:flex;flex-direction:column;gap:8px;padding:15px;background:linear-gradient(130deg,#efe5d4,#d5c5ad);color:#39414a;transform:rotate(-4deg);box-shadow:5px 8px 18px rgba(0,0,0,.24);border-radius:2px;}
.brian-planner-story-paper-mark {font-size:19px;color:#6c7b86;}
.brian-planner-story-paper-title {font:600 13px Georgia,serif;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.brian-planner-story-paper-lines {height:24px;background:repeating-linear-gradient(to bottom,transparent 0,transparent 7px,rgba(64,67,65,.24) 8px,transparent 9px);}
.brian-planner-route-preview {height:90px;display:flex;align-items:center;justify-content:center;padding:10px 18px;}
.brian-planner-route-dot {height:17px;width:17px;border:4px solid #a4d8ff;border-radius:50%;background:#245e86;box-shadow:0 0 0 5px rgba(104,185,244,.12);flex-shrink:0;}
.brian-planner-route-line {height:0;border-top:2px dashed rgba(166,215,252,.75);flex:1;transform:rotate(-8deg);}
.brian-planner-route-line:nth-of-type(4) {transform:rotate(8deg);}
.brian-planner-notes-preview {height:85px;display:flex;flex-direction:column;gap:10px;justify-content:center;padding:16px 18px;margin:9px 4px 0;border-left:3px solid rgba(165,211,246,.55);background:rgba(255,255,255,.055);border-radius:4px 10px 10px 4px;transform:rotate(-2deg);}
.brian-planner-notes-preview span {height:2px;background:rgba(215,231,243,.35);border-radius:4px;}
.brian-planner-notes-preview span:nth-child(2) {width:85%;}.brian-planner-notes-preview span:nth-child(3) {width:94%;}.brian-planner-notes-preview span:nth-child(4) {width:58%;}
@media(max-width:700px) {.brian-task-planner-sections > .brian-planner-overview-card {min-height:215px;}.brian-planner-polaroids {height:125px;}.brian-planner-polaroid {width:35%;}}
@media(prefers-reduced-motion:reduce) {.brian-task-planner-sections > .brian-planner-overview-card:hover {transform:none;}}


/* Task Workspace — content-sized desktop modal, with room for the voice dock.
   The 2×2 overview fits naturally; longer sections scroll when needed. */
@media (min-width: 701px) {
  .brian-task-workspace {
    top: calc(50% - 42px);
    height: auto;
    max-height: calc(100dvh - 150px);
  }
  .brian-task-content {
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* Brian mobile scrolling and fixed conversation dock clearance */
@media (max-width: 700px) {
  /* Allow normal vertical scrolling when touching widgets */
  .brian-widget {
    touch-action: pan-y !important;
  }

  /* Keep deliberate reordering limited to the drag handle */
  .mobile-drag-handle {
    touch-action: none;
  }

  /* Leave room beneath the final widget for Brian's input box */
  .brian-environment {
    padding-bottom: calc(160px + env(safe-area-inset-bottom, 0px)) !important;
  }
}
