:root {
  --bg: #ecf2ff;
  --card: #ffffff;
  --text: #172033;
  --accent: #1057e0;
  --accent-2: #12b5a6;
  --danger: #c62828;
  --border: #d6dfef;
  --muted: #5d6b81;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", Tahoma, sans-serif;
  background:
    radial-gradient(1200px 800px at 15% -10%, #c6deff 0%, rgba(198, 222, 255, 0) 60%),
    radial-gradient(1000px 700px at 95% 5%, #cffff7 0%, rgba(207, 255, 247, 0) 55%),
    var(--bg);
  color: var(--text);
}

.container {
  width: min(940px, 94vw);
  margin: 2rem auto 3rem;
}

h1 {
  margin: 0;
  letter-spacing: -0.02em;
}

.subtitle {
  margin-top: 0.35rem;
  margin-bottom: 0.75rem;
  color: var(--muted);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  box-shadow: 0 8px 24px rgba(16, 31, 64, 0.06);
}

#notegen-form.card {
  padding-left: 0.78rem;
  padding-right: 0.78rem;
}

.hero {
  border-color: #cad7f3;
  background:
    radial-gradient(800px 300px at 10% -30%, #dce8ff 0%, rgba(220, 232, 255, 0) 70%),
    linear-gradient(160deg, #fcfdff 0%, #f6f9ff 65%, #eef5ff 100%);
}

.hero h1 {
  font-size: clamp(1.55rem, 2.3vw, 2rem);
  margin-top: 0.15rem;
}

.session-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.session-title {
  margin: 0 0 0.2rem;
}

#session-plan {
  margin: 0;
}

#session-upgrade-hint {
  margin: 0.25rem 0 0;
}

.session-inline-link {
  appearance: none;
  border: none;
  background: transparent;
  color: #1f4ea1;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  padding: 0;
}

.session-inline-link:hover {
  color: #173d80;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex: 1;
  border: 1px solid #cfdbef;
  background: #f5f8ff;
  color: #27467a;
  border-radius: 11px;
  padding: 0.6rem 0.7rem;
  font-weight: 700;
}

.tab-btn.active {
  background: #ffffff;
  border-color: #b8ccec;
  box-shadow: 0 3px 10px rgba(26, 49, 93, 0.12);
  color: #1b3360;
}

.tab-panel.hidden {
  display: none !important;
}

.tool-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.tool-left,
.tool-right {
  margin-bottom: 0;
}

.dashboard-main {
  margin-bottom: 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
}

.dash-card {
  border: 1px solid #d9e3f2;
  background: #fbfdff;
  border-radius: 14px;
  padding: 0.85rem 0.9rem;
}

.credit-gauge-wrap {
  margin: 0.6rem 0 0.8rem;
}

.donut-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.8rem;
}

.donut-label {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #49638c;
  font-weight: 700;
}

.donut-card {
  display: inline-grid;
  grid-template-columns: 78px 1fr;
  gap: 0.75rem;
  align-items: center;
}

.donut {
  --pct: 0;
  --clr: #3c5ff4;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background:
    conic-gradient(var(--clr) calc(var(--pct) * 1%), #e8eef8 0);
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  background: #fff;
}

.donut-value {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #2b456d;
  z-index: 1;
}

.quota-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

.quota-item {
  border: 1px solid #dbe6f5;
  border-radius: 11px;
  padding: 0.58rem 0.66rem;
  background: #fff;
}

.quota-title {
  font-size: 0.85rem;
  color: #375277;
  margin-bottom: 0.2rem;
}

.quota-meter {
  height: 8px;
  border-radius: 999px;
  background: #e9eff9;
  overflow: hidden;
}

.quota-meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3f62f2, #18aeb3);
}

.quota-meta {
  margin-top: 0.24rem;
  font-size: 0.78rem;
  color: #607598;
}

.driver-bars {
  display: grid;
  gap: 0.5rem;
}

.driver-combined {
  margin-bottom: 0.55rem;
}

.driver-stack {
  display: flex;
  width: 100%;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: #eaf0f9;
  border: 1px solid #dbe6f5;
}

.driver-seg {
  height: 100%;
}

.driver-legend {
  display: grid;
  gap: 0.34rem;
}

.driver-legend-item {
  display: grid;
  grid-template-columns: 0.7rem 1fr auto;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: #334f76;
}

.driver-dot {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
}

.driver-row {
  display: grid;
  gap: 0.22rem;
}

.driver-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: #314c73;
}

.driver-track {
  height: 9px;
  border-radius: 999px;
  background: #eaf0f9;
  overflow: hidden;
}

.driver-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #4a59e9, #6775f7);
}

.events-table {
  display: grid;
  gap: 0.34rem;
}

.events-head,
.events-row,
.events-summary {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 0.7fr 0.9fr 0.35fr;
  gap: 0.5rem;
  align-items: center;
}

.events-card {
  grid-column: 1 / -1;
}

.events-head {
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6a7d9a;
  font-weight: 700;
}

.events-row {
  padding: 0.44rem 0.4rem;
  border-radius: 9px;
  border: 1px solid #e0e8f4;
  background: #fff;
  font-size: 0.8rem;
  color: #354f73;
}

.events-accordion {
  border: 1px solid #e0e8f4;
  border-radius: 10px;
  background: #fff;
}

.events-summary {
  padding: 0.44rem 0.4rem;
  cursor: pointer;
  list-style: none;
  font-size: 0.8rem;
  color: #354f73;
}

.events-status {
  margin-left: 0.45rem;
  font-size: 0.7rem;
  padding: 0.12rem 0.42rem;
  vertical-align: middle;
}

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

.events-chevron {
  text-align: right;
  color: #5c7194;
  font-size: 0.92rem;
  transition: transform 0.15s ease;
}

.events-accordion[open] .events-chevron {
  transform: rotate(180deg);
}

.events-details {
  border-top: 1px solid #edf2fa;
  padding: 0.4rem;
  background: #fbfdff;
  display: grid;
  gap: 0.28rem;
}

.events-detail-head,
.events-detail-row {
  display: grid;
  grid-template-columns: 1.6fr 0.55fr 0.85fr;
  gap: 0.5rem;
  align-items: center;
}

.events-detail-head {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6a7d9a;
  font-weight: 700;
}

.events-detail-row {
  font-size: 0.78rem;
  color: #365078;
  padding: 0.3rem 0.25rem;
  border-radius: 7px;
  background: #ffffff;
  border: 1px solid #edf2fa;
}

.billing-table .billing-head,
.billing-table .billing-row {
  display: grid;
  grid-template-columns: 1.1fr 0.7fr 0.7fr 0.75fr 0.9fr;
  gap: 0.4rem;
  align-items: center;
}

.billing-table .billing-row {
  margin-top: 0.22rem;
}

.billing-table .billing-row .status-pill {
  font-size: 0.73rem;
}

.events-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.25rem;
}

.events-download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.28rem 0.58rem;
  border-radius: 999px;
  border: 1px solid #c5d4ef;
  background: #ffffff;
  color: #2f4a74;
  text-decoration: none;
  font-size: 0.74rem;
  font-weight: 700;
}

.events-download-link:hover {
  border-color: #b1c6eb;
  background: #f4f8ff;
}

.events-retention-note {
  margin: 0.1rem 0 0;
  font-size: 0.73rem;
  color: #6b7f9d;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.72rem;
  font-weight: 700;
  color: #365593;
}

.workflow-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.wf-chip {
  border: 1px solid #bfd3f8;
  background: #f2f7ff;
  color: #26406f;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 650;
}

.soft-card {
  background: #f8fbff;
  border-style: dashed;
}

#notegen-assets-banner {
  margin-bottom: 1rem;
  padding: 0.9rem 1.15rem;
}

#use-own-files-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.25rem;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.auth-mode-tabs {
  display: inline-flex;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
}

.auth-mode-tab {
  border-radius: 999px;
}

.auth-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.35rem 0 0.15rem;
  font-size: 0.92rem;
  color: #4b5563;
}

.auth-consent input[type="checkbox"] {
  margin-top: 0.08rem;
}

.auth-consent label {
  display: block;
  gap: 0;
  margin: 0;
  font-size: inherit;
  font-weight: 400;
  min-width: 0;
  color: inherit;
  line-height: 1.35;
}

.auth-consent a {
  display: inline;
  margin-top: 0;
  color: #4f46b6;
  font-weight: 600;
  text-decoration: underline;
}

.auth-grid .inline-action {
  display: flex;
  align-items: end;
}

.auth-grid .inline-action button {
  width: 100%;
}

#verify-controls > .row:first-child {
  margin-top: 0.7rem;
}

#verify-confirm-row {
  margin-top: 1rem;
}

body.dev-auth-panels #verify-controls,
body.dev-auth-panels #reset-controls {
  margin-top: 0.7rem;
  padding: 0.72rem 0.72rem 0.5rem;
  border: 1px dashed #c9d6ef;
  border-radius: 12px;
  background: #f8fbff;
}

body.dev-auth-panels #reset-controls {
  margin-top: 0.9rem;
}

.auth-dev-box-title {
  margin: 0 0 0.4rem;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5f6f8e;
  font-weight: 700;
}

#reset-controls > .row:first-child {
  margin-top: 0.85rem;
}

#reset-confirm-fields {
  margin-top: 0.85rem;
}

.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;
}

.row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

#auth-mode-login-btn.active,
#auth-mode-register-btn.active {
  border-color: #6f5af0;
  background: rgba(111, 90, 240, 0.12);
  color: #32258a;
  box-shadow: inset 0 0 0 1px rgba(111, 90, 240, 0.24);
}

#upgrade-plan-select {
  min-width: 250px;
}

#upgrade-plan-select {
  border-color: #b7e3c9;
  background-color: #f3fff8;
  color: #1f4f36;
  box-shadow: 0 2px 8px rgba(22, 101, 52, 0.08);
}

#upgrade-plan-select:hover {
  border-color: #95d5b2;
}

#upgrade-btn {
  min-width: 200px;
  background: linear-gradient(120deg, #16a34a, #15803d);
  color: #ffffff;
  box-shadow: 0 5px 12px rgba(22, 163, 74, 0.22);
}

#upgrade-btn:hover {
  filter: brightness(1.04);
}

#upgrade-btn:disabled {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
  box-shadow: none;
}

#manage-subscription-btn {
  border-color: #d9cff8;
  background: linear-gradient(120deg, #6852d6, #4f46b6);
  color: #ffffff;
  box-shadow: 0 5px 12px rgba(92, 69, 197, 0.22);
}

#manage-subscription-btn:hover {
  filter: brightness(1.05);
}

#manage-subscription-btn:disabled {
  opacity: 0.66;
  cursor: not-allowed;
}

#refresh-subscription-btn {
  border-color: #cfd8e8;
  background: #f5f8fd;
  color: #2a446c;
}

#refresh-subscription-btn:hover {
  background: #eff5ff;
}

#refresh-subscription-btn:disabled {
  opacity: 0.66;
  cursor: wait;
}

.dashboard-refresh-meta {
  margin-top: 0.32rem;
  margin-bottom: 0.1rem;
  font-size: 0.78rem;
}

.billing-plan-label {
  margin-top: 0.75rem;
  margin-bottom: 0.35rem;
}

.account-usage-row {
  display: none;
}

.billing-policy-note {
  margin-top: 0.45rem;
  font-size: 0.86rem;
  line-height: 1.35;
  color: #40614d;
}

#billing-selfservice-note {
  margin-top: 0.45rem;
  margin-bottom: 0.2rem;
  font-size: 0.85rem;
  line-height: 1.35;
}

#subscription-status-message {
  margin-top: 0.45rem;
}

.danger-zone {
  margin-top: 0.9rem;
  border: 1px solid #f1d2d2;
  border-radius: 12px;
  background: #fff8f8;
  overflow: hidden;
}

.danger-zone > summary {
  cursor: pointer;
  padding: 0.62rem 0.72rem;
  font-weight: 700;
  color: #7f1f1f;
  list-style: none;
}

.danger-zone > summary::-webkit-details-marker {
  display: none;
}

.danger-zone[open] > summary {
  border-bottom: 1px solid #f3dada;
  background: #fff1f1;
}

.danger-zone-body {
  padding: 0.65rem 0.72rem 0.8rem;
}

.danger-zone-list {
  margin: 0.45rem 0 0.65rem;
  padding-left: 1rem;
  color: #6d2a2a;
  font-size: 0.88rem;
}

.danger-zone-list li {
  margin-bottom: 0.2rem;
}

.danger-btn {
  width: 100%;
  border: 1px solid #d65454;
  background: #b42828;
  color: #fff;
  box-shadow: 0 6px 14px rgba(147, 23, 23, 0.2);
}

.danger-btn:hover {
  background: #9e1f1f;
}

.danger-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

#delete-account-message {
  margin-top: 0.55rem;
  font-size: 0.85rem;
}

#account-subscription-help {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
}

.plan-pill {
  background: #e7efff;
  color: #1f3f78;
}

.plan-pill.plan-free {
  background: #edf2fa;
  color: #3a4f72;
}

.plan-pill.plan-plus {
  background: linear-gradient(120deg, #eef4ff, #dde9ff);
  color: #254e87;
}

.plan-pill.plan-premium {
  background: linear-gradient(120deg, #f8ecff, #e7d8ff);
  color: #5b2a8e;
}

.plan-pill.plan-business {
  background: linear-gradient(120deg, #fff4d8, #ffe4a8);
  color: #7a4b00;
}

.status-pill.auto-yes {
  background: #e7f9f3;
  color: #136a56;
}

.status-pill.auto-no {
  background: #ffeceb;
  color: #8e221b;
}

.quota-section-title {
  margin-top: 0.9rem;
}

label {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  font-weight: 600;
  min-width: 0;
}

.form-group-card {
  border: 1px solid #d6e1f0;
  border-radius: 13px;
  background: #fafdff;
  padding: 0.72rem 0.56rem 0.28rem;
  margin-bottom: 0.75rem;
  min-width: 0;
}

#notegen-model {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.form-group-title {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #4a638d;
  font-weight: 700;
}

.file-field {
  position: relative;
  border: 1px solid #d8e1ee;
  border-radius: 12px;
  padding: 0.82rem 0.95rem;
  background: #f7faff;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}

.file-field.drag-active {
  border-color: var(--accent);
  background: #eef4ff;
  transform: translateY(-1px);
}

.file-field.file-ready {
  border-color: #b8cee8;
  background: #f5f8fd;
}

.file-field[data-kind="pptx"].file-ready {
  border-color: #f0d8bb;
  background: #fdf8f0;
}

.file-field.file-invalid {
  border-color: #de7f7f;
  background: #fff6f6;
}

.file-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.42rem;
}

.file-icon {
  display: inline-flex;
  width: 1.2rem;
  height: 1.2rem;
  color: #6f86aa;
}

.file-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.file-state {
  margin-left: auto;
  padding: 0.14rem 0.48rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #eef2f9;
  color: #4c6387;
}

.file-field.file-ready .file-state {
  background: #e5f8ef;
  color: #166a54;
}

.file-field[data-kind="pptx"].file-ready .file-state {
  background: #fff0dd;
  color: #c75a00;
}

.file-done {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  border: 2px solid #16b47c;
  color: #16b47c;
  font-size: 0.92rem;
  font-weight: 900;
  display: none;
  align-items: center;
  justify-content: center;
  flex: 0 0 1.7rem;
}

.file-field.file-ready .file-done {
  display: inline-flex;
}

.file-meta {
  font-size: 0.95rem;
  color: #6a7b97;
  margin-left: 1.65rem;
}

.file-error {
  margin: 0.35rem 0 0 1.65rem;
  color: #c13838;
  font-size: 0.84rem;
  line-height: 1.25;
}

.file-field input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.segmented-block {
  margin-bottom: 0.8rem;
}

.segment-title {
  margin: 0 0 0.45rem;
  font-weight: 700;
  color: #304867;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  background: #eef3fb;
  border: 1px solid #d6e0ef;
  border-radius: 12px;
  padding: 0.25rem;
}

.seg-btn {
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #4e6488;
  padding: 0.55rem 0.65rem;
  font-weight: 700;
  cursor: pointer;
}

.seg-btn.active {
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(29, 55, 102, 0.12);
  color: #2f43a5;
}

.style-hint {
  margin: 0.35rem 0 0;
  font-style: italic;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.inline-check input[type="checkbox"] {
  margin: 0;
}

input,
select,
button,
a {
  font-size: 1rem;
}

input,
select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem;
}

select {
  -webkit-appearance: none;
  appearance: none;
  border-radius: 14px;
  border-color: #ccd7ea;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 8L10 13L15 8' stroke='%23415a81' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 18px 18px;
  color: #304463;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(26, 49, 93, 0.06);
  padding: 0.68rem 2.15rem 0.68rem 0.78rem;
}

select:hover {
  border-color: #b9c9e4;
}

button {
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  padding: 0.7rem 1rem;
  font-weight: 700;
}

#login-btn {
  background: var(--accent);
  color: #fff;
}

#register-btn {
  background: linear-gradient(120deg, #22c55e, #16a34a);
  color: #fff;
  box-shadow: 0 4px 10px rgba(22, 163, 74, 0.24);
}

#register-btn:hover {
  filter: brightness(1.03);
}

#notegen-detect-btn,
#notegen-submit-btn,
#proceed-video-btn,
#submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

#notegen-submit-btn {
  width: 100%;
}

#submit-btn {
  width: 100%;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(16, 87, 224, 0.35);
  outline-offset: 2px;
}

.secondary {
  background: #e9efff;
  color: #18325e;
}

.oauth-google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  background: #ffffff;
  color: #1f2f4b;
  border: 1px solid #d4dcea;
  box-shadow: 0 1px 2px rgba(16, 31, 64, 0.08);
  font-weight: 700;
}

.oauth-login-wrap {
  margin-top: 0.72rem;
}

.oauth-divider {
  display: flex;
  align-items: center;
  color: #6a7f9f;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.62rem;
}

.oauth-divider::before,
.oauth-divider::after {
  content: "";
  height: 1px;
  background: #d9e2f1;
  flex: 1;
}

.oauth-divider span {
  padding: 0 0.5rem;
}

.oauth-google-btn:hover {
  background: #f8fbff;
  border-color: #c4d0e3;
}

.oauth-google-btn .google-mark {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

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

button.file-clear-inline {
  margin: 0.38rem 0 0.15rem auto;
  display: block;
  border: 1px solid #cfdaf0;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  background: #ffffff;
  color: #355278;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.2;
}

button.file-clear-inline:hover {
  border-color: #b7c7e3;
  background: #f3f7ff;
}

.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.btn-spinner {
  width: 0.9rem;
  height: 0.9rem;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-top-color: #ffffff;
  border-radius: 999px;
  animation: spin 0.9s linear infinite;
}

.secondary .btn-spinner {
  border: 2px solid rgba(24, 50, 94, 0.25);
  border-top-color: #18325e;
}

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

.hidden {
  display: none !important;
}

.error {
  color: var(--danger);
}

.muted {
  color: var(--muted);
}

.message-error {
  margin-top: 0.45rem;
  color: #8e221b;
  background: #ffeceb;
  border: 1px solid #f3b7b3;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font-weight: 600;
}

.message-success {
  margin-top: 0.45rem;
  color: #14532d;
  background: #ecfdf3;
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font-weight: 600;
}

.status-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: capitalize;
  background: #eef2f9;
  color: #334b73;
}

.status-pill.processing {
  background: #e9f4ff;
  color: #0c4f9d;
}

.status-pill.completed {
  background: #e7f9f3;
  color: #136a56;
}

.status-pill.active {
  background: #e7f9f3;
  color: #136a56;
}

.status-pill.failed {
  background: #ffeceb;
  color: #8e221b;
}

.status-pill.past_due {
  background: #ffeceb;
  color: #8e221b;
}

.status-pill.canceled {
  background: #fff3db;
  color: #8b5a00;
}

.status-pill.paused {
  background: #eef2f9;
  color: #445a7d;
}

.status-pill.free {
  background: #edf2fa;
  color: #3b5073;
}

.status-badge {
  display: inline-block;
  margin-left: 0.45rem;
  border-radius: 999px;
  padding: 0.16rem 0.5rem;
  font-size: 0.74rem;
  font-weight: 700;
  background: #fff6e8;
  color: #9a4a00;
  border: 1px solid #f3d6ad;
  vertical-align: middle;
}

.progress-wrap {
  display: grid;
  gap: 0.35rem;
  margin: 0.4rem 0 0.7rem;
}

.progress-track {
  width: 100%;
  height: 10px;
  background: #e5edf9;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.35s ease;
}

.progress-percent {
  font-size: 0.82rem;
  color: #4a5f86;
}

.feed-wrap {
  margin-top: 0.8rem;
  padding: 0.75rem;
}

.notes-review-head {
  justify-content: space-between;
  align-items: baseline;
}

.notes-review-head h3 {
  margin: 0;
}

.notes-review-table-wrap {
  margin-top: 0.35rem;
  border: 1px solid #d8e3f1;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.notes-review-table {
  width: 100%;
  border-collapse: collapse;
}

.notes-review-table th,
.notes-review-table td {
  border-bottom: 1px solid #e5edf8;
  vertical-align: top;
  padding: 0.55rem 0.6rem;
}

.notes-review-table th {
  text-align: left;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6d819f;
}

.notes-review-table tr:last-child td {
  border-bottom: 0;
}

.notes-review-table td.slide-col {
  width: 72px;
  font-weight: 700;
  color: #2d466f;
}

.notes-review-table th.actions-col,
.notes-review-table td.actions-col {
  width: 132px;
  text-align: right;
}

.row-action-btn {
  min-width: 110px;
  padding: 0.46rem 0.66rem;
  font-size: 0.86rem;
}

.notes-editor {
  width: 100%;
  min-height: 78px;
  resize: vertical;
  border: 0;
  border-radius: 12px;
  padding: 0.62rem 0.66rem 0.5rem;
  font-family: inherit;
  line-height: 1.35;
  color: #223a61;
  background: #f7faff;
  box-shadow: inset 0 0 0 1px #d3deef;
  transition: box-shadow 0.16s ease, background-color 0.16s ease;
}

.notes-editor:hover {
  background: #fafdff;
}

.notes-editor:focus {
  box-shadow:
    inset 0 0 0 1px #8ea8db,
    0 0 0 3px rgba(61, 98, 190, 0.15);
  background: #ffffff;
}

.notes-editor-shell {
  border-radius: 12px;
}

.notes-editor-meta {
  display: flex;
  justify-content: flex-end;
  padding: 0.2rem 0.3rem 0;
}

.notes-editor-count {
  font-size: 0.72rem;
  color: #7085a8;
  letter-spacing: 0.02em;
}

.notes-review-actions {
  margin: 0.35rem 0 0.65rem;
}

.notes-review-download-hint {
  margin: 0.05rem 0 0.65rem;
  font-size: 0.9rem;
  line-height: 1.3;
}

.notegen-preview-tip {
  margin: 0.9rem 0 0.65rem;
  line-height: 1.35;
}

.tts-guidance {
  margin: 0.2rem 0 0.75rem;
  padding: 0.68rem 0.78rem;
  border: 1px dashed #d4e0f1;
  background: #f8fbff;
}

.voice-preview-wrap {
  margin: 0.12rem 0 0.75rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid #d8e3f1;
  border-radius: 12px;
  background: #fbfdff;
}

.voice-preview-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.48rem;
}

.voice-preview-slide-label {
  margin-bottom: 0;
}

.voice-preview-slide-label input {
  max-width: 170px;
}

#voice-test-btn {
  width: 100%;
}

#voice-test-btn.loading {
  position: relative;
  opacity: 0.9;
}

#voice-test-btn.loading::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(59, 79, 128, 0.25);
  border-top-color: #3b4f80;
  animation: spin 0.8s linear infinite;
  margin-left: 0.48rem;
}

#voice-test-audio {
  width: 100%;
  margin-top: 0.55rem;
}

#voice-test-result {
  margin-top: 0.42rem;
}

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

#notegen-review-wrap {
  margin-top: 1.75rem;
}

.notes-feed {
  list-style: none;
  margin: 0.25rem 0 0;
  max-height: 420px;
  overflow: auto;
  padding-left: 0;
}

.notes-feed li {
  margin-bottom: 0.6rem;
  line-height: 1.35;
  color: #24395d;
  border: 1px solid #d7e2f1;
  border-radius: 12px;
  background: #ffffff;
  padding: 0.72rem 0.78rem;
}

.note-item-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.4rem;
}

.note-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.8rem;
  height: 1.8rem;
  border-radius: 10px;
  background: #102748;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}

.note-label {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.8rem;
  color: #7d90ae;
  font-weight: 700;
}

.note-text {
  margin: 0;
}

a {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.action-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.95rem;
  border-radius: 12px;
  border: 1px solid #d6e0ef;
  margin-top: 0.35rem;
  background: #ffffff;
  color: #243b62;
  box-shadow: 0 2px 8px rgba(28, 51, 89, 0.08);
}

.icon {
  display: inline-flex;
  width: 1.05rem;
  height: 1.05rem;
}

.icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action-link.secondary {
  background: #f7faff;
  color: #1f365f;
}

.action-link.primary {
  background: linear-gradient(135deg, #4b4ae8 0%, #3c5ff4 100%);
  border-color: #4a56e9;
  color: #ffffff;
}

#proceed-video-btn {
  background: linear-gradient(135deg, #e49a44 0%, #c75a00 100%);
  color: #ffffff;
  border: 1px solid #b96400;
  box-shadow: 0 2px 8px rgba(168, 91, 0, 0.26);
}

#proceed-video-btn:hover {
  filter: brightness(1.02);
}

.estimate-btn {
  margin-top: 0.45rem;
  margin-bottom: 0.4rem;
}

#notegen-submit-btn,
#submit-btn {
  margin-top: 0.35rem;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 22, 44, 0.48);
  backdrop-filter: blur(3px);
}

.modal-card {
  position: relative;
  z-index: 2;
  width: min(900px, 94vw);
  max-height: 88vh;
  overflow: auto;
}

.confirm-card {
  width: min(520px, 94vw);
}

.confirm-actions {
  justify-content: flex-end;
  margin-top: 0.4rem;
}

#confirm-message {
  white-space: pre-line;
}

#confirm-message.confirm-html,
#confirm-message .confirm-plan-switch {
  white-space: normal;
}

#confirm-message .confirm-plan-headline {
  margin: 0 0 0.55rem;
  color: #1f3556;
  font-weight: 700;
}

#confirm-message .confirm-plan-table-wrap {
  border: 1px solid #d7e5f5;
  border-radius: 10px;
  overflow: hidden;
  background: #fbfdff;
}

#confirm-message .confirm-plan-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

#confirm-message .confirm-plan-table th,
#confirm-message .confirm-plan-table td {
  text-align: left;
  padding: 0.5rem 0.62rem;
  border-bottom: 1px solid #e8eef8;
}

#confirm-message .confirm-plan-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #5a7195;
  background: #f3f8ff;
}

#confirm-message .confirm-plan-table tbody tr:last-child td {
  border-bottom: none;
}

#confirm-message .confirm-plan-table td:nth-child(2) {
  color: #445c83;
  font-weight: 600;
}

#confirm-message .confirm-plan-table td:nth-child(3) {
  color: #1f3556;
  font-weight: 700;
}

#confirm-warning {
  margin-top: 0.15rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid #f6c4bf;
  background: #fff2f1;
  border-radius: 10px;
  white-space: pre-line;
}

#confirm-warning.confirm-tone-warning {
  color: #8e221b;
  border-color: #f6c4bf;
  background: #fff2f1;
}

#confirm-warning.confirm-tone-positive {
  color: #14532d;
  border-color: #a7f3d0;
  background: #ecfdf3;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

.modal-head {
  justify-content: space-between;
  align-items: center;
}

@media (max-width: 640px) {
  .container {
    width: min(96vw, 96vw);
    margin: 0.75rem auto 1.2rem;
  }

  .card {
    padding: 0.75rem 0.78rem;
    border-radius: 14px;
    margin-bottom: 0.72rem;
  }

  #notegen-form.card {
    padding-left: 0.62rem;
    padding-right: 0.62rem;
  }

  .hero h1 {
    font-size: 1.32rem;
    line-height: 1.2;
  }

  .hero.card {
    padding: 0.62rem 0.68rem;
  }

  .eyebrow {
    font-size: 0.64rem;
    letter-spacing: 0.08em;
  }

  .subtitle {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    line-height: 1.3;
  }

  .workflow-strip {
    display: none;
  }

  .session-grid {
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
  }

  #session-bar.card {
    padding: 0.58rem 0.68rem;
  }

  .session-title {
    margin-bottom: 0.02rem;
    font-size: 0.95rem;
  }

  #session-plan {
    margin: 0;
    line-height: 1.2;
  }

  #session-bar .row {
    margin-top: 0.05rem;
  }

  .tabs {
    gap: 0.35rem;
    padding: 0.35rem;
  }

  .tab-btn {
    padding: 0.5rem 0.48rem;
    border-radius: 10px;
    font-size: 0.9rem;
    gap: 0.3rem;
  }

  .tab-btn .icon {
    width: 0.95rem;
    height: 0.95rem;
  }

  .row {
    gap: 0.4rem;
  }

  .row button,
  .row .action-link {
    width: 100%;
    justify-content: center;
  }

  label {
    margin-bottom: 0.62rem;
    gap: 0.28rem;
    font-size: 0.94rem;
  }

  .form-group-card {
    padding: 0.62rem 0.5rem 0.2rem;
    margin-bottom: 0.62rem;
  }

  .form-group-title {
    margin-bottom: 0.42rem;
    font-size: 0.74rem;
  }

  input,
  select,
  button,
  a {
    font-size: 0.95rem;
  }

  button {
    padding: 0.6rem 0.85rem;
  }

  .file-field {
    padding: 0.68rem 0.72rem;
    border-radius: 11px;
  }

  .file-meta {
    margin-left: 1.45rem;
    font-size: 0.85rem;
  }

  .seg-btn {
    padding: 0.48rem 0.44rem;
    font-size: 0.9rem;
  }

  .status-pill {
    font-size: 0.75rem;
  }

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

  .modal-card {
    max-height: 92vh;
  }

  .events-head {
    display: none;
  }

  .events-row,
  .events-summary {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .events-summary {
    position: relative;
    padding-right: 1.4rem;
  }

  .events-chevron {
    position: absolute;
    right: 0.5rem;
    top: 0.5rem;
  }

  .donut-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .events-row,
  .events-summary {
    font-size: 0.76rem;
  }

  .events-detail-head {
    display: none;
  }

  .events-detail-row {
    grid-template-columns: 1fr;
    gap: 0.18rem;
  }

  .billing-table .billing-head {
    display: none;
  }

  .billing-table .billing-row {
    grid-template-columns: 1fr;
    gap: 0.16rem;
    padding: 0.44rem 0.42rem;
    border-radius: 8px;
    border: 1px solid #e7eef9;
    background: #fff;
  }

  .notes-review-table th,
  .notes-review-table td {
    padding: 0.45rem 0.42rem;
  }

  .notes-review-table td.slide-col {
    width: 54px;
  }

  .notes-review-table th.actions-col,
  .notes-review-table td.actions-col {
    width: 110px;
  }

  .row-action-btn {
    min-width: 92px;
    padding: 0.4rem 0.54rem;
    font-size: 0.8rem;
  }

  .notes-editor {
    min-height: 68px;
    font-size: 0.92rem;
  }

  .notes-editor-count {
    font-size: 0.69rem;
  }

  .notes-review-download-hint {
    margin: 0.05rem 0 0.65rem;
  }

  .voice-preview-slide-label input {
    max-width: 100%;
  }
}

@media (min-width: 1100px) {
  #auth > .row:first-of-type {
    margin-bottom: 1.25rem;
  }

  .tool-layout {
    grid-template-columns: 37% 63%;
    align-items: start;
    gap: 1rem;
  }

  .tool-left {
    position: sticky;
    top: 1rem;
  }

  .tool-right {
    max-height: calc(100vh - 2.2rem);
    overflow: auto;
  }

  .dashboard-grid {
    grid-template-columns: 1.05fr 0.95fr;
  }

  #panel-notegen .tool-layout {
    align-items: stretch;
  }

  #panel-notegen .tool-left {
    position: static;
    top: auto;
    height: 100%;
  }

  #panel-notegen .tool-right {
    max-height: none;
    overflow: hidden;
    height: 100%;
  }

  #notegen-model {
    font-size: 0.95rem;
  }
}

@media (min-width: 641px) {
  #notegen-status #notegen-csv-link,
  #notegen-status #proceed-video-btn {
    width: 290px;
    justify-content: center;
  }
}
