/* =========================================================================
   Mr. F's English Coach — visual redesign
   Aesthetic: warm scholarly conversation. Deep slate-teal atmosphere with
   warm cream cards, rich teal + amber-gold accents, Fraunces display serif
   paired with Plus Jakarta Sans body. The chat zone is the visual anchor.
   ========================================================================= */

:root {
  color-scheme: light;

  /* Surfaces */
  --bg-base:        #0f2330;
  --bg-warm:        #14334a;
  --surface:        #faf3e1;
  --surface-raised: #fffaeb;
  --surface-sunk:   #f1e7c9;
  --surface-tint:   #f5ecd2;

  /* Ink */
  --ink:        #1b2733;
  --ink-soft:   #485361;
  --ink-muted:  #6a7280;
  --ink-faint:  #9aa3ad;
  --on-dark:    #f5eacf;
  --on-dark-muted: #c4b896;

  /* Accents */
  --teal:       #1f5e75;
  --teal-deep:  #0d3f52;
  --teal-soft:  #cfe2e8;
  --teal-line:  #94bcc8;

  --gold:       #c89a3e;
  --gold-deep:  #a07a23;
  --gold-soft:  #f0d99a;
  --gold-tint:  #f9eecb;

  --coral:      #c46d52;
  --coral-deep: #9a4f37;
  --coral-soft: #f3cdbf;

  --sage:       #5a8463;

  /* Geometry */
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-soft: 0 8px 24px rgba(7, 18, 28, 0.22);
  --shadow-card: 0 18px 48px -12px rgba(7, 18, 28, 0.38),
                 0 2px 6px rgba(7, 18, 28, 0.10);
  --shadow-lift: 0 26px 60px -20px rgba(7, 18, 28, 0.55);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.5);

  /* Type */
  --font-display: "Fraunces", "Iowan Old Style", "Source Serif Pro",
                  Georgia, "Times New Roman", serif;
  --font-body:    "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont,
                  "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ------- Reset / base ------- */

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--on-dark);
  background-color: var(--bg-base);
  background-image:
    radial-gradient(ellipse 900px 600px at 12% -10%,
      rgba(200, 154, 62, 0.18), transparent 60%),
    radial-gradient(ellipse 1100px 700px at 92% 110%,
      rgba(31, 94, 117, 0.40), transparent 65%),
    radial-gradient(ellipse 1400px 800px at 50% 50%,
      rgba(20, 51, 74, 0.55), transparent 70%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle film grain over the dark atmosphere — gives depth */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.4 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

img { display: block; max-width: 100%; }

button { font: inherit; cursor: pointer; }

a { color: var(--gold-soft); }

::selection {
  background: var(--gold);
  color: var(--bg-base);
}

/* ------- Layout shell ------- */

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1140px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
  display: grid;
  gap: 22px;
}

/* ------- Typography ------- */

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 700;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  letter-spacing: -0.01em;
  margin: 0;
  color: inherit;
}

.eyebrow,
.section-kicker {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 10px;
  color: var(--teal);
}

.eyebrow {
  color: var(--gold-soft);
}

/* ------- Topbar ------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 22px;
  border-radius: var(--radius-pill);
  background: rgba(20, 35, 50, 0.55);
  border: 1px solid rgba(245, 234, 207, 0.10);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 14px;
  background:
    linear-gradient(140deg, var(--teal) 0%, var(--teal-deep) 100%);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-soft), var(--shadow-inset);
  position: relative;
}

.brand-mark svg { width: 100%; height: 100%; }

.brand-text { line-height: 1.15; }

.brand-label {
  display: inline-block;
  margin: 0 0 2px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-soft);
}

.brand-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.005em;
  color: var(--on-dark);
}

.brand-tagline {
  margin: 0;
  color: var(--on-dark-muted);
  font-size: 0.88rem;
  font-weight: 500;
}

/* ------- Hero ------- */

.hero {
  padding: 8px 4px 4px;
}

.hero .eyebrow { color: var(--gold-soft); }

.hero h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.6rem);
  line-height: 1.02;
  font-weight: 800;
  color: var(--on-dark);
  margin: 0 0 14px;
  max-width: 22ch;
}

.hero h1 em {
  font-style: italic;
  font-weight: 600;
  color: var(--gold-soft);
  font-variation-settings: "opsz" 144, "SOFT" 100;
}

.hero .intro {
  color: var(--on-dark-muted);
  font-size: 1.05rem;
  max-width: 60ch;
  margin: 0;
  line-height: 1.6;
}

/* ------- Generic "warm paper" card ------- */

.task-card-panel,
.focus-card,
.responsible-card,
.agreement-card,
.chat-zone {
  background: var(--surface);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-xl);
  padding: 26px;
  box-shadow: var(--shadow-card);
  position: relative;
  color: var(--ink);
}

/* Subtle paper texture on the warm cards */
.task-card-panel::before,
.focus-card::before,
.responsible-card::before,
.agreement-card::before,
.chat-zone::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='2'/><feColorMatrix values='0 0 0 0 0.3  0 0 0 0 0.25  0 0 0 0 0.18  0 0 0 0.05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.7;
  mix-blend-mode: multiply;
}

/* Make sure card content sits above the texture */
.task-card-panel > *,
.focus-card > *,
.responsible-card > *,
.agreement-card > *,
.chat-zone > * { position: relative; }

.task-card-panel h2,
.focus-card h2,
.responsible-card h2 {
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--teal-deep);
}

/* ------- ESL dashboard layout ------- */

.esl-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.9fr);
  gap: 22px;
}

/* ------- Task cards ------- */

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

.task-card {
  position: relative;
  width: 100%;
  min-height: 132px;
  text-align: left;
  color: var(--ink);
  background: var(--surface-raised);
  border: 1px solid rgba(20, 51, 74, 0.10);
  border-radius: var(--radius-lg);
  padding: 16px 18px 16px 76px;
  cursor: pointer;
  transition:
    transform 200ms cubic-bezier(.2, .8, .25, 1),
    box-shadow 200ms ease,
    border-color 200ms ease,
    background 200ms ease;
  outline-offset: 3px;
}

.task-card:hover,
.task-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--teal);
  background: #fffdf2;
  box-shadow: 0 14px 34px -16px rgba(20, 51, 74, 0.45);
}

.task-card:focus-visible {
  outline: 2px solid var(--teal);
}

.task-icon {
  position: absolute;
  left: 16px;
  top: 16px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--surface-raised);
  background: linear-gradient(140deg, var(--teal) 0%, var(--teal-deep) 100%);
  box-shadow: var(--shadow-inset), 0 4px 10px rgba(13, 63, 82, 0.35);
  letter-spacing: 0;
}

/* Vary the icon hues per task for visual rhythm */
.task-card:nth-child(2) .task-icon {
  background: linear-gradient(140deg, #2f7587 0%, #155469 100%);
}
.task-card:nth-child(3) .task-icon {
  background: linear-gradient(140deg, var(--gold) 0%, var(--gold-deep) 100%);
  box-shadow: var(--shadow-inset), 0 4px 10px rgba(160, 122, 35, 0.35);
}
.task-card:nth-child(4) .task-icon {
  background: linear-gradient(140deg, #3a8095 0%, #1c5c70 100%);
}
.task-card:nth-child(5) .task-icon {
  background: linear-gradient(140deg, var(--coral) 0%, var(--coral-deep) 100%);
  box-shadow: var(--shadow-inset), 0 4px 10px rgba(154, 79, 55, 0.35);
}
.task-card:nth-child(6) .task-icon {
  background: linear-gradient(140deg, #4a8a72 0%, #2c6450 100%);
}

.task-title {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--teal-deep);
  margin-bottom: 6px;
  letter-spacing: -0.005em;
}

.task-desc {
  display: block;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.92rem;
  line-height: 1.45;
}

/* ------- Focus card ------- */

.focus-card {
  background:
    linear-gradient(180deg, var(--surface-raised) 0%, var(--surface) 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.focus-card .section-kicker { color: var(--gold-deep); }

.focus-card > p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.96rem;
}

.focus-list {
  margin: 4px 0 8px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.focus-list li {
  position: relative;
  padding-left: 22px;
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.focus-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 154, 62, 0.22);
}

.focus-list strong {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--teal-deep);
  margin-right: 4px;
}

.focus-practice {
  width: 100%;
  min-height: 52px;
  margin-top: auto;
  border: 0;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  color: var(--bg-base);
  background: linear-gradient(140deg, var(--gold-soft) 0%, var(--gold) 100%);
  box-shadow: var(--shadow-inset), 0 8px 22px -8px rgba(160, 122, 35, 0.55);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.focus-practice:hover,
.focus-practice:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.04);
  box-shadow: var(--shadow-inset), 0 14px 30px -10px rgba(160, 122, 35, 0.7);
  outline: none;
}

/* ------- Responsible use ------- */

.responsible-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 22px;
  margin-bottom: 16px;
}

.responsible-header h2 { color: var(--coral-deep); }

.warning-kicker { color: var(--coral-deep); }

.responsible-header p {
  margin: 0;
  color: var(--ink-soft);
  max-width: 56ch;
}

.jump-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-pill);
  background: var(--teal-deep);
  color: var(--surface-raised);
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  transition: background 180ms ease, transform 180ms ease;
}

.jump-link:hover {
  background: var(--teal);
  transform: translateY(-1px);
}

.mini-guidance {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

details {
  background: var(--surface-sunk);
  border: 1px solid rgba(20, 51, 74, 0.10);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  transition: background 180ms ease;
}

details[open] { background: var(--surface-raised); }

summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--teal-deep);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

summary::-webkit-details-marker { display: none; }

summary::after {
  content: "+";
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--teal);
  transition: transform 200ms ease;
  line-height: 1;
}

details[open] summary::after { transform: rotate(45deg); }

details p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.5;
}

details strong { color: var(--teal-deep); }

/* ------- Agreement ------- */

.agreement-card { padding: 18px 24px; }

.agreement-label {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.45;
  cursor: pointer;
  font-size: 0.98rem;
}

.agreement-label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 6px;
  border: 2px solid var(--teal);
  background: var(--surface-raised);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}

.agreement-label input[type="checkbox"]:focus-visible {
  outline: 3px solid var(--gold-soft);
  outline-offset: 2px;
}

.agreement-label input[type="checkbox"]:checked {
  background: var(--teal);
  border-color: var(--teal);
}

.agreement-label input[type="checkbox"]:checked::after {
  content: "";
  width: 6px;
  height: 11px;
  border: solid var(--surface-raised);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

/* ------- Chat zone — the main attraction ------- */

.chat-zone {
  padding: 0;
  background:
    linear-gradient(180deg,
      var(--surface-raised) 0%,
      var(--surface) 70%,
      var(--surface-tint) 100%);
  overflow: hidden;
  border-radius: var(--radius-xl);
  scroll-margin-top: 22px;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 26px 28px 22px;
  border-bottom: 1px solid rgba(20, 51, 74, 0.10);
  background:
    linear-gradient(180deg,
      rgba(255, 250, 235, 0.6) 0%,
      rgba(250, 243, 225, 0) 100%);
}

.avatar-stack {
  position: relative;
  flex: 0 0 auto;
  width: 110px;
  height: 110px;
}

.avatar-halo {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(
    from 90deg,
    var(--teal) 0deg,
    var(--gold) 120deg,
    var(--teal) 240deg,
    var(--teal-deep) 360deg);
  filter: blur(2px);
  opacity: 0.75;
  animation: halo-rotate 16s linear infinite;
}

.avatar-halo::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--surface-raised);
}

.chat-avatar {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--surface-raised);
  box-shadow:
    0 8px 22px rgba(13, 63, 82, 0.28),
    0 1px 0 rgba(255, 255, 255, 0.6) inset;
  background: #fff;
  animation: avatar-breathe 6s ease-in-out infinite;
}

.status-dot {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--sage);
  border: 3px solid var(--surface-raised);
  box-shadow: 0 0 0 0 rgba(90, 132, 99, 0.6);
  animation: status-pulse 2.4s ease-out infinite;
  z-index: 1;
}

.chat-header-text { flex: 1; }

.chat-eyebrow {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.chat-name {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: var(--teal-deep);
  line-height: 1;
}

.chat-name em {
  font-style: italic;
  font-weight: 500;
  color: var(--gold-deep);
  font-variation-settings: "opsz" 144, "SOFT" 100;
}

.chat-status-line {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: rgba(90, 132, 99, 0.12);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.85rem;
}

.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 3px rgba(90, 132, 99, 0.22);
}

.status-pill[data-state="busy"] {
  background: rgba(200, 154, 62, 0.16);
  color: var(--gold-deep);
}

.status-pill[data-state="busy"]::before {
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 154, 62, 0.22);
}

.status-pill[data-state="error"] {
  background: rgba(196, 109, 82, 0.18);
  color: var(--coral-deep);
}

.status-pill[data-state="error"]::before {
  background: var(--coral);
  box-shadow: 0 0 0 3px rgba(196, 109, 82, 0.25);
}

/* Chat scroll area */

.chat {
  height: min(58vh, 560px);
  min-height: 320px;
  overflow-y: auto;
  padding: 22px 26px 16px;
  scroll-behavior: smooth;
  /* Leaves room for the chat-header (avatar) when scrollIntoView lands here */
  scroll-margin-top: 180px;
  background:
    radial-gradient(ellipse 600px 200px at 50% 0%,
      rgba(31, 94, 117, 0.05), transparent 70%);
}

/* Empty-state placeholder for the chat */
.chat:empty::before {
  content: "Say hi or choose a task above. I'm here to help with grammar, vocabulary, and academic writing.";
  display: block;
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-faint);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.02rem;
  max-width: 36ch;
  margin: 0 auto;
  line-height: 1.5;
}

/* Custom scrollbar */
.chat::-webkit-scrollbar { width: 10px; }
.chat::-webkit-scrollbar-track { background: transparent; }
.chat::-webkit-scrollbar-thumb {
  background: rgba(20, 51, 74, 0.18);
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  background-clip: padding-box;
}
.chat::-webkit-scrollbar-thumb:hover { background-color: rgba(20, 51, 74, 0.32); }

/* Message bubbles */

.message {
  max-width: 78%;
  margin: 0 0 14px;
  padding: 13px 17px;
  border-radius: 18px;
  line-height: 1.55;
  font-size: 0.97rem;
  animation: message-pop 280ms cubic-bezier(.2, .8, .25, 1) both;
  position: relative;
}

.message strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 4px;
  opacity: 0.7;
}

.message p {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.message.assistant,
.message.thinking {
  background: linear-gradient(180deg, #fffdf2 0%, #f7eed6 100%);
  border: 1px solid rgba(20, 51, 74, 0.10);
  border-top-left-radius: 6px;
  color: var(--ink);
  box-shadow: 0 4px 12px -6px rgba(13, 63, 82, 0.2);
}

.message.assistant strong,
.message.thinking strong { color: var(--teal-deep); }

.message.user {
  margin-left: auto;
  background:
    linear-gradient(180deg, var(--teal) 0%, var(--teal-deep) 100%);
  color: var(--surface-raised);
  border-top-right-radius: 6px;
  box-shadow: 0 4px 14px -4px rgba(13, 63, 82, 0.45);
}

.message.user strong { color: var(--gold-soft); }

.message.thinking p {
  font-style: italic;
  color: var(--teal);
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}

/* ------- Composer ------- */

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: stretch;
  padding: 18px 26px 24px;
  background:
    linear-gradient(180deg,
      rgba(245, 236, 210, 0) 0%,
      rgba(245, 236, 210, 0.85) 30%,
      var(--surface-tint) 100%);
  border-top: 1px solid rgba(20, 51, 74, 0.08);
}

textarea#messageInput {
  width: 100%;
  resize: vertical;
  border: 1.5px solid rgba(20, 51, 74, 0.16);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font: inherit;
  font-size: 1rem;
  min-height: 96px;
  background: var(--surface-raised);
  color: var(--ink);
  transition: border-color 180ms ease, box-shadow 180ms ease;
  line-height: 1.5;
}

textarea#messageInput::placeholder {
  color: var(--ink-faint);
  font-style: italic;
}

textarea#messageInput:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow:
    0 0 0 4px rgba(31, 94, 117, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.composer-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 140px;
}

#sendBtn,
#clearChatBtn {
  border: 0;
  border-radius: var(--radius-md);
  padding: 0 22px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  min-height: 46px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease,
              background 160ms ease, filter 160ms ease;
}

#sendBtn {
  color: var(--surface-raised);
  background: linear-gradient(140deg, var(--teal) 0%, var(--teal-deep) 100%);
  box-shadow:
    var(--shadow-inset),
    0 8px 20px -6px rgba(13, 63, 82, 0.55);
  flex: 1;
}

#sendBtn:hover:not(:disabled),
#sendBtn:focus-visible:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow:
    var(--shadow-inset),
    0 14px 28px -8px rgba(13, 63, 82, 0.6);
  outline: none;
}

#sendBtn:disabled {
  background: #b6bcc4;
  color: #f5f5f5;
  cursor: not-allowed;
  box-shadow: none;
}

#clearChatBtn {
  background: transparent;
  color: var(--teal-deep);
  border: 1.5px solid rgba(20, 51, 74, 0.18);
}

#clearChatBtn:hover {
  background: rgba(20, 51, 74, 0.06);
  border-color: var(--teal);
}

.locked-hint {
  margin: 0;
  padding: 14px 26px 22px;
  color: var(--coral-deep);
  font-weight: 700;
  font-size: 0.92rem;
  text-align: center;
  background: rgba(196, 109, 82, 0.08);
  border-top: 1px solid rgba(196, 109, 82, 0.18);
}

/* ------- Footer ------- */

.site-footer {
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  background: rgba(20, 35, 50, 0.50);
  border: 1px solid rgba(245, 234, 207, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--on-dark-muted);
  font-size: 0.88rem;
  line-height: 1.5;
  display: grid;
  gap: 10px;
}

.footer-note { margin: 0; }

.site-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  margin: 0;
}

.site-links span {
  font-weight: 700;
  color: var(--on-dark);
}

.site-links a {
  color: var(--gold-soft);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(240, 217, 154, 0.30);
  padding-bottom: 1px;
  transition: color 180ms ease, border-color 180ms ease;
}

.site-links a:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* ------- Animations ------- */

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

@keyframes status-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(90, 132, 99, 0.55); }
  70%  { box-shadow: 0 0 0 12px rgba(90, 132, 99, 0); }
  100% { box-shadow: 0 0 0 0 rgba(90, 132, 99, 0); }
}

@keyframes avatar-breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.018); }
}

@keyframes halo-rotate {
  to { transform: rotate(360deg); }
}

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

/* ------- Responsive ------- */

@media (max-width: 960px) {
  .esl-dashboard { grid-template-columns: 1fr; }
  .mini-guidance { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .page-shell { padding-top: 18px; gap: 16px; }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    border-radius: var(--radius-xl);
    padding: 16px 18px;
    gap: 8px;
  }
  .brand-tagline { font-size: 0.82rem; }
  .hero h1 { font-size: clamp(1.7rem, 7vw, 2.4rem); }
  .task-card-panel,
  .focus-card,
  .responsible-card { padding: 22px; }
  .task-grid { grid-template-columns: 1fr; }
  .responsible-header { flex-direction: column; gap: 12px; }
  .chat-header {
    flex-direction: column;
    text-align: center;
    align-items: center;
    padding: 24px 22px 20px;
    gap: 16px;
  }
  .chat { padding: 18px 18px 12px; height: min(62vh, 480px); }
  .composer {
    grid-template-columns: 1fr;
    padding: 16px 18px 22px;
  }
  .composer-actions { flex-direction: row; min-width: 0; }
  .composer-actions #sendBtn,
  .composer-actions #clearChatBtn { flex: 1; }
  .message { max-width: 92%; }
  .avatar-stack { width: 96px; height: 96px; }
}
