:root {
  --app-bg: #ffffff;
  --sidebar-bg: #171717;
  --sidebar-hover: #252525;
  --sidebar-active: #303030;
  --text: #111111;
  --text-invert: #f4f4f4;
  --muted: #6b6b6b;
  --muted-invert: #b4b4b4;
  --border: #e5e5e5;
  --border-dark: #333333;
  --bubble-user: #f4f4f4;
  --bubble-assistant: #ffffff;
  --gold: #caa85c;
  --gold-soft: rgba(202, 168, 92, 0.12);
  --danger: #b84a42;
  --danger-soft: #f8e7e5;
  --shadow: 0 14px 38px rgba(0, 0, 0, 0.08);
}

/* Scholar workspace */
.scholar-dialog {
  width: min(1480px, calc(100vw - 28px));
  height: min(900px, calc(100dvh - 28px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #34332f;
  border-radius: 8px;
  background: #171714;
  color: #f5f3ed;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
}

.scholar-dialog::backdrop {
  background: rgba(8, 8, 7, 0.7);
  backdrop-filter: blur(8px);
}

.scholar-shell {
  position: relative;
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr);
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #171714;
}

.scholar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 0 18px;
  border-bottom: 1px solid #35342f;
  background: #171714;
}

.scholar-header-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(202, 168, 92, 0.48);
  border-radius: 7px;
  color: #d7b768;
  background: rgba(202, 168, 92, 0.06);
}

.scholar-header-copy {
  min-width: 0;
}

.scholar-header p,
.scholar-pane-heading p,
.scholar-compose-form header p {
  margin: 0 0 2px;
  color: #c7a95f;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.scholar-header h2,
.scholar-compose-form h3,
.scholar-folder-prompt h3,
.scholar-move-prompt h3 {
  margin: 0;
  color: #f7f5ef;
  font-size: 19px;
  letter-spacing: 0;
}

.scholar-header-plan {
  margin-left: auto;
  border: 1px solid rgba(202, 168, 92, 0.38);
  border-radius: 999px;
  color: #dec47f;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  line-height: 22px;
  padding: 0 8px;
  text-transform: uppercase;
}

.scholar-close-button,
.scholar-back-button,
.scholar-icon-command {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #3a3934;
  border-radius: 7px;
  background: transparent;
  color: #d8d5cd;
  font-size: 22px;
}

.scholar-back-button {
  display: none;
}

.scholar-close-button:hover,
.scholar-back-button:hover,
.scholar-icon-command:hover {
  border-color: #5c5749;
  background: #23231f;
  color: #fff;
}

.scholar-locked {
  display: grid;
  align-content: center;
  justify-items: center;
  width: min(580px, calc(100% - 40px));
  height: 100%;
  margin: auto;
  text-align: center;
}

.scholar-locked[hidden],
.scholar-workspace[hidden],
.scholar-compose-overlay[hidden],
.scholar-folder-prompt[hidden],
.scholar-move-prompt[hidden],
.scholar-editor[hidden],
.scholar-editor-empty[hidden],
.scholar-empty[hidden] {
  display: none !important;
}

.scholar-lock-icon {
  position: relative;
  width: 54px;
  height: 46px;
  margin-bottom: 24px;
  border: 1.5px solid #caa85c;
  border-radius: 7px;
  color: #caa85c;
}

.scholar-lock-icon::before {
  position: absolute;
  top: -24px;
  left: 12px;
  width: 27px;
  height: 28px;
  content: "";
  border: 1.5px solid currentColor;
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
}

.scholar-lock-icon::after {
  position: absolute;
  top: 17px;
  left: 24px;
  width: 5px;
  height: 12px;
  content: "";
  border-radius: 4px;
  background: currentColor;
}

.scholar-locked > p {
  margin: 0 0 10px;
  color: #d0b267;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.scholar-locked h3 {
  max-width: 520px;
  margin: 0 0 14px;
  color: #fff;
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.15;
}

.scholar-locked > span {
  max-width: 540px;
  color: #aaa79f;
  font-size: 15px;
  line-height: 1.65;
}

.scholar-locked > button,
.scholar-primary-button {
  border: 1px solid #caa85c;
  border-radius: 7px;
  background: #caa85c;
  color: #161510;
  font-weight: 800;
}

.scholar-locked > button {
  min-width: 146px;
  min-height: 44px;
  margin-top: 24px;
}

.scholar-locked small {
  margin-top: 12px;
  color: #7f7c74;
  font-size: 11px;
}

.scholar-workspace {
  display: grid;
  grid-template-columns: minmax(210px, 250px) minmax(330px, 420px) minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.scholar-folder-pane,
.scholar-library-pane,
.scholar-editor-pane {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.scholar-folder-pane {
  padding: 18px 12px;
  border-right: 1px solid #35342f;
  background: #141411;
}

.scholar-pane-heading,
.scholar-library-toolbar,
.scholar-editor-header,
.scholar-editor-footer,
.scholar-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.scholar-pane-heading {
  padding: 0 4px 14px;
}

.scholar-pane-heading strong {
  display: block;
  max-width: 150px;
  overflow: hidden;
  color: #f0eee8;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scholar-pane-heading .scholar-icon-command {
  width: 30px;
  height: 30px;
  font-size: 18px;
}

.scholar-root-button,
.scholar-folder-row {
  width: 100%;
  min-width: 0;
}

.scholar-root-button,
.scholar-folder-select {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #bcb9b0;
  padding: 0 9px;
  text-align: left;
}

.scholar-root-button {
  margin-bottom: 5px;
}

.scholar-root-button:hover,
.scholar-root-button.active,
.scholar-folder-row:hover,
.scholar-folder-row.active {
  background: #26251f;
  color: #fff;
}

.scholar-root-button small,
.scholar-folder-select small {
  color: #77736b;
  font-size: 10px;
}

.scholar-library-icon {
  position: relative;
  width: 15px;
  height: 16px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}

.scholar-library-icon::after {
  position: absolute;
  right: 3px;
  bottom: 3px;
  left: 3px;
  height: 1px;
  content: "";
  border-top: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
}

.scholar-folder-tree {
  display: grid;
  gap: 2px;
}

.scholar-folder-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  border-radius: 6px;
  padding-left: calc(var(--folder-depth, 0) * 13px);
}

.scholar-folder-select {
  width: 100%;
}

.scholar-folder-menu {
  width: 26px;
  height: 28px;
  border: 0;
  background: transparent;
  color: #77736b;
  font-size: 9px;
  opacity: 0;
}

.scholar-folder-row:hover .scholar-folder-menu,
.scholar-folder-row:focus-within .scholar-folder-menu {
  opacity: 1;
}

.scholar-folder-actions {
  position: absolute;
  z-index: 8;
  top: calc(100% - 3px);
  right: 3px;
  display: grid;
  min-width: 146px;
  overflow: hidden;
  border: 1px solid #454238;
  border-radius: 6px;
  background: #22211d;
  box-shadow: 0 12px 30px rgb(0 0 0 / 34%);
}

.scholar-folder-actions[hidden] {
  display: none;
}

.scholar-folder-actions button {
  min-height: 36px;
  border: 0;
  border-bottom: 1px solid #34322c;
  background: transparent;
  color: #e7e3da;
  padding: 0 12px;
  text-align: left;
}

.scholar-folder-actions button:last-child {
  border-bottom: 0;
  color: #e9aaa2;
}

.scholar-folder-actions button:hover,
.scholar-folder-actions button:focus-visible {
  background: #302e27;
  outline: 0;
}

.scholar-library-pane {
  padding: 20px 18px;
  border-right: 1px solid #35342f;
  background: #1b1b17;
}

.scholar-library-toolbar {
  align-items: flex-end;
}

.scholar-library-toolbar h3 {
  margin: 5px 0 0;
  color: #f6f4ee;
  font-size: 19px;
  letter-spacing: 0;
}

.scholar-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 18px;
  overflow: hidden;
  color: #77736b;
  font-size: 10px;
  white-space: nowrap;
}

.scholar-breadcrumbs button {
  max-width: 120px;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: #918c81;
  padding: 0;
  text-overflow: ellipsis;
}

.scholar-toolbar-actions {
  display: flex;
  gap: 7px;
}

.scholar-toolbar-actions button,
.scholar-editor-actions button,
.scholar-editor-footer button,
.scholar-compose-form footer button,
.scholar-folder-prompt footer button,
.scholar-move-prompt footer button {
  min-height: 34px;
  border: 1px solid #403f38;
  border-radius: 6px;
  background: transparent;
  color: #d9d6ce;
  padding: 0 11px;
  font-size: 11px;
  font-weight: 700;
}

.scholar-toolbar-actions .scholar-primary-button,
.scholar-editor-footer .scholar-primary-button,
.scholar-compose-form footer .scholar-primary-button,
.scholar-folder-prompt footer .scholar-primary-button,
.scholar-move-prompt footer .scholar-primary-button {
  border-color: #caa85c;
  background: #caa85c;
  color: #17150f;
}

.scholar-search {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  margin: 16px 0 10px;
  border: 1px solid #3b3a34;
  border-radius: 6px;
  color: #7e7a72;
  padding: 0 11px;
  background: #151512;
}

.scholar-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #eeeae1;
  font-size: 12px;
}

.scholar-search-icon {
  position: relative;
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.scholar-search-icon::after {
  position: absolute;
  right: -4px;
  bottom: -3px;
  width: 5px;
  height: 1.5px;
  content: "";
  background: currentColor;
  transform: rotate(45deg);
}

.scholar-library-status {
  min-height: 19px;
  color: #8c887e;
  font-size: 11px;
}

.scholar-library-status[data-type="error"] {
  color: #df918a;
}

.scholar-library-status[data-type="success"] {
  color: #83b8a7;
}

.scholar-item-list {
  display: grid;
  gap: 4px;
}

.scholar-item-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 64px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #eeeae1;
  padding: 9px;
  text-align: left;
}

.scholar-item-row:hover,
.scholar-item-row.active {
  background: #2a2923;
}

.scholar-item-row > span:nth-child(2) {
  min-width: 0;
}

.scholar-item-row strong,
.scholar-item-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scholar-item-row strong {
  font-size: 12px;
}

.scholar-item-row small {
  margin-top: 5px;
  color: #88847b;
  font-size: 10px;
}

.scholar-item-meta {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.scholar-item-meta em {
  color: #c0a359;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.scholar-item-meta time {
  color: #706d65;
  font-size: 9px;
}

.scholar-note-icon,
.scholar-answer-icon,
.scholar-file-icon,
.scholar-document-icon,
.scholar-empty-icon {
  position: relative;
  display: inline-block;
  width: 19px;
  height: 23px;
  border: 1.5px solid #8f8a7e;
  border-radius: 2px;
}

.scholar-note-icon::after,
.scholar-answer-icon::after,
.scholar-file-icon::after,
.scholar-document-icon::after,
.scholar-empty-icon::after {
  position: absolute;
  right: 3px;
  bottom: 5px;
  left: 3px;
  height: 5px;
  content: "";
  border-top: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
}

.scholar-answer-icon {
  border-color: #c3a659;
  color: #c3a659;
}

.scholar-file-icon::before {
  position: absolute;
  top: -1.5px;
  right: -1.5px;
  width: 7px;
  height: 7px;
  content: "";
  border-left: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  background: #1b1b17;
}

.scholar-empty,
.scholar-editor-empty {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 340px;
  color: #716e67;
  text-align: center;
}

.scholar-empty strong,
.scholar-editor-empty strong {
  margin-top: 15px;
  color: #aaa69c;
  font-size: 14px;
}

.scholar-empty p,
.scholar-editor-empty p {
  max-width: 300px;
  margin: 7px 0 0;
  font-size: 11px;
  line-height: 1.5;
}

.scholar-editor-pane {
  background: #20201c;
}

.scholar-editor {
  display: grid;
  grid-template-rows: auto minmax(240px, 1fr) auto auto;
  height: 100%;
  min-height: 0;
  padding: 22px 24px 18px;
}

.scholar-editor-header {
  padding-bottom: 16px;
  border-bottom: 1px solid #3a3933;
}

.scholar-editor-header > div:first-child {
  min-width: 0;
  flex: 1;
}

.scholar-item-kind {
  display: block;
  margin-bottom: 6px;
  color: #c7a95f;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.scholar-editor-title,
#scholarEditorTitle {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
}

.scholar-editor-actions {
  align-self: flex-start;
}

.scholar-editor-actions .scholar-icon-command {
  width: 34px;
  padding: 0;
}

.scholar-trash-icon {
  position: relative;
  display: block;
  width: 12px;
  height: 14px;
  border: 1.5px solid currentColor;
  border-top: 0;
  border-radius: 0 0 2px 2px;
}

.scholar-trash-icon::before {
  position: absolute;
  top: -4px;
  left: -2px;
  width: 14px;
  height: 1.5px;
  content: "";
  background: currentColor;
}

.scholar-trash-icon::after {
  position: absolute;
  top: -7px;
  left: 3px;
  width: 5px;
  height: 3px;
  content: "";
  border: 1.5px solid currentColor;
  border-bottom: 0;
  border-radius: 2px 2px 0 0;
}

#scholarEditorContent {
  width: 100%;
  height: 100%;
  min-height: 0;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: #dcd9d0;
  padding: 22px 0;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.75;
}

#scholarEditorContent[readonly] {
  color: #c9c5bc;
}

.scholar-source-section {
  padding: 14px 0;
  border-top: 1px solid #3a3933;
}

.scholar-section-heading strong {
  font-size: 11px;
}

.scholar-section-heading span {
  color: #84b4a5;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.scholar-source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.scholar-source-list span {
  border: 1px solid #49463d;
  border-radius: 999px;
  color: #c8b578;
  padding: 4px 8px;
  font-size: 9px;
}

.scholar-editor-footer {
  min-height: 54px;
  border-top: 1px solid #3a3933;
}

.scholar-editor-footer > span {
  color: #7d7970;
  font-size: 10px;
}

.scholar-editor-footer > div {
  display: flex;
  gap: 8px;
}

.scholar-compose-overlay,
.scholar-folder-prompt,
.scholar-move-prompt {
  position: absolute;
  z-index: 8;
  inset: 72px 0 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(10, 10, 8, 0.76);
  backdrop-filter: blur(8px);
}

.scholar-compose-form,
.scholar-folder-prompt form,
.scholar-move-prompt form {
  width: min(620px, 100%);
  max-height: 100%;
  overflow: auto;
  border: 1px solid #46443a;
  border-radius: 8px;
  background: #1d1d19;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.42);
  padding: 22px;
}

.scholar-compose-form header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.scholar-compose-form > label,
.scholar-compose-options label,
.scholar-folder-prompt label,
.scholar-move-prompt label {
  display: grid;
  gap: 7px;
  color: #a9a59b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.scholar-compose-form input,
.scholar-compose-form textarea,
.scholar-compose-form select,
.scholar-folder-prompt input,
.scholar-move-prompt select {
  width: 100%;
  border: 1px solid #444239;
  border-radius: 6px;
  outline: 0;
  background: #141411;
  color: #eeeae1;
  padding: 10px 11px;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}

.scholar-compose-form textarea {
  min-height: 132px;
  resize: vertical;
}

.scholar-compose-form > label + label {
  margin-top: 14px;
}

.scholar-compose-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.scholar-compose-boundary {
  display: grid;
  gap: 4px;
  margin-top: 16px;
  border-left: 2px solid #caa85c;
  background: rgba(202, 168, 92, 0.07);
  color: #9c978b;
  padding: 10px 12px;
  font-size: 10px;
  line-height: 1.5;
}

.scholar-compose-boundary strong {
  color: #d8c086;
  font-size: 11px;
}

.scholar-compose-status {
  min-height: 21px;
  margin: 10px 0 0;
  color: #c1aa70;
  font-size: 11px;
}

.scholar-compose-form footer,
.scholar-folder-prompt footer,
.scholar-move-prompt footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.scholar-folder-prompt form,
.scholar-move-prompt form {
  width: min(420px, 100%);
}

.scholar-folder-prompt p {
  margin: 9px 0 0;
  color: #858177;
  font-size: 10px;
}

.scholar-folder-prompt label,
.scholar-move-prompt label {
  margin-top: 18px;
}

@media (max-width: 1020px) {
  .scholar-dialog {
    width: calc(100vw - 14px);
    height: calc(100dvh - 14px);
  }

  .scholar-workspace {
    grid-template-columns: 220px 330px minmax(420px, 1fr);
    overflow-x: auto;
  }
}

@media (max-width: 720px) {
  .scholar-icon-button {
    color: #6c685f;
  }

  .scholar-dialog {
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .scholar-shell {
    grid-template-rows: calc(64px + env(safe-area-inset-top, 0px)) minmax(0, 1fr);
  }

  .scholar-header {
    padding: env(safe-area-inset-top, 0px) 12px 0;
  }

  .scholar-header-mark {
    width: 34px;
    height: 34px;
  }

  .scholar-header-plan {
    display: none;
  }

  .scholar-back-button {
    display: grid;
  }

  .scholar-workspace {
    position: relative;
    display: block;
    overflow: hidden;
  }

  .scholar-folder-pane,
  .scholar-library-pane,
  .scholar-editor-pane {
    position: absolute;
    inset: 0;
    width: 100%;
    border: 0;
    transition: transform 180ms ease, visibility 180ms ease;
  }

  .scholar-folder-pane {
    padding: 18px 14px calc(20px + env(safe-area-inset-bottom, 0px));
  }

  .scholar-library-pane {
    padding: 18px 14px calc(20px + env(safe-area-inset-bottom, 0px));
  }

  .scholar-editor {
    padding: 18px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .scholar-shell[data-mobile-view="folders"] .scholar-folder-pane,
  .scholar-shell[data-mobile-view="library"] .scholar-library-pane,
  .scholar-shell[data-mobile-view="editor"] .scholar-editor-pane {
    z-index: 2;
    transform: translateX(0);
    visibility: visible;
  }

  .scholar-shell[data-mobile-view="folders"] .scholar-library-pane,
  .scholar-shell[data-mobile-view="folders"] .scholar-editor-pane,
  .scholar-shell[data-mobile-view="library"] .scholar-editor-pane {
    transform: translateX(100%);
    visibility: hidden;
  }

  .scholar-shell[data-mobile-view="library"] .scholar-folder-pane,
  .scholar-shell[data-mobile-view="editor"] .scholar-folder-pane,
  .scholar-shell[data-mobile-view="editor"] .scholar-library-pane {
    transform: translateX(-100%);
    visibility: hidden;
  }

  .scholar-root-button,
  .scholar-folder-select {
    min-height: 48px;
  }

  .scholar-folder-menu {
    width: 34px;
    opacity: 1;
  }

  .scholar-library-toolbar {
    align-items: flex-start;
  }

  .scholar-toolbar-actions {
    flex-direction: column;
  }

  .scholar-toolbar-actions button {
    min-height: 32px;
  }

  .scholar-item-row {
    min-height: 72px;
  }

  .scholar-editor-header {
    align-items: flex-start;
  }

  .scholar-editor-actions {
    gap: 5px;
  }

  .scholar-compose-overlay,
  .scholar-folder-prompt,
  .scholar-move-prompt {
    inset: calc(64px + env(safe-area-inset-top, 0px)) 0 0;
    align-items: end;
    padding: 0;
  }

  .scholar-compose-form,
  .scholar-folder-prompt form,
  .scholar-move-prompt form {
    width: 100%;
    max-height: calc(100dvh - 74px - env(safe-area-inset-top, 0px));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 8px 8px 0 0;
    padding: 20px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  }

  .scholar-compose-options {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--app-bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: var(--app-bg);
}

.sidebar {
  background: var(--sidebar-bg);
  color: var(--text-invert);
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 12px;
}

.sidebar::after {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  overflow: hidden;
  background: #080907;
  border-radius: 8px;
}

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

.brand h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted-invert);
  font-size: 11px;
}

.new-chat-button,
.sidebar-tool-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border-dark);
  background: transparent;
  color: var(--text-invert);
  padding: 0 12px;
  border-radius: 8px;
  font-weight: 600;
}

.sidebar-tool-button {
  margin-top: -4px;
  color: var(--muted-invert);
}

.trust-shield-icon {
  display: inline-block;
  width: 15px;
  height: 17px;
  flex: 0 0 auto;
  border: 1.6px solid currentColor;
  clip-path: polygon(50% 0, 100% 17%, 91% 70%, 50% 100%, 9% 70%, 0 17%);
  opacity: 0.9;
}

.new-chat-button:hover,
.sidebar-tool-button:hover,
.ghost-button:hover,
.history-item:hover {
  background: var(--sidebar-hover);
}

.prayer-clock-icon {
  position: relative;
  display: inline-block;
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  border: 1.8px solid currentColor;
  border-radius: 50%;
}

.prayer-clock-icon::before,
.prayer-clock-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.5px;
  background: currentColor;
  transform-origin: 50% 0;
}

.prayer-clock-icon::before {
  height: 4px;
  transform: translate(-50%, -100%);
}

.prayer-clock-icon::after {
  height: 4px;
  transform: translate(-50%, -1px) rotate(-48deg);
}

.scholar-folder-icon {
  position: relative;
  display: inline-block;
  width: 17px;
  height: 13px;
  flex: 0 0 auto;
  margin-top: 2px;
  border: 1.6px solid currentColor;
  border-radius: 2px;
}

.scholar-folder-icon::before {
  position: absolute;
  top: -5px;
  left: -1.6px;
  width: 8px;
  height: 5px;
  content: "";
  border: 1.6px solid currentColor;
  border-bottom: 0;
  border-radius: 2px 2px 0 0;
}

.scholar-folder-icon::after {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 5px;
  height: 5px;
  content: "";
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  opacity: 0.68;
}

.scholar-sidebar-button .scholar-pro-badge {
  margin-left: auto;
  border: 1px solid rgba(202, 168, 92, 0.42);
  border-radius: 999px;
  color: #e0c47f;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 18px;
  padding: 0 6px;
  text-transform: uppercase;
}

.scholar-sidebar-button[hidden],
.scholar-icon-button[hidden] {
  display: none !important;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted-invert);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 8px 8px 0;
  text-transform: uppercase;
}

.ghost-button {
  border: 0;
  background: transparent;
  color: var(--muted-invert);
  padding: 5px 8px;
  font-size: 12px;
  border-radius: 6px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.history-item {
  border: 0;
  background: transparent;
  color: var(--text-invert);
  padding: 10px 11px;
  text-align: left;
  border-radius: 8px;
}

.history-item.active {
  background: var(--sidebar-active);
}

.history-item strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.sidebar-account {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-dark);
}

.usage-summary {
  display: grid;
  gap: 8px;
  padding: 2px 8px;
}

.usage-summary > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted-invert);
  font-size: 11px;
}

.usage-summary strong {
  color: var(--text-invert);
  font-size: 11px;
  font-weight: 650;
}

.usage-track {
  height: 3px;
  overflow: hidden;
  background: #343434;
  border-radius: 999px;
}

.usage-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--gold);
  border-radius: inherit;
  transition: width 180ms ease;
}

.profile-button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  border: 0;
  background: transparent;
  color: var(--text-invert);
  padding: 6px 8px;
  text-align: left;
  border-radius: 8px;
}

.profile-button:hover {
  background: var(--sidebar-hover);
}

.profile-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(202, 168, 92, 0.4);
  background: rgba(202, 168, 92, 0.12);
  color: #f1d38a;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

.profile-copy,
.profile-copy strong,
.profile-copy span {
  display: block;
  min-width: 0;
}

.profile-copy strong {
  overflow: hidden;
  color: var(--text-invert);
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-copy span,
.profile-chevron {
  color: var(--muted-invert);
  font-size: 11px;
}

.chat-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto clamp(150px, 22vh, 260px);
  min-width: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 12%, rgba(202, 168, 92, 0.08), transparent 24%),
    var(--app-bg);
  position: relative;
}

.chat-panel::after {
  content: "بِسْمِ الله";
  position: fixed;
  right: 46px;
  top: 112px;
  color: rgba(202, 168, 92, 0.055);
  font-family: "Geeza Pro", "Noto Naskh Arabic", serif;
  font-size: clamp(58px, 8vw, 130px);
  pointer-events: none;
}

.mobile-header {
  display: none;
}

.mobile-header-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.home-prayer-banner {
  position: relative;
  z-index: 5;
  display: grid;
  grid-column: 1;
  grid-row: 1;
  grid-template-columns: minmax(190px, 1.35fr) 1px minmax(150px, 1fr) 1px minmax(205px, 1.3fr) 18px;
  align-items: center;
  gap: 15px;
  width: min(980px, calc(100% - 40px));
  min-height: 76px;
  margin: 18px auto 0;
  border: 1px solid rgba(202, 168, 92, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 9px 28px rgba(18, 19, 16, 0.055);
  backdrop-filter: blur(12px);
  color: #262824;
  padding: 11px 15px;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.home-prayer-banner:hover {
  border-color: rgba(184, 141, 53, 0.48);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 34px rgba(18, 19, 16, 0.08);
}

.home-prayer-banner:focus-visible {
  outline: 2px solid rgba(174, 132, 48, 0.55);
  outline-offset: 3px;
}

.home-prayer-date,
.home-prayer-slot,
.home-prayer-reading {
  display: grid;
  min-width: 0;
}

.home-prayer-date {
  gap: 2px;
}

.home-prayer-location {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 5px;
  margin-top: 2px;
  color: #5e605a;
  font-size: 10px;
  font-weight: 680;
  line-height: 1.25;
}

.home-prayer-location > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-location-icon {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  background: #9a772d;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10c0 6-8 12-8 12S4 16 4 10a8 8 0 1 1 16 0Z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10c0 6-8 12-8 12S4 16 4 10a8 8 0 1 1 16 0Z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
}

.home-prayer-date small,
.home-prayer-slot small {
  color: #8b6b27;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.home-prayer-date strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-prayer-date > span {
  overflow: hidden;
  color: #74746e;
  font-size: 10px;
  font-weight: 620;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-prayer-divider {
  align-self: stretch;
  width: 1px;
  background: rgba(28, 29, 26, 0.1);
}

.home-prayer-slot {
  align-content: center;
  gap: 4px;
}

.home-prayer-current small {
  display: flex;
  align-items: center;
  gap: 5px;
}

.home-prayer-current small i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #258c70;
  box-shadow: 0 0 0 3px rgba(37, 140, 112, 0.1);
}

.home-prayer-reading {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
}

.home-prayer-name {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
}

.home-prayer-name strong {
  overflow: hidden;
  color: #1d1e1b;
  font-size: 16px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prayer-phase-icon {
  --prayer-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M9 12h6'/%3E%3C/svg%3E");
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  background: #a37927;
  -webkit-mask: var(--prayer-icon) center / contain no-repeat;
  mask: var(--prayer-icon) center / contain no-repeat;
}

.prayer-phase-icon[data-prayer="fajr"] {
  --prayer-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2v8'/%3E%3Cpath d='m4.93 10.93 1.41 1.41'/%3E%3Cpath d='M2 18h2'/%3E%3Cpath d='M20 18h2'/%3E%3Cpath d='m19.07 10.93-1.41 1.41'/%3E%3Cpath d='M22 22H2'/%3E%3Cpath d='m8 6 4-4 4 4'/%3E%3Cpath d='M16 18a4 4 0 0 0-8 0'/%3E%3C/svg%3E");
  color: #b47b28;
}

.prayer-phase-icon[data-prayer="dhuhr"] {
  --prayer-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2'/%3E%3Cpath d='M12 20v2'/%3E%3Cpath d='m4.93 4.93 1.42 1.42'/%3E%3Cpath d='m17.66 17.66 1.41 1.41'/%3E%3Cpath d='M2 12h2'/%3E%3Cpath d='M20 12h2'/%3E%3Cpath d='m6.34 17.66-1.41 1.41'/%3E%3Cpath d='m19.07 4.93-1.41 1.41'/%3E%3C/svg%3E");
  background: #bc8a2d;
}

.prayer-phase-icon[data-prayer="asr"] {
  --prayer-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='10' r='4'/%3E%3Cpath d='M9 2v2'/%3E%3Cpath d='M2 10h2'/%3E%3Cpath d='m3.34 4.34 1.42 1.42'/%3E%3Cpath d='M14 5.5 15.5 4'/%3E%3Cpath d='M4 18h16'/%3E%3Cpath d='m14 14 4 4 4-4'/%3E%3C/svg%3E");
  background: #a96f24;
}

.prayer-phase-icon[data-prayer="maghrib"] {
  --prayer-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 10V2'/%3E%3Cpath d='m4.93 10.93 1.41 1.41'/%3E%3Cpath d='M2 18h2'/%3E%3Cpath d='M20 18h2'/%3E%3Cpath d='m19.07 10.93-1.41 1.41'/%3E%3Cpath d='M22 22H2'/%3E%3Cpath d='m16 6-4 4-4-4'/%3E%3Cpath d='M16 18a4 4 0 0 0-8 0'/%3E%3C/svg%3E");
  background: #a85e32;
}

.prayer-phase-icon[data-prayer="isha"] {
  --prayer-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9'/%3E%3Cpath d='M19 3v4'/%3E%3Cpath d='M21 5h-4'/%3E%3C/svg%3E");
  background: #6f6b8f;
}

.home-prayer-reading b {
  color: #8a661f;
  font-size: 15px;
  font-weight: 760;
  line-height: 1.2;
  white-space: nowrap;
}

.home-prayer-reading b:empty {
  display: none;
}

.home-prayer-slot em {
  overflow: hidden;
  color: #74746e;
  font-size: 9px;
  font-style: normal;
  font-weight: 620;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-prayer-open {
  color: #9a772d;
  font-size: 22px;
  line-height: 1;
  text-align: center;
}

.home-empty {
  position: relative;
  z-index: 3;
  display: grid;
  grid-column: 1;
  grid-row: 2;
  align-self: end;
  justify-items: center;
  width: min(680px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 18px;
}

.home-empty[hidden] {
  display: none;
}

.home-logo-button {
  border: 0;
  border-radius: 28px;
  background: transparent;
  padding: 0;
  line-height: 0;
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease;
}

.home-logo-button:hover {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.03);
}

.home-logo-button:focus-visible {
  outline: 2px solid #b88d35;
  outline-offset: 6px;
}

.home-logo-button[aria-expanded="true"] {
  transform: translateY(-1px);
}

.home-logo {
  display: block;
  width: 116px;
  height: 116px;
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(12, 13, 11, 0.16);
}

.today-strip {
  position: relative;
  display: grid;
  width: min(600px, 100%);
  grid-template-columns: 1fr;
  align-items: center;
  gap: 7px;
  margin: 22px auto 0;
  border: 0;
  background: transparent;
  color: #171815;
  padding: 4px 32px;
  text-align: center;
}

.today-strip[hidden] {
  display: none;
}

.today-strip:not([hidden]) {
  animation: reveal-today-suggestion 240ms ease both;
}

.today-strip:hover {
  background: rgba(202, 168, 92, 0.06);
}

@keyframes reveal-today-suggestion {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

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

.today-date,
.today-date strong,
.today-date span,
.today-occasion,
.today-occasion small,
.today-occasion strong,
.today-occasion > span {
  display: block;
  min-width: 0;
}

.today-date {
  display: flex;
  justify-content: center;
  gap: 7px;
  color: #85847d;
}

.today-date strong,
.today-date span {
  display: inline;
  color: inherit;
  font-size: 10px;
  font-weight: 600;
}

.today-date span {
  margin: 0;
}

.today-date span::before {
  content: "· ";
}

.today-occasion small {
  color: #8d6b27;
  font-size: 9px;
  font-weight: 820;
  text-transform: uppercase;
}

.today-occasion strong {
  margin-top: 5px;
  font-size: 18px;
  line-height: 1.3;
}

.today-occasion > span {
  max-width: 560px;
  margin: 5px auto 0;
  color: #666660;
  font-size: 13px;
  line-height: 1.5;
}

.today-reference {
  color: #8b6b27;
  font-size: 10px;
  font-weight: 750;
}

.today-art,
.calendar-art {
  background-color: #21342c;
  background-image: url("assets/islamic-calendar-occasions.png");
  background-repeat: no-repeat;
  background-size: 400% auto;
}

.today-art {
  display: none;
  width: 104px;
  height: 50px;
  justify-self: end;
  border-radius: 6px;
  background-position-y: center;
}

.today-art.ramadan,
.calendar-art.ramadan {
  background-position-x: 0;
}

.today-art.eid,
.calendar-art.eid {
  background-position-x: 33.333%;
}

.today-art.hajj,
.calendar-art.hajj {
  background-position-x: 66.667%;
}

.today-art.muharram,
.today-art.general,
.calendar-art.muharram,
.calendar-art.general {
  background-position-x: 100%;
}

.today-open-icon {
  position: absolute;
  top: 50%;
  right: 8px;
  color: #9a792e;
  font-size: 18px;
  transform: translateY(-50%);
}

.today-strip.occasion {
  grid-template-columns: minmax(0, 1fr) 104px 18px;
  gap: 14px;
  overflow: hidden;
  border: 1px solid #dfd7c4;
  border-radius: 8px;
  background: #fbfaf6;
  padding: 13px 11px 13px 16px;
  text-align: left;
}

.today-strip.occasion:hover {
  border-color: #c9b47d;
  background: #ffffff;
}

.today-strip.occasion .today-occasion {
  grid-column: 1;
  grid-row: 1;
}

.today-strip.occasion .today-occasion > span {
  margin-right: 0;
  margin-left: 0;
}

.today-strip.occasion .today-reference,
.today-strip.occasion .today-date {
  grid-column: 1;
  justify-content: flex-start;
}

.today-strip.occasion .today-art {
  display: block;
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: stretch;
  height: 100%;
  min-height: 78px;
}

.today-strip.occasion .today-open-icon {
  position: static;
  grid-column: 3;
  grid-row: 1 / span 3;
  transform: none;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 0;
  grid-column: 1;
  width: min(820px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 18px;
  overflow: auto;
  grid-row: 2;
}

.message {
  display: grid;
  padding: 13px 0;
}

.message.user {
  justify-items: end;
}

.bubble {
  max-width: 720px;
  border: 0;
  background: var(--bubble-assistant);
  padding: 0;
  line-height: 1.62;
  border-radius: 0;
  box-shadow: none;
}

.user .bubble {
  background: var(--bubble-user);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 18px;
  max-width: min(680px, 82%);
}

.bubble[dir="rtl"],
.answer-shell[dir="rtl"] {
  font-family: "Geeza Pro", "Noto Naskh Arabic", "Tahoma", sans-serif;
  text-align: right;
}

.answer-shell[dir="rtl"] {
  direction: rtl;
  line-height: 1.85;
}

.answer-shell[dir="rtl"] .answer-label {
  letter-spacing: 0;
  text-transform: none;
}

.answer-shell[dir="rtl"] .answer-section h3 {
  letter-spacing: 0;
  text-transform: none;
}

.answer-shell[dir="rtl"] .answer-callout,
.answer-shell[dir="rtl"] .notice {
  border-right: 3px solid var(--gold);
  border-left: 0;
  border-radius: 8px 0 0 8px;
}

.answer-shell[dir="rtl"] .notice.warning {
  border-right-color: var(--danger);
}

.answer-shell[dir="rtl"] .evidence-collections {
  margin-right: auto;
  margin-left: 0;
}

.answer-shell[dir="rtl"] .answer-actions,
.answer-shell[dir="rtl"] .source-actions {
  justify-content: flex-start;
}

.answer-shell {
  display: grid;
  gap: 14px;
}

.answer-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold-2, #9f7429);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.answer-label::after {
  content: "";
  width: 28px;
  height: 1px;
  background: rgba(202, 168, 92, 0.5);
}

.safety-response .answer-label {
  color: #9a2f2a;
}

.safety-response .answer-label::after {
  background: rgba(154, 47, 42, 0.45);
}

.safety-response .safety-lead {
  font-weight: 750;
  color: #5f211e;
}

.safety-resources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.safety-resources a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid #d9aaa6;
  border-radius: 8px;
  background: #fff8f7;
  color: #7c2824;
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.safety-resources a:hover {
  border-color: #b96c66;
  background: #fcecea;
}

.message[data-status="loading"] .answer-label::before {
  content: "";
  width: 9px;
  height: 9px;
  border: 2px solid rgba(202, 168, 92, 0.25);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.answer-text {
  font-size: 16px;
}

.answer-text p {
  margin: 0;
}

.answer-text p + p {
  margin-top: 12px;
}

.answer-section {
  margin: 0;
}

.answer-section + .answer-section,
.answer-text p + .answer-section,
.answer-section + p {
  margin-top: 16px;
}

.answer-section h3 {
  margin: 0 0 6px;
  color: #77561f;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.answer-section p {
  white-space: pre-line;
}

.fiqh-overview {
  display: grid;
  gap: 10px;
  border-top: 1px solid rgba(115, 82, 31, 0.22);
  border-bottom: 1px solid rgba(115, 82, 31, 0.22);
  background: #fbf9f4;
  padding: 12px 14px;
}

.fiqh-overview[data-review-required="true"] {
  border-color: rgba(136, 69, 54, 0.28);
  background: #fcf7f5;
}

.fiqh-overview-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.fiqh-overview-heading span {
  color: #806126;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fiqh-overview-heading strong {
  color: #24211c;
  font-size: 14px;
  text-align: end;
}

.fiqh-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.fiqh-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(136, 69, 54, 0.28);
  border-radius: 6px;
  background: #fffaf7;
  color: #704035;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 720;
}

.fiqh-badge.secondary {
  border-color: rgba(91, 111, 147, 0.25);
  background: #f7f8fa;
  color: #485a78;
}

.fiqh-context-disclosure {
  border-top: 1px solid rgba(115, 82, 31, 0.14);
  padding-top: 8px;
}

.fiqh-context-disclosure summary {
  color: #6d511d;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.fiqh-context-disclosure p {
  margin: 8px 0 0;
  color: #55514a;
  font-size: 12px;
  line-height: 1.55;
}

.evidence-overview {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid var(--border);
  background: #fbfbfb;
  padding: 10px;
  border-radius: 12px;
}

.evidence-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  min-height: 34px;
  border: 1px solid #e1e1e1;
  background: #ffffff;
  color: #3a3a3a;
  padding: 6px 10px;
  border-radius: 999px;
}

.evidence-chip strong {
  color: #111111;
  font-size: 15px;
  line-height: 1;
}

.evidence-chip span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.evidence-quran {
  border-color: rgba(27, 127, 100, 0.28);
  background: rgba(27, 127, 100, 0.06);
}

.evidence-hadith {
  border-color: rgba(202, 168, 92, 0.34);
  background: rgba(202, 168, 92, 0.09);
}

.evidence-seerah {
  border-color: rgba(135, 82, 103, 0.28);
  background: rgba(135, 82, 103, 0.07);
}

.evidence-islamic-history {
  border-color: rgba(63, 112, 118, 0.3);
  background: rgba(63, 112, 118, 0.07);
}

.evidence-scholar-reference {
  border-color: rgba(91, 111, 147, 0.28);
  background: rgba(91, 111, 147, 0.06);
}

.evidence-madhhab-position,
.evidence-institutional-resolution,
.evidence-fiqh-methodology,
.evidence-ifta-methodology {
  border-color: rgba(126, 82, 47, 0.28);
  background: rgba(126, 82, 47, 0.06);
}

.evidence-collections {
  color: var(--muted);
  font-size: 12px;
  margin-left: auto;
  padding: 0 4px;
}

.answer-callout {
  border-left: 3px solid var(--gold);
  background: #fcf8ef;
  color: #3f3320;
  padding: 10px 12px;
  border-radius: 0 8px 8px 0;
}

.answer-callout.hereafter {
  border-left-color: #1b7f64;
  background: #eff8f5;
  color: #213d35;
}

.answer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -2px;
}

.answer-actions button {
  min-height: 32px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 700;
}

.answer-actions button:hover {
  border-color: var(--border);
  background: #f7f7f7;
  color: #222222;
}

.answer-actions .danger-action {
  color: #8e312c;
}

.answer-actions .danger-action:hover {
  border-color: #ddb4b0;
  background: #fff3f2;
  color: #6f211d;
}

.notice {
  border-left: 3px solid var(--gold);
  background: #faf6ec;
  padding: 12px 14px;
  color: #4c3e1f;
  line-height: 1.5;
  border-radius: 0 8px 8px 0;
}

.notice.warning {
  border-left-color: var(--danger);
  background: var(--danger-soft);
  color: #63302c;
}

.sources {
  display: grid;
  gap: 10px;
}

.source-card {
  border: 1px solid var(--border);
  background: #ffffff;
  padding: 14px;
  border-radius: 12px;
}

.source-quran {
  border-left: 3px solid #1b7f64;
}

.source-hadith {
  border-left: 3px solid var(--gold);
}

.source-seerah {
  border-left: 3px solid #875267;
}

.source-islamic-history {
  border-left: 3px solid #3f7076;
}

.source-scholar-reference {
  border-left: 3px solid #5b6f93;
}

.source-madhhab-position,
.source-institutional-resolution,
.source-fiqh-methodology,
.source-ifta-methodology {
  border-left: 3px solid #7e522f;
}

.source-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.source-card strong {
  font-size: 14px;
}

.evidence-rank {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 0 10px;
}

.evidence-rank span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.evidence-rank .agreement-label {
  border: 1px solid rgba(91, 111, 147, 0.24);
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(91, 111, 147, 0.08);
  color: #485978;
  font-size: 9px;
}

.evidence-rank .source-policy-label {
  border: 1px solid rgba(42, 119, 91, 0.25);
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(42, 119, 91, 0.08);
  color: #24694f;
  font-size: 9px;
}

.evidence-rank .agreement-consensus {
  border-color: rgba(42, 119, 91, 0.25);
  background: rgba(42, 119, 91, 0.09);
  color: #24694f;
}

.evidence-rank .agreement-majority {
  border-color: rgba(166, 119, 34, 0.28);
  background: rgba(202, 168, 92, 0.12);
  color: #765718;
}

.evidence-rank .agreement-disputed {
  border-color: rgba(91, 111, 147, 0.28);
  background: rgba(91, 111, 147, 0.1);
  color: #485978;
}

.source-type {
  flex: 0 0 auto;
  background: var(--gold-soft);
  color: #7a5b20;
  border: 1px solid rgba(202, 168, 92, 0.22);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.source-card:has(.source-type) {
  overflow: hidden;
}

.source-card[data-language="ar"] {
  font-family: "Geeza Pro", "Noto Naskh Arabic", "Tahoma", sans-serif;
  text-align: right;
}

.source-card[data-language="ar"].source-quran,
.source-card[data-language="ar"].source-hadith,
.source-card[data-language="ar"].source-seerah,
.source-card[data-language="ar"].source-islamic-history,
.source-card[data-language="ar"].source-scholar-reference,
.source-card[data-language="ar"].source-madhhab-position,
.source-card[data-language="ar"].source-institutional-resolution,
.source-card[data-language="ar"].source-fiqh-methodology,
.source-card[data-language="ar"].source-ifta-methodology {
  border-left-width: 1px;
  border-right-width: 3px;
}

.source-card[data-language="ar"].source-quran {
  border-right-color: #1b7f64;
}

.source-card[data-language="ar"].source-hadith {
  border-right-color: var(--gold);
}

.source-card[data-language="ar"].source-seerah {
  border-right-color: #875267;
}

.source-card[data-language="ar"].source-islamic-history {
  border-right-color: #3f7076;
}

.source-card[data-language="ar"].source-scholar-reference {
  border-right-color: #5b6f93;
}

.source-card[data-language="ar"].source-madhhab-position,
.source-card[data-language="ar"].source-institutional-resolution,
.source-card[data-language="ar"].source-fiqh-methodology,
.source-card[data-language="ar"].source-ifta-methodology {
  border-right-color: #7e522f;
}

.source-card[data-language="ar"] .translation[dir="ltr"] {
  font-family: inherit;
  text-align: left;
}

.source-excerpt {
  display: block;
  color: #3f3f3f;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
  margin: 0;
}

.source-excerpt-arabic {
  direction: rtl;
  font-family: "Geeza Pro", "Noto Naskh Arabic", serif;
  font-size: 20px;
  line-height: 1.9;
}

.source-disclosure {
  margin: 0;
}

.source-disclosure summary {
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  display: block;
  list-style: none;
  margin: -6px;
  padding: 6px;
  transition: background 150ms ease, border-color 150ms ease;
}

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

.source-disclosure summary:hover {
  background: #fbf9f4;
  border-color: rgba(202, 168, 92, 0.2);
}

.source-disclosure[open] summary {
  border-color: transparent;
  margin-bottom: 10px;
}

.source-disclosure[open] .source-excerpt,
.source-disclosure-open {
  display: none;
}

.source-disclosure[open] .source-disclosure-open {
  display: inline;
}

.source-disclosure[open] .source-disclosure-closed {
  display: none;
}

.source-disclosure-prompt {
  align-items: center;
  color: #7a5b20;
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 750;
  gap: 8px;
  margin-top: 8px;
}

.source-disclosure-prompt::before {
  content: "+";
  font-size: 16px;
  line-height: 1;
}

.source-disclosure[open] .source-disclosure-prompt::before {
  content: "-";
}

.source-language-hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.source-full-text {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.source-insight {
  border-top: 1px solid var(--border);
  margin-top: 12px;
  padding-top: 10px;
}

.source-link {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-top: 10px;
  color: #6f4053;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.source-link:hover {
  color: #4e2938;
  text-decoration: underline;
}

.source-insight summary {
  color: #7a5b20;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  list-style-position: outside;
}

.source-insight summary:hover {
  color: #4c3e1f;
}

.source-insight-body {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  color: #4a4a4a;
  font-size: 13px;
  line-height: 1.55;
}

.source-insight-body p {
  margin: 0;
}

.source-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.source-actions button {
  border: 1px solid rgba(202, 168, 92, 0.28);
  background: rgba(202, 168, 92, 0.08);
  color: #6d511d;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
}

.source-actions button:hover {
  background: rgba(202, 168, 92, 0.16);
  border-color: rgba(202, 168, 92, 0.42);
}

.arabic {
  direction: rtl;
  font-family: "Geeza Pro", "Noto Naskh Arabic", serif;
  font-size: 22px;
  line-height: 1.9;
  margin: 0 0 10px;
  color: #151515;
}

.translation {
  color: #3f3f3f;
  margin: 0;
}

.meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 10px;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-column: 1;
  align-items: end;
  gap: 9px;
  width: min(820px, calc(100% - 40px));
  margin: 0 auto;
  padding: 10px 0 0;
  grid-row: 3;
}

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

.composer-hint {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  margin: -2px 0 0;
  text-align: center;
}

.composer textarea {
  display: block;
  width: 100%;
  resize: none;
  height: 52px;
  min-height: 52px;
  max-height: 128px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  padding: 15px 144px 15px 17px;
  line-height: 1.35;
  outline: none;
  overflow-y: auto;
  scrollbar-width: none;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.composer textarea::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.composer textarea:focus {
  border-color: #c9c9c9;
}

.composer-input:has(textarea[dir="rtl"]) textarea {
  padding-right: 17px;
  padding-left: 144px;
  font-family: "Geeza Pro", "Noto Naskh Arabic", "Tahoma", sans-serif;
  font-size: 16px;
  text-align: right;
}

.composer-input:has(textarea[dir="rtl"]) .voice-button {
  right: auto;
  left: 50px;
}

.composer-input:has(textarea[dir="rtl"]) .recitation-button {
  right: auto;
  left: 92px;
}

.composer-input:has(textarea[dir="rtl"]) .voice-mode-button {
  right: auto;
  left: 8px;
}

.composer > button {
  align-self: end;
  width: 58px;
  height: 52px;
  border: 0;
  border-radius: 18px;
  background: #111111;
  color: #ffffff;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.composer > button:hover {
  background: #2a2a2a;
}

.composer > button.is-stopping {
  background: #6b2f2b;
}

.composer > button.is-stopping:hover {
  background: #7d3934;
}

.composer button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.recitation-button,
.voice-button,
.voice-mode-button {
  position: absolute;
  bottom: 8px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(202, 168, 92, 0.22);
  border-radius: 14px;
  background: #f8f8f8;
  color: #111111;
  box-shadow: none;
}

.recitation-button {
  right: 92px;
}

.voice-button {
  right: 50px;
}

.voice-mode-button {
  right: 8px;
}

.composer-mic-icon {
  position: relative;
  display: block;
  width: 10px;
  height: 15px;
  border: 2px solid currentColor;
  background: transparent;
  border-radius: 6px;
}

.composer-mic-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 14px;
  height: 7px;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
  border-radius: 0 0 7px 7px;
  transform: translateX(-50%);
}

.recitation-button:hover,
.voice-button:hover,
.voice-mode-button:hover {
  background: var(--gold-soft);
  border-color: rgba(202, 168, 92, 0.42);
}

.recitation-book-icon {
  position: relative;
  display: block;
  width: 17px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-width: 1px;
  border-radius: 2px 2px 4px 4px;
}

.recitation-book-icon::before {
  content: "";
  position: absolute;
  top: -1px;
  bottom: -2px;
  left: 50%;
  width: 2px;
  background: currentColor;
  transform: translateX(-50%);
}

.recitation-book-icon::after {
  content: "";
  position: absolute;
  top: -3px;
  left: 2px;
  width: 4px;
  height: 2px;
  border-top: 1px solid currentColor;
  box-shadow: 7px 0 0 -0.4px currentColor;
}

.voice-button.listening {
  background: #111111;
  border-color: #111111;
  color: #f1d38a;
}

.voice-button.listening .composer-mic-icon {
  animation: pulse 980ms ease-in-out infinite;
}

.voice-mode-button.active {
  border-color: #111111;
  background: #111111;
  color: #f1d38a;
}

.mini-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 18px;
  height: 18px;
}

.mini-wave i {
  display: block;
  width: 2px;
  height: 6px;
  background: currentColor;
  border-radius: 2px;
}

.mini-wave i:nth-child(2) {
  height: 13px;
}

.mini-wave i:nth-child(3) {
  height: 9px;
}

.mini-wave i:nth-child(4) {
  height: 15px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 30;
  transform: translateX(-50%);
  border: 1px solid rgba(202, 168, 92, 0.28);
  background: #171717;
  color: #f7f7f7;
  padding: 9px 12px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 700;
  opacity: 1;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.leaving {
  opacity: 0;
  transform: translateX(-50%) translateY(6px);
}

.copy-buffer {
  position: fixed;
  left: -9999px;
  top: 0;
}

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

.sidebar-scrim {
  display: none;
}

.sidebar-scrim[hidden] {
  display: none;
}

.companion-dialog,
.account-dialog,
.onboarding-dialog {
  width: min(760px, calc(100% - 32px));
  max-height: min(880px, calc(100vh - 32px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d8d8d8;
  background: #ffffff;
  color: var(--text);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.governance-dialog {
  width: min(1080px, calc(100% - 32px));
  max-height: min(900px, calc(100vh - 32px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d8d8d8;
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.governance-dialog::backdrop {
  background: rgba(13, 13, 12, 0.66);
  backdrop-filter: blur(10px);
}

.governance-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(900px, calc(100vh - 32px));
  min-height: 0;
}

.governance-header,
.governance-footer {
  padding: 20px 24px;
  background: #171715;
  color: #f6f3ea;
}

.governance-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #33322d;
}

.governance-header p,
.governance-section-heading p,
.governance-kicker {
  margin: 0 0 4px;
  color: #9a772b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.governance-header h2,
.governance-section-heading h3,
.governance-overview h3 {
  margin: 0;
  letter-spacing: 0;
}

.governance-header h2 {
  font-size: 22px;
}

.governance-close {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid #3a3934;
  background: #22221f;
  color: #f4f1e8;
  border-radius: 8px;
  font-size: 26px;
  line-height: 1;
}

.governance-content {
  min-height: 0;
  overflow-y: auto;
  padding: 0 24px;
}

.governance-overview {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 28px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}

.governance-score {
  display: grid;
  place-items: center;
  align-content: center;
  width: 136px;
  aspect-ratio: 1;
  border: 6px solid #caa85c;
  background: #f7f6f2;
  border-radius: 50%;
}

.governance-score strong {
  font-size: 31px;
  line-height: 1;
}

.governance-score span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.governance-overview h3 {
  font-size: 24px;
}

.governance-overview > div:last-child > p:not(.governance-kicker) {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.governance-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.governance-counts span,
.governance-article summary strong,
.governance-control-row > span,
.governance-gates > span {
  border: 1px solid #d9d9d4;
  background: #f7f7f4;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
}

.governance-counts span {
  padding: 7px 10px;
}

.governance-counts span[data-status="full"],
.governance-article[data-status="full"] summary strong,
.governance-control-row[data-status="enforced"] > span,
.governance-gates > span[data-eligible="true"] {
  border-color: #b9d7ca;
  background: #eff8f4;
  color: #176c51;
}

.governance-counts span[data-status="partial"],
.governance-article[data-status="partial"] summary strong,
.governance-control-row[data-status="partial"] > span {
  border-color: #e4d19f;
  background: #fbf6e9;
  color: #775615;
}

.governance-section {
  padding: 26px 0;
  border-bottom: 1px solid var(--border);
}

.governance-section:last-child {
  border-bottom: 0;
}

.governance-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.governance-section-heading h3 {
  font-size: 19px;
}

.governance-section-heading > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  text-align: right;
}

.governance-article-list,
.governance-source-list,
.governance-change-list {
  border-top: 1px solid var(--border);
}

.governance-article {
  border-bottom: 1px solid var(--border);
}

.governance-article summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 52px;
  padding: 10px 2px;
  list-style: none;
  cursor: pointer;
}

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

.governance-article summary > span {
  font-size: 14px;
  font-weight: 700;
}

.governance-article summary strong,
.governance-control-row > span {
  padding: 6px 9px;
  white-space: nowrap;
}

.governance-control-list {
  padding: 0 0 14px 18px;
}

.governance-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  border-top: 1px solid #eeeeeb;
}

.governance-control-row strong,
.governance-source-row strong,
.governance-change-row strong {
  display: block;
  font-size: 13px;
}

.governance-control-row p,
.governance-change-row p,
.governance-policy {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.governance-policy {
  max-width: 850px;
  margin-bottom: 16px;
}

.governance-license-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid #d7c89f;
  border-radius: 6px;
  color: #72551a;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.governance-license-link:hover {
  border-color: #9a772f;
  background: #fbf7ed;
}

.governance-source-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 14px 2px;
  border-bottom: 1px solid var(--border);
}

.governance-source-row > div:first-child > span {
  display: block;
  max-width: 620px;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.governance-gates {
  display: flex;
  gap: 8px;
}

.governance-gates > span {
  display: grid;
  min-width: 112px;
  padding: 7px 9px;
  border-radius: 6px;
}

.governance-gates > span[data-eligible="false"] {
  border-color: #e4d19f;
  background: #fbf6e9;
  color: #775615;
}

.governance-gates strong {
  font-size: 10px;
  text-transform: uppercase;
}

.governance-gates small {
  margin-top: 2px;
  color: inherit;
  font-size: 11px;
  text-transform: capitalize;
}

.governance-change-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 18px;
  padding: 14px 2px;
  border-bottom: 1px solid var(--border);
}

.governance-change-row time {
  color: #8b6a22;
  font-size: 11px;
  font-weight: 750;
}

.governance-empty {
  margin: 0;
  padding: 18px 2px;
  color: var(--muted);
  font-size: 13px;
}

.governance-footer {
  border-top: 1px solid #33322d;
}

.governance-footer p {
  max-width: 850px;
  margin: 0;
  color: #bbb7aa;
  font-size: 12px;
  line-height: 1.5;
}

.answer-correction {
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid #e1bb70;
  border-left-width: 4px;
  background: #fff8e9;
  border-radius: 6px;
  color: #523c14;
}

.answer-correction > span {
  display: block;
  margin-bottom: 5px;
  color: #8a651c;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.answer-correction strong {
  display: block;
  font-size: 14px;
}

.answer-correction p {
  margin: 6px 0;
  line-height: 1.5;
}

.answer-correction time {
  color: #7a6c4e;
  font-size: 11px;
}

.answer-disclosure {
  border-color: #b9d7ca;
  background: #f0f8f4;
  color: #194d3d;
}

.historical-redaction-explanation {
  max-width: 760px;
  margin: 12px 0 18px;
  color: var(--muted);
  line-height: 1.6;
}

.historical-permitted-heading {
  margin: 24px 0 10px;
  color: #73561d;
  font-size: 13px;
  letter-spacing: 0;
}

.historical-permitted-sources {
  margin-top: 0;
}

.answer-provenance {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0 4px;
  padding: 11px 12px;
  border: 1px solid #ddddda;
  background: #f8f8f6;
  border-radius: 6px;
}

.answer-provenance-icon {
  position: relative;
  width: 18px;
  height: 20px;
  flex: 0 0 auto;
  border: 1.5px solid currentColor;
  clip-path: polygon(50% 0, 100% 17%, 91% 70%, 50% 100%, 9% 70%, 0 17%);
  color: #817a69;
}

.answer-provenance-icon::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 5px;
  width: 6px;
  height: 3px;
  border-left: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
}

.answer-provenance > div {
  min-width: 0;
}

.answer-provenance strong,
.answer-provenance span,
.answer-provenance small {
  display: block;
}

.answer-provenance strong {
  font-size: 12px;
}

.answer-provenance span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.answer-provenance small {
  margin-top: 4px;
  overflow: hidden;
  color: #8a867d;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.answer-provenance[data-status="verified"] {
  border-color: #b9d7ca;
  background: #f0f8f4;
}

.answer-provenance[data-status="verified"] .answer-provenance-icon {
  color: #23755b;
}

.answer-provenance[data-status="invalid"] {
  border-color: #d5a29e;
  background: #fff1f0;
}

.answer-provenance[data-status="invalid"] .answer-provenance-icon {
  color: var(--danger);
}

@media (max-width: 760px) {
  .governance-dialog {
    width: 100%;
    max-width: none;
    max-height: calc(100vh - 12px);
    margin: auto 0 0;
    border-radius: 8px 8px 0 0;
  }

  .governance-shell {
    max-height: calc(100vh - 12px);
  }

  .governance-header,
  .governance-footer {
    padding: 14px;
  }

  .governance-content {
    padding: 0 14px;
  }

  .governance-overview {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 16px;
    padding: 20px 0;
  }

  .governance-score {
    width: 88px;
    border-width: 4px;
  }

  .governance-score strong {
    font-size: 23px;
  }

  .governance-score span {
    font-size: 9px;
  }

  .governance-overview h3 {
    font-size: 18px;
  }

  .governance-section-heading {
    align-items: flex-start;
  }

  .governance-source-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .governance-gates {
    width: 100%;
  }

  .governance-gates > span {
    flex: 1 1 50%;
    min-width: 0;
  }

  .governance-change-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

.recitation-dialog {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #0f1211;
  color: #f4f2eb;
}

.recitation-dialog::backdrop {
  background: #0f1211;
}

.recitation-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.recitation-header,
.recitation-footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  background: #111412;
}

.recitation-header {
  min-height: 78px;
  padding: max(14px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) 14px max(22px, env(safe-area-inset-left));
  border-bottom: 1px solid #292d2b;
}

.recitation-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 13px;
}

.recitation-heading > div {
  min-width: 0;
}

.recitation-mark {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(202, 168, 92, 0.48);
  background: rgba(202, 168, 92, 0.1);
  color: #f0d083;
  border-radius: 8px;
  font-family: "Geeza Pro", "Noto Naskh Arabic", serif;
  font-size: 13px;
  font-weight: 750;
}

.recitation-heading p,
.recitation-heading h2 {
  margin: 0;
  letter-spacing: 0;
}

.recitation-heading p {
  color: #aaa89f;
  font-size: 11px;
  font-weight: 720;
}

.recitation-heading h2 {
  margin-top: 3px;
  overflow: hidden;
  color: #f7f5ef;
  font-size: 18px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recitation-close {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #353936;
  background: #1a1d1b;
  color: #d8d6cf;
  border-radius: 50%;
  font-size: 23px;
  line-height: 1;
}

.recitation-close:hover {
  border-color: rgba(202, 168, 92, 0.55);
  color: #ffffff;
}

.recitation-content {
  display: grid;
  grid-template-columns: minmax(330px, 410px) minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.recitation-reader {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background: #e8e6df;
  color: #181a18;
}

.recitation-reader-header {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 9px clamp(14px, 2vw, 24px);
  border-bottom: 1px solid #d2d0c8;
  background: #f5f4ef;
}

.recitation-view-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 2px;
  padding: 3px;
  border: 1px solid #d7d4ca;
  background: #ebe9e1;
  border-radius: 6px;
}

.recitation-view-toggle button {
  min-width: 68px;
  height: 31px;
  border: 0;
  background: transparent;
  color: #72736d;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
}

.recitation-view-toggle button.active {
  background: #ffffff;
  color: #332817;
  box-shadow: 0 1px 4px rgba(28, 27, 23, 0.12);
}

.recitation-view-toggle button:focus-visible,
.mushaf-page-button:focus-visible,
.mushaf-word:focus-visible,
.mushaf-page-tools input:focus-visible {
  outline: 2px solid rgba(168, 124, 35, 0.62);
  outline-offset: 2px;
}

.mushaf-page-tools {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.mushaf-tracking-status {
  max-width: 260px;
  overflow: hidden;
  color: #75756f;
  font-size: 9px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mushaf-page-tools label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #66665f;
  font-size: 9px;
  font-weight: 750;
}

.mushaf-page-tools input {
  width: 48px;
  height: 31px;
  border: 1px solid #cac7bc;
  background: #fff;
  color: #21221f;
  border-radius: 4px;
  padding: 0 5px;
  text-align: center;
  -moz-appearance: textfield;
}

.mushaf-page-tools input::-webkit-inner-spin-button,
.mushaf-page-tools input::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.mushaf-page-tools em {
  color: #85847d;
  font-style: normal;
  font-weight: 600;
}

.mushaf-reader {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  padding: 16px;
  background:
    linear-gradient(90deg, rgba(42, 40, 34, 0.05), transparent 9%, transparent 91%, rgba(42, 40, 34, 0.05)),
    #e8e6df;
  touch-action: pan-y;
}

.mushaf-reader[hidden],
.recitation-verses[hidden] {
  display: none;
}

.mushaf-spread {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  justify-items: center;
  gap: clamp(8px, 1.2vw, 15px);
  direction: ltr;
  perspective: 1200px;
}

.mushaf-page {
  position: relative;
  display: grid;
  width: min(100%, 490px);
  height: 100%;
  max-height: 100%;
  min-height: 0;
  grid-template-rows: 28px minmax(0, 1fr) 24px;
  aspect-ratio: 0.704;
  overflow: hidden;
  border: 1px solid #c7c1b1;
  background:
    linear-gradient(90deg, rgba(117, 91, 37, 0.035), transparent 5%, transparent 95%, rgba(117, 91, 37, 0.035)),
    #fffdf6;
  border-radius: 2px;
  box-shadow:
    0 9px 24px rgba(40, 38, 31, 0.13),
    inset 0 0 0 4px rgba(164, 133, 72, 0.035);
  transform-origin: center;
}

.mushaf-page.flipping-next {
  animation: mushaf-page-next 220ms ease both;
}

.mushaf-page.flipping-previous {
  animation: mushaf-page-previous 220ms ease both;
}

@keyframes mushaf-page-next {
  from {
    opacity: 0.45;
    transform: rotateY(-5deg) translateX(8px);
  }
}

@keyframes mushaf-page-previous {
  from {
    opacity: 0.45;
    transform: rotateY(5deg) translateX(-8px);
  }
}

.mushaf-page-heading,
.mushaf-page-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #81765f;
  font-size: 8px;
  font-weight: 750;
}

.mushaf-page-heading {
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid rgba(133, 111, 67, 0.18);
}

.mushaf-page-heading span:last-child {
  text-align: right;
}

.mushaf-lines {
  display: grid;
  min-height: 0;
  grid-template-rows: repeat(15, minmax(0, 1fr));
  padding: 5px 11px 4px;
}

.mushaf-line {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  direction: rtl;
  white-space: nowrap;
}

.mushaf-line.surah-name,
.mushaf-line.bismillah {
  color: #3b3020;
  font-family: "Noto Naskh Arabic", "Geeza Pro", "Traditional Arabic", serif;
  line-height: 1;
}

.mushaf-line.surah-name {
  margin: 1px 0;
  border: 1px solid rgba(158, 121, 48, 0.28);
  background:
    linear-gradient(90deg, transparent, rgba(202, 168, 92, 0.1), transparent);
  font-size: clamp(12px, 1.02vw, 16px);
  font-weight: 700;
}

.mushaf-line.bismillah {
  font-size: clamp(13px, 1.1vw, 17px);
  font-weight: 600;
}

.mushaf-word {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #1c1b18;
  border-radius: 2px;
  padding: 0 0.5px;
  font-family: var(--mushaf-font-family, "Geeza Pro", "Noto Naskh Arabic", serif);
  font-size: clamp(15px, 1.13vw, 23px);
  font-weight: 400;
  line-height: 1;
  text-rendering: geometricPrecision;
  transition: color 90ms linear, background-color 90ms linear, box-shadow 90ms linear;
}

.mushaf-word:hover {
  background: rgba(202, 168, 92, 0.12);
}

.mushaf-word.current {
  background: rgba(208, 165, 69, 0.25);
  color: #6a4300;
  box-shadow: 0 0 0 2px rgba(208, 165, 69, 0.12);
}

.mushaf-word.current-verse:not(.current) {
  color: #5c4b29;
}

.mushaf-page-button {
  display: grid;
  width: 34px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(111, 103, 82, 0.25);
  background: rgba(255, 255, 255, 0.62);
  color: #57492d;
  border-radius: 4px;
  font-size: 27px;
  line-height: 1;
}

.mushaf-page-button:hover:not(:disabled) {
  border-color: rgba(158, 119, 40, 0.48);
  background: #fffdf7;
}

.mushaf-page-button:disabled {
  cursor: default;
  opacity: 0.25;
}

.mushaf-loading,
.mushaf-error {
  grid-column: 1 / -1;
  align-self: center;
  margin: 0;
  color: #6f6d65;
  font-size: 12px;
  text-align: center;
}

.mushaf-error {
  color: #8b443c;
}

.recitation-now {
  min-height: 0;
  overflow-y: auto;
  padding: clamp(24px, 4vh, 48px) clamp(24px, 3vw, 42px);
  background: #121513;
  border-right: 1px solid #2b302d;
  scrollbar-color: #474d49 transparent;
}

.recitation-kicker {
  margin: 0 0 28px;
  color: #cfad62;
  font-size: 10px;
  font-weight: 820;
  line-height: 1.45;
  text-transform: uppercase;
}

.recitation-chapter-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.recitation-chapter-line span,
.recitation-chapter-line h3 {
  display: block;
  margin: 0;
}

.recitation-chapter-line span {
  color: #898d89;
  font-size: 11px;
  font-weight: 700;
}

.recitation-chapter-line h3 {
  margin-top: 4px;
  color: #f7f5ef;
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.08;
  letter-spacing: 0;
}

.recitation-chapter-line > strong {
  color: #d9bd79;
  font-family: "Geeza Pro", "Noto Naskh Arabic", serif;
  font-size: 24px;
  font-weight: 650;
  line-height: 1.35;
}

.recitation-verse-copy {
  margin: 28px 0 22px;
  padding: 25px 0;
  border-top: 1px solid #2a2e2c;
  border-bottom: 1px solid #2a2e2c;
}

.recitation-arabic {
  margin: 0;
  color: #fffdf6;
  font-family: "Geeza Pro", "Noto Naskh Arabic", "Times New Roman", serif;
  font-size: clamp(27px, 3.2vw, 38px);
  font-weight: 520;
  line-height: 1.9;
  text-align: right;
}

.recitation-translation {
  margin: 16px 0 0;
  color: #c6c5bf;
  font-size: 14px;
  line-height: 1.65;
}

.recitation-progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #9a9d98;
  font-size: 11px;
}

.recitation-progress-copy span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recitation-progress-copy span:last-child {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.recitation-timeline {
  width: 100%;
  height: 20px;
  margin: 7px 0 17px;
  accent-color: #caa85c;
  cursor: pointer;
}

.recitation-controls {
  display: grid;
  grid-template-columns: 44px 60px 44px 56px;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.recitation-controls button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid #3a403c;
  background: #1a1e1b;
  color: #e6e3da;
  border-radius: 50%;
}

.recitation-controls button:hover {
  border-color: #7a6741;
  background: #222720;
}

.recitation-controls button:disabled {
  cursor: wait;
  opacity: 0.42;
}

.recitation-controls .recitation-play-button {
  width: 60px;
  height: 60px;
  border-color: #d0ae62;
  background: #caa85c;
  color: #101310;
}

.recitation-controls .recitation-play-button:hover {
  background: #dfc378;
}

.recitation-play-icon {
  display: block;
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 12px solid currentColor;
}

.recitation-play-button.playing .recitation-play-icon {
  width: 12px;
  height: 16px;
  margin-left: 0;
  border: 0;
  border-left: 4px solid currentColor;
  border-right: 4px solid currentColor;
}

.recitation-dialog[data-playback-state="loading"] .recitation-play-button {
  animation: recitation-ready-pulse 1.1s ease-in-out infinite;
}

.skip-icon {
  position: relative;
  display: block;
  width: 13px;
  height: 14px;
}

.skip-icon::before {
  position: absolute;
  top: 2px;
  content: "";
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.skip-icon::after {
  position: absolute;
  top: 1px;
  content: "";
  width: 2px;
  height: 12px;
  background: currentColor;
}

.skip-icon.next::before {
  right: 1px;
  border-left: 8px solid currentColor;
}

.skip-icon.next::after {
  right: 0;
}

.skip-icon.previous::before {
  left: 1px;
  border-right: 8px solid currentColor;
}

.skip-icon.previous::after {
  left: 0;
}

#recitationRepeatButton {
  width: 56px;
  height: 42px;
  grid-template-columns: auto auto;
  gap: 3px;
  border-radius: 21px;
}

#recitationRepeatButton small {
  font-size: 8px;
  font-weight: 800;
}

.recitation-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
  margin-top: 30px;
}

.recitation-surah-search {
  position: relative;
  grid-column: 1 / -1;
}

.recitation-surah-search > label,
.recitation-options > label:not(.recitation-continuous) {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.recitation-options > label[for="recitationSurahSelect"],
.recitation-options > label[for="recitationReciterSelect"] {
  grid-column: 1 / -1;
}

.recitation-options label > span,
.recitation-surah-search > label {
  color: #91958f;
  font-size: 10px;
  font-weight: 760;
}

.recitation-search-field {
  position: relative;
}

.recitation-search-field input {
  width: 100%;
  height: 42px;
  border: 1px solid #3a3f3c;
  border-radius: 6px;
  outline: none;
  background: #191c1a;
  color: #ece9e1;
  padding: 0 38px 0 39px;
  font: inherit;
}

.recitation-search-field input::placeholder {
  color: #777b76;
}

.recitation-search-field input:focus {
  border-color: #caa85c;
  box-shadow: 0 0 0 3px rgba(202, 168, 92, 0.13);
}

.recitation-search-field input::-webkit-search-cancel-button {
  filter: invert(0.8);
}

.recitation-search-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  z-index: 1;
  width: 12px;
  height: 12px;
  border: 1.7px solid #aaa89f;
  border-radius: 50%;
  pointer-events: none;
  transform: translateY(-60%);
}

.recitation-search-icon::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 6px;
  height: 1.7px;
  background: #aaa89f;
  transform: rotate(45deg);
}

.recitation-surah-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 8;
  max-height: 252px;
  overflow-y: auto;
  border: 1px solid #3a3f3c;
  border-radius: 6px;
  background: #191c1a;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
}

.recitation-surah-results[hidden] {
  display: none;
}

.recitation-surah-result {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 46px;
  border: 0;
  border-bottom: 1px solid #2d312e;
  background: transparent;
  color: #f5f2e9;
  padding: 7px 12px;
  text-align: left;
}

.recitation-surah-result:last-child {
  border-bottom: 0;
}

.recitation-surah-result:hover,
.recitation-surah-result[aria-selected="true"] {
  background: rgba(202, 168, 92, 0.11);
}

.recitation-surah-result > span:first-child {
  color: #caa85c;
  font-size: 11px;
  text-align: center;
}

.recitation-surah-result strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recitation-surah-result span[lang="ar"] {
  color: #ded7c5;
  font-family: "Geeza Pro", "Noto Naskh Arabic", serif;
  font-size: 16px;
}

.recitation-options select,
.recitation-reader-tools select {
  width: 100%;
  min-width: 0;
  height: 42px;
  border: 1px solid #3a3f3c;
  background: #191c1a;
  color: #ece9e1;
  padding: 0 10px;
  border-radius: 6px;
  color-scheme: dark;
  outline: none;
  text-overflow: ellipsis;
}

.recitation-options select:focus-visible,
.recitation-reader-tools select:focus-visible {
  border-color: #caa85c;
  box-shadow: 0 0 0 3px rgba(202, 168, 92, 0.13);
}

.recitation-continuous {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.recitation-continuous input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #caa85c;
}

.recitation-continuous span {
  overflow-wrap: anywhere;
}

.recitation-surah-overview {
  display: grid;
  gap: 9px;
  margin-top: 17px;
  border-top: 1px solid #2f332f;
  padding-top: 16px;
}

.recitation-surah-overview > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.recitation-surah-overview strong {
  color: #f4f0e7;
  font-size: 12px;
}

.recitation-surah-overview span {
  color: #888c87;
  font-size: 9px;
  text-align: right;
}

.recitation-surah-overview p {
  color: #bbbdb8;
  font-size: 12px;
  line-height: 1.6;
  margin: 0;
}

.recitation-surah-overview a {
  width: fit-content;
  color: #d1b46c;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}

.recitation-surah-overview a:hover {
  text-decoration: underline;
}

.recitation-verses {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #fbfbfa;
  color: #171918;
}

.recitation-verses-heading {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px clamp(18px, 3vw, 38px);
  border-bottom: 1px solid #e2e4e2;
  background: #f6f7f5;
}

.recitation-verses-heading strong,
.recitation-verses-heading span {
  display: block;
}

.recitation-verses-heading strong {
  font-size: 14px;
}

.recitation-verses-heading > div:first-child > span {
  margin-top: 3px;
  color: #747a76;
  font-size: 10px;
}

.recitation-reader-tools {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
}

.recitation-reader-tools > span {
  max-width: 220px;
  overflow: hidden;
  color: #747a76;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recitation-reader-tools label {
  display: grid;
  min-width: 210px;
  gap: 4px;
}

.recitation-reader-tools label > span {
  color: #747a76;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.recitation-reader-tools select {
  height: 36px;
  border-color: #d7dad7;
  background: #ffffff;
  color: #252825;
  color-scheme: light;
  font-size: 11px;
}

#recitationVerseList {
  min-height: 0;
  margin: 0;
  padding: 0 clamp(18px, 3vw, 38px);
  overflow-y: auto;
  list-style: none;
  scrollbar-color: #b7bdb8 transparent;
}

.recitation-verse-item {
  border-bottom: 1px solid #e2e5e2;
}

.recitation-verse-main {
  display: grid;
  width: 100%;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 17px;
  padding: clamp(22px, 4vh, 36px) 4px 17px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.recitation-verse-main:hover {
  background: #f5f7f5;
}

.recitation-verse-main.active {
  background: #f1f6f3;
  box-shadow: inset 3px 0 #2f8d72;
}

.recitation-verse-number {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #d5d9d6;
  background: #ffffff;
  color: #6d746f;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}

.recitation-verse-main.active .recitation-verse-number {
  border-color: rgba(47, 141, 114, 0.38);
  color: #176a54;
}

.recitation-verse-list-copy {
  display: grid;
  min-width: 0;
  gap: 15px;
}

.recitation-verse-list-copy > strong {
  color: #111512;
  font-family: "Geeza Pro", "Noto Naskh Arabic", "Times New Roman", serif;
  font-size: clamp(25px, 2.3vw, 34px);
  font-weight: 520;
  line-height: 1.95;
  text-align: right;
}

.recitation-verse-list-copy > small {
  display: grid;
  gap: 5px;
  color: #4f5551;
  font-size: 13px;
  line-height: 1.65;
}

.recitation-follow-along {
  display: grid;
  grid-template-columns: max-content minmax(90px, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 18px;
  opacity: 0;
  transition: opacity 160ms ease;
}

.recitation-verse-main.active .recitation-follow-along {
  opacity: 1;
}

.recitation-follow-along-label {
  color: #176a54;
  font-size: 9px;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
}

.recitation-ayah-progress {
  position: relative;
  height: 3px;
  overflow: hidden;
  background: rgba(47, 141, 114, 0.15);
  border-radius: 2px;
}

.recitation-ayah-progress > span {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--ayah-progress, 0%);
  background: #2f8d72;
  border-radius: inherit;
  transition: width 120ms linear;
}

.recitation-translation-label {
  color: #818783;
  font-size: 8px;
  font-weight: 820;
  text-transform: uppercase;
}

.recitation-verse-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 4px 18px;
}

.recitation-tafsir-button,
.recitation-tafsir-retry {
  min-height: 32px;
  border: 1px solid #d8ddd9;
  background: #ffffff;
  color: #315e50;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 780;
}

.recitation-tafsir-button:hover,
.recitation-tafsir-retry:hover {
  border-color: #7fa395;
  background: #f1f6f3;
}

.recitation-tafsir-panel {
  margin: 0 4px 24px 57px;
  padding: 18px 19px;
  border-left: 3px solid #caa85c;
  background: #f4f5f2;
  color: #272b28;
}

.recitation-tafsir-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 13px;
}

.recitation-tafsir-heading strong {
  font-size: 13px;
}

.recitation-tafsir-heading span {
  color: #7b807c;
  font-size: 9px;
  font-weight: 720;
}

.recitation-tafsir-copy {
  max-height: min(52vh, 560px);
  margin: 0;
  overflow: auto;
  color: #343936;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-line;
}

.recitation-tafsir-panel[dir="rtl"] .recitation-tafsir-copy {
  font-family: "Geeza Pro", "Noto Naskh Arabic", serif;
  font-size: 16px;
  line-height: 1.9;
  text-align: right;
}

.recitation-tafsir-status {
  margin: 0;
  color: #686f6a;
  font-size: 12px;
}

.recitation-tafsir-status.error {
  margin-bottom: 12px;
  color: #8b413b;
}

.recitation-tafsir-source {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid #dadeda;
  color: #717773;
  font-size: 9px;
}

.recitation-tafsir-source a {
  flex: 0 0 auto;
  color: #5d4820;
  font-weight: 760;
}

.recitation-footer {
  min-height: 48px;
  padding: 10px max(22px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
  border-top: 1px solid #292d2b;
}

.recitation-footer p {
  margin: 0;
  color: #898d88;
  font-size: 9px;
  line-height: 1.45;
}

.recitation-footer > div {
  display: flex;
  flex: 0 0 auto;
  gap: 14px;
}

.recitation-footer a {
  color: #d0b56f;
  font-size: 9px;
  font-weight: 720;
  text-decoration: none;
}

.recitation-footer a:hover {
  text-decoration: underline;
}

.stories-dialog {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #f7f6f1;
  color: #171815;
}

.stories-dialog::backdrop {
  background: #111310;
}

.stories-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.stories-header {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 13px;
  min-height: 74px;
  padding: max(12px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 12px max(20px, env(safe-area-inset-left));
  border-bottom: 1px solid #30322d;
  background: #151713;
  color: #f5f1e6;
}

.stories-heading-mark {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(202, 168, 92, 0.48);
  border-radius: 8px;
  background: #20231d;
}

.stories-heading-mark::before,
.stories-heading-mark::after,
.stories-heading-mark > span {
  position: absolute;
  content: "";
  background: #d3b56d;
}

.stories-heading-mark::before {
  width: 18px;
  height: 1px;
  transform: rotate(45deg);
}

.stories-heading-mark::after {
  width: 18px;
  height: 1px;
  transform: rotate(-45deg);
}

.stories-heading-mark > span {
  width: 1px;
  height: 24px;
}

.stories-header p,
.stories-header h2 {
  margin: 0;
}

.stories-header p {
  color: #c6a65c;
  font-size: 9px;
  font-weight: 820;
  text-transform: uppercase;
}

.stories-header h2 {
  margin-top: 3px;
  font-size: 18px;
  letter-spacing: 0;
}

.stories-close,
.stories-mobile-back {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #383a34;
  border-radius: 50%;
  background: #20221e;
  color: #dedbd1;
  font-size: 23px;
  line-height: 1;
}

.stories-close {
  grid-column: 3;
}

.stories-close:hover,
.stories-mobile-back:hover {
  border-color: #786333;
  color: #ffffff;
}

.stories-mobile-back {
  display: none;
  font-size: 29px;
}

.stories-layout {
  display: grid;
  grid-template-columns: minmax(280px, 342px) minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.stories-library {
  min-height: 0;
  overflow-y: auto;
  padding: 20px 16px 28px;
  border-right: 1px solid #30322d;
  background: #191b17;
  color: #f2efe6;
  scrollbar-color: #4e5049 transparent;
}

.story-continue-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 76px;
  border: 1px solid rgba(202, 168, 92, 0.38);
  border-radius: 8px;
  background: #24251f;
  color: #f3efe4;
  padding: 11px;
  text-align: left;
}

.story-continue-card:hover {
  border-color: rgba(218, 185, 106, 0.72);
  background: #2a2a22;
}

.story-continue-card[hidden] {
  display: none;
}

.story-continue-card small,
.story-continue-card strong,
.story-continue-card em {
  display: block;
}

.story-continue-card small {
  color: #d5b66b;
  font-size: 9px;
  font-weight: 820;
  text-transform: uppercase;
}

.story-continue-card strong {
  margin-top: 3px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-continue-card em {
  margin-top: 3px;
  overflow: hidden;
  color: #96958f;
  font-size: 9px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-continue-card > span:last-child {
  color: #d8be7c;
  font-size: 22px;
}

.story-continue-icon {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: #caa85c;
}

.story-continue-icon::before {
  width: 0;
  height: 0;
  margin-left: 3px;
  content: "";
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid #171815;
}

.story-search {
  position: relative;
  display: block;
  margin-top: 16px;
}

.story-search input {
  width: 100%;
  height: 42px;
  border: 1px solid #3b3d37;
  border-radius: 7px;
  outline: none;
  background: #22241f;
  color: #f1eee6;
  padding: 0 13px 0 39px;
}

.story-search input::placeholder {
  color: #8e8e88;
}

.story-search input:focus {
  border-color: #aa8b48;
  box-shadow: 0 0 0 3px rgba(202, 168, 92, 0.11);
}

.story-search-icon {
  position: absolute;
  z-index: 1;
  top: 13px;
  left: 14px;
  width: 12px;
  height: 12px;
  border: 1.6px solid #aaa99f;
  border-radius: 50%;
}

.story-search-icon::after {
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 6px;
  height: 1.6px;
  content: "";
  background: #aaa99f;
  transform: rotate(45deg);
}

.stories-library-heading {
  padding: 20px 3px 10px;
}

.stories-library-heading strong,
.stories-library-heading span {
  display: block;
}

.stories-library-heading strong {
  font-size: 11px;
}

.stories-library-heading span {
  margin-top: 3px;
  color: #8f9089;
  font-size: 9px;
}

.story-list {
  display: grid;
  gap: 4px;
}

.story-list-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #e8e6de;
  padding: 8px 9px;
  text-align: left;
}

.story-list-item:hover {
  background: #23251f;
}

.story-list-item.active {
  border-color: rgba(202, 168, 92, 0.3);
  background: #292a23;
}

.story-list-number {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid #42443d;
  border-radius: 50%;
  color: #c8ad6c;
  font-size: 9px;
  font-weight: 800;
}

.story-list-item strong,
.story-list-item small {
  display: block;
}

.story-list-item strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-list-item small {
  margin-top: 3px;
  overflow: hidden;
  color: #8f9089;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-list-arabic {
  color: #c8ad6c;
  font-family: "Geeza Pro", "Noto Naskh Arabic", serif;
  font-size: 14px;
}

.story-list-empty {
  margin: 14px 4px;
  color: #aaa9a2;
  font-size: 11px;
  line-height: 1.5;
}

.story-reader {
  min-height: 0;
  overflow-y: auto;
  background: #f7f6f1;
  scrollbar-color: #c9c5b8 transparent;
}

.story-cover {
  position: relative;
  display: grid;
  min-height: 232px;
  align-items: end;
  overflow: hidden;
  padding: 44px clamp(30px, 6vw, 90px) 34px;
  background: #22342d;
  color: #f8f3e7;
}

.story-cover::after {
  position: absolute;
  right: clamp(28px, 5vw, 76px);
  bottom: 27px;
  width: 88px;
  height: 88px;
  content: "";
  border: 1px solid rgba(211, 181, 109, 0.28);
  transform: rotate(45deg);
}

.story-cover-pattern {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0.22;
}

.story-cover-pattern span {
  position: absolute;
  display: block;
  border: 1px solid #d3b56d;
  transform: rotate(45deg);
}

.story-cover-pattern span:nth-child(1) {
  top: -84px;
  right: 12%;
  width: 210px;
  height: 210px;
}

.story-cover-pattern span:nth-child(2) {
  top: 34px;
  right: -48px;
  width: 150px;
  height: 150px;
}

.story-cover-pattern span:nth-child(3) {
  bottom: -95px;
  left: 18%;
  width: 190px;
  height: 190px;
}

.story-cover-copy {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.story-cover-copy > p:first-child {
  margin: 0;
  color: #d6b96f;
  font-size: 9px;
  font-weight: 830;
  text-transform: uppercase;
}

.story-cover-copy h3 {
  display: inline;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 52px;
  font-weight: 500;
  line-height: 1.05;
}

.story-cover-copy > span {
  margin-left: 12px;
  color: #d9bd79;
  font-family: "Geeza Pro", "Noto Naskh Arabic", serif;
  font-size: 34px;
}

.story-cover-copy > p:not(:first-child) {
  max-width: 620px;
  margin: 12px 0 0;
  color: #c7cec9;
  font-size: 13px;
  line-height: 1.55;
}

.story-book-meta {
  display: flex;
  gap: 18px;
  margin-top: 18px;
  color: #a8b4ae;
  font-size: 9px;
  font-weight: 730;
  text-transform: uppercase;
}

.story-reader-toolbar {
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 68px;
  padding: 12px clamp(24px, 6vw, 86px);
  border-bottom: 1px solid #dedbd0;
  background: rgba(247, 246, 241, 0.94);
  backdrop-filter: blur(14px);
}

.story-reader-toolbar label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.story-reader-toolbar label > span,
.story-progress-copy > span:first-child {
  color: #77766f;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.story-reader-toolbar select {
  max-width: min(390px, 44vw);
  height: 38px;
  border: 1px solid #d3cfc1;
  border-radius: 6px;
  outline: none;
  background: #ffffff;
  color: #22231f;
  padding: 0 30px 0 10px;
  font-weight: 680;
}

.story-reader-toolbar select:focus {
  border-color: #9f8040;
  box-shadow: 0 0 0 3px rgba(202, 168, 92, 0.12);
}

.story-language {
  flex: 0 0 auto;
}

.story-language select {
  width: 112px;
}

.story-progress-copy {
  display: grid;
  width: min(170px, 24vw);
  gap: 6px;
}

.story-progress-track {
  display: block;
  width: 100%;
  height: 3px;
  overflow: hidden;
  background: #dfdcd1;
}

.story-progress-track i {
  display: block;
  width: 0;
  height: 100%;
  background: #4b8170;
  transition: width 180ms ease;
}

.story-chapter {
  max-width: 850px;
  margin: 0 auto;
  padding: clamp(46px, 7vh, 78px) clamp(28px, 6vw, 70px) 48px;
  outline: none;
}

.story-chapter-kicker {
  margin: 0;
  color: #947128;
  font-size: 10px;
  font-weight: 830;
  text-transform: uppercase;
}

.story-chapter h3 {
  margin: 12px 0 0;
  color: #1d211d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 40px;
  font-weight: 520;
  line-height: 1.16;
}

.story-chapter-body {
  margin: 28px 0 0;
  color: #30332f;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  line-height: 1.82;
}

.story-chapter[data-language="ar"] {
  text-align: right;
}

.story-chapter[data-language="ar"] .story-chapter-kicker {
  letter-spacing: 0;
}

.story-chapter[data-language="ar"] h3,
.story-chapter[data-language="ar"] .story-chapter-body {
  font-family: "Geeza Pro", "Noto Naskh Arabic", "Arial", serif;
}

.story-chapter[data-language="ar"] h3 {
  font-size: 36px;
  line-height: 1.45;
}

.story-chapter[data-language="ar"] .story-chapter-body {
  font-size: 21px;
  line-height: 2;
}

.story-chapter[data-language="ar"] .story-reference-list {
  direction: rtl;
}

.story-reference-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 30px;
}

.story-reference-list a {
  border: 1px solid #d8ccae;
  border-radius: 999px;
  background: #fffdf7;
  color: #72561f;
  padding: 7px 10px;
  font-size: 10px;
  font-weight: 760;
  text-decoration: none;
}

.story-reference-list a:hover {
  border-color: #a88a4a;
  background: #ffffff;
}

.story-source-boundary {
  margin-top: 34px;
  border-left: 3px solid #4b8170;
  background: #edf1ed;
  padding: 15px 17px;
}

.story-source-boundary strong {
  color: #315d50;
  font-size: 10px;
  text-transform: uppercase;
}

.story-source-boundary p {
  margin: 6px 0 0;
  color: #53605b;
  font-size: 12px;
  line-height: 1.55;
}

.story-chapter-controls {
  display: grid;
  max-width: 850px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 auto;
  padding: 0 clamp(28px, 6vw, 70px) 70px;
}

.story-chapter-controls button {
  display: flex;
  min-width: 0;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #d8d4c8;
  border-radius: 7px;
  background: #ffffff;
  color: #262823;
  padding: 11px 14px;
  text-align: left;
}

.story-chapter-controls button:last-child {
  text-align: right;
}

.story-chapter-controls button:hover {
  border-color: #ad9a6a;
}

.story-chapter-controls button:disabled {
  cursor: default;
  opacity: 0.38;
}

.story-chapter-controls small,
.story-chapter-controls strong {
  display: block;
}

.story-chapter-controls small {
  color: #84827a;
  font-size: 9px;
  text-transform: uppercase;
}

.story-chapter-controls strong {
  margin-top: 3px;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-chapter-controls > button > span:first-child:last-child,
.story-chapter-controls > button > span:last-child:first-child {
  font-size: 23px;
}

.story-audio-player {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(190px, 260px) 40px 54px 40px minmax(180px, 1fr) auto 66px;
  align-items: center;
  gap: 10px;
  min-height: 78px;
  padding: 10px max(18px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  border-top: 1px solid #30322d;
  background: #171915;
  color: #f3f0e8;
}

.story-audio-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.story-audio-identity > span:last-child {
  min-width: 0;
}

.story-audio-identity small,
.story-audio-identity strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-audio-identity small {
  color: #96978f;
  font-size: 9px;
}

.story-audio-identity strong {
  margin-top: 3px;
  font-size: 11px;
}

.story-audio-art {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(202, 168, 92, 0.38);
  border-radius: 7px;
  background: #263b32;
}

.story-audio-art::before,
.story-audio-art::after,
.story-audio-art i {
  position: absolute;
  width: 1px;
  height: 24px;
  content: "";
  background: #d3b56d;
}

.story-audio-art::before {
  transform: rotate(45deg);
}

.story-audio-art::after {
  transform: rotate(-45deg);
}

.story-audio-art i {
  height: 30px;
}

.story-audio-play,
.story-audio-skip {
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.story-audio-play {
  width: 54px;
  height: 54px;
  border: 0;
  background: #d0ad5c;
  color: #171815;
}

.story-audio-play:hover {
  background: #e0c173;
}

.story-audio-play:disabled {
  cursor: wait;
  opacity: 0.5;
}

.story-play-icon {
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid currentColor;
}

.story-audio-play.playing .story-play-icon {
  width: 12px;
  height: 16px;
  margin-left: 0;
  border: 0;
  border-left: 4px solid currentColor;
  border-right: 4px solid currentColor;
}

.story-audio-play.loading .story-play-icon {
  width: 18px;
  height: 18px;
  margin-left: 0;
  border: 2px solid rgba(23, 24, 21, 0.28);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.story-audio-skip {
  position: relative;
  width: 40px;
  height: 40px;
  border: 1px solid #3d4039;
  background: #20221e;
  color: #cbc9c1;
  font-size: 19px;
}

.story-audio-skip small {
  position: absolute;
  font-size: 7px;
  font-weight: 800;
}

.story-audio-skip:hover {
  border-color: #716039;
  color: #ffffff;
}

.story-audio-timeline {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.story-audio-timeline input {
  width: 100%;
  accent-color: #caa85c;
  cursor: pointer;
}

.story-audio-timeline > span {
  display: flex;
  gap: 4px;
  color: #8e9088;
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.story-audio-timeline i {
  font-style: normal;
}

.story-auto-continue {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #aaa9a2;
  font-size: 9px;
  white-space: nowrap;
}

.story-auto-continue input {
  width: 16px;
  height: 16px;
  accent-color: #caa85c;
}

.story-speed select {
  width: 66px;
  height: 36px;
  border: 1px solid #3e403a;
  border-radius: 6px;
  background: #22241f;
  color: #e9e6dc;
  padding: 0 7px;
}

.calendar-dialog {
  width: min(720px, calc(100% - 30px));
  max-height: min(880px, calc(100dvh - 30px));
  overflow: hidden;
  border: 1px solid #30312c;
  border-radius: 8px;
  background: #f7f6f1;
  color: #191a17;
  padding: 0;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
}

.calendar-dialog::backdrop {
  background: rgba(15, 15, 13, 0.62);
  backdrop-filter: blur(8px);
}

.calendar-shell {
  display: grid;
  max-height: inherit;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.calendar-header,
.calendar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.calendar-header {
  border-bottom: 1px solid #30312c;
  background: #171915;
  color: #f4f0e6;
  padding: 16px 20px;
}

.calendar-header p,
.calendar-header h2 {
  margin: 0;
}

.calendar-header p {
  color: #d0ad5e;
  font-size: 9px;
  font-weight: 820;
  text-transform: uppercase;
}

.calendar-header h2 {
  margin-top: 3px;
  font-size: 18px;
}

.calendar-close {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #3d3e38;
  border-radius: 50%;
  background: #22241f;
  color: #dedbd2;
  font-size: 23px;
}

.calendar-content {
  overflow-y: auto;
  padding-bottom: 24px;
}

.calendar-art {
  width: 100%;
  height: 190px;
  background-position-y: center;
}

.calendar-date-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #dfdcd1;
  padding: 14px 22px;
}

.calendar-date-line strong {
  font-size: 11px;
}

.calendar-date-line span {
  color: #7a5d21;
  font-size: 11px;
  font-weight: 750;
  text-align: right;
}

.calendar-event-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 18px 22px 0;
}

.calendar-event-tabs button {
  min-height: 32px;
  border: 1px solid #d9d3c3;
  border-radius: 999px;
  background: #fffdf7;
  color: #665a3d;
  padding: 0 11px;
  font-size: 9px;
  font-weight: 730;
}

.calendar-event-tabs button.active {
  border-color: #92712c;
  background: #2b3e36;
  color: #f1dfad;
}

.calendar-event-detail {
  padding: 24px 22px 0;
}

.calendar-event-detail > p {
  margin: 0;
  color: #8c6b25;
  font-size: 9px;
  font-weight: 820;
  text-transform: uppercase;
}

.calendar-event-detail h3 {
  margin: 7px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  font-weight: 520;
}

.calendar-summary {
  max-width: 620px;
  margin-top: 15px;
  color: #4c4e48;
  font-size: 14px;
  line-height: 1.65;
}

.calendar-guidance-list {
  display: grid;
  margin-top: 24px;
  border-top: 1px solid #ddd9cd;
}

.calendar-guidance-item {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  gap: 11px;
  border-bottom: 1px solid #ddd9cd;
  padding: 14px 0;
}

.calendar-guidance-number {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid #9b7b38;
  border-radius: 50%;
  color: #806324;
  font-size: 8px;
  font-weight: 820;
}

.calendar-guidance-item strong,
.calendar-guidance-item span {
  display: block;
}

.calendar-guidance-item strong {
  font-size: 12px;
}

.calendar-guidance-item span {
  margin-top: 4px;
  color: #676861;
  font-size: 11px;
  line-height: 1.55;
}

.calendar-evidence {
  margin-top: 22px;
}

.calendar-evidence > span {
  color: #77776f;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.calendar-evidence > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.calendar-reference {
  border: 1px solid #d8ccae;
  border-radius: 999px;
  background: #fffdf7;
  color: #72561f;
  padding: 6px 9px;
  font-size: 9px;
  font-weight: 740;
}

.calendar-limit {
  margin-top: 22px;
  border-left: 3px solid #b89950;
  background: #f3eee1;
  color: #62563b;
  padding: 13px 15px;
  font-size: 10px;
  line-height: 1.55;
}

.calendar-footer {
  border-top: 1px solid #dfdcd1;
  background: #ffffff;
  padding: 11px 20px max(11px, env(safe-area-inset-bottom));
}

.calendar-footer p {
  max-width: 470px;
  margin: 0;
  color: #7a7972;
  font-size: 9px;
  line-height: 1.45;
}

.calendar-footer button {
  min-height: 38px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 6px;
  background: #171915;
  color: #f3efe5;
  padding: 0 14px;
  font-size: 10px;
  font-weight: 730;
}

.prayer-dialog {
  width: min(760px, calc(100% - 30px));
  max-height: min(820px, calc(100dvh - 30px));
  overflow: hidden;
  border: 1px solid #2d2e2a;
  border-radius: 8px;
  background: #171815;
  color: #f6f2e8;
  padding: 0;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.4);
}

.prayer-dialog::backdrop {
  background: rgba(15, 15, 13, 0.62);
  backdrop-filter: blur(8px);
}

.prayer-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: inherit;
}

.prayer-header,
.prayer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
}

.prayer-header {
  border-bottom: 1px solid #2d2e2a;
}

.prayer-header p,
.prayer-header h2 {
  margin: 0;
}

.prayer-header p {
  color: #caa85c;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.prayer-header h2 {
  margin-top: 4px;
  font-size: 20px;
  letter-spacing: 0;
}

.prayer-close {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid #393a35;
  border-radius: 6px;
  background: #22231f;
  color: #dedbd2;
  font-size: 24px;
}

.prayer-close:hover {
  border-color: #6d5a2f;
  background: #2a2922;
}

.prayer-content {
  overflow-y: auto;
  padding: 24px 22px 30px;
}

.prayer-location-panel {
  display: grid;
  gap: 17px;
}

.prayer-location-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.prayer-location-heading strong,
.prayer-location-heading span {
  display: block;
}

.prayer-location-heading strong {
  font-size: 18px;
}

.prayer-location-heading span {
  margin-top: 4px;
  color: #9a9993;
  font-size: 11px;
}

.prayer-location-heading button,
.prayer-location-search button {
  min-height: 40px;
  border: 1px solid #8b7136;
  border-radius: 6px;
  background: #2d271a;
  color: #e6ca85;
  padding: 0 14px;
  font-weight: 700;
}

.prayer-location-heading button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.prayer-location-heading button:hover,
.prayer-location-search button:hover {
  background: #382f1d;
}

.location-arrow-icon {
  width: 0;
  height: 0;
  border-right: 5px solid transparent;
  border-bottom: 13px solid currentColor;
  border-left: 5px solid transparent;
  transform: rotate(38deg);
}

.prayer-location-search {
  display: grid;
  gap: 7px;
}

.prayer-location-search > label {
  color: #aaa8a0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.prayer-location-search > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.prayer-location-search input,
.prayer-settings select {
  min-width: 0;
  height: 42px;
  border: 1px solid #3a3b36;
  border-radius: 6px;
  outline: none;
  background: #20211f;
  color: #f5f2e9;
  padding: 0 12px;
  font: inherit;
}

.prayer-location-search input:focus,
.prayer-settings select:focus {
  border-color: #8e7439;
  box-shadow: 0 0 0 3px rgba(202, 168, 92, 0.1);
}

.prayer-location-results {
  display: grid;
  border: 1px solid #393a35;
  border-radius: 6px;
  overflow: hidden;
}

.prayer-location-results[hidden] {
  display: none;
}

.prayer-location-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 45px;
  border: 0;
  border-bottom: 1px solid #30312d;
  background: #20211f;
  color: #f1eee5;
  padding: 8px 12px;
  text-align: left;
}

.prayer-location-result:last-child {
  border-bottom: 0;
}

.prayer-location-result:hover {
  background: #292923;
}

.prayer-location-result strong,
.prayer-location-result small {
  display: block;
}

.prayer-location-result small {
  margin-top: 2px;
  color: #96958f;
}

.prayer-location-result > span {
  color: #b5a376;
  font-size: 10px;
}

.prayer-status {
  min-height: 18px;
  color: #999892;
  font-size: 11px;
  margin: 0;
}

.prayer-status.error {
  color: #e3a39c;
}

.prayer-next {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 4px 16px;
  margin: 23px 0 13px;
  border-top: 1px solid #30312d;
  border-bottom: 1px solid #30312d;
  padding: 17px 0;
}

.prayer-next span,
.prayer-next p {
  color: #999892;
  font-size: 10px;
}

.prayer-next strong {
  grid-row: 1 / span 2;
  grid-column: 2;
  color: #e3c477;
  font-size: 22px;
}

.prayer-next p {
  margin: 0;
}

.qibla-panel {
  display: grid;
  gap: 18px;
  margin: 22px 0;
  border: 1px solid #35362f;
  border-radius: 7px;
  background: #1d1f1b;
  padding: 18px;
}

.qibla-panel[hidden] {
  display: none;
}

.qibla-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.qibla-heading h3,
.qibla-heading span {
  display: block;
  margin: 0;
}

.qibla-heading h3 {
  margin-top: 4px;
  font-size: 14px;
}

.qibla-heading span {
  color: #979790;
  font-size: 10px;
  line-height: 1.45;
}

.qibla-heading button {
  min-height: 38px;
  flex: 0 0 auto;
  border: 1px solid #766130;
  border-radius: 6px;
  background: #2b261a;
  color: #e0c57e;
  padding: 0 13px;
  font-size: 10px;
  font-weight: 760;
}

.qibla-heading button:hover {
  background: #37301d;
}

.qibla-heading button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.qibla-content {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
}

.qibla-compass {
  position: relative;
  width: 164px;
  height: 164px;
  border: 1px solid #4b4c43;
  border-radius: 50%;
  background: #151814;
  box-shadow: inset 0 0 0 8px #1f221e, 0 16px 34px rgba(0, 0, 0, 0.16);
}

.qibla-compass::before,
.qibla-compass::after {
  position: absolute;
  z-index: 0;
  content: "";
  background: #343832;
}

.qibla-compass::before {
  top: 20px;
  bottom: 20px;
  left: 50%;
  width: 1px;
}

.qibla-compass::after {
  top: 50%;
  right: 20px;
  left: 20px;
  height: 1px;
}

.qibla-compass-ring {
  position: absolute;
  z-index: 1;
  inset: 13px;
  border: 1px solid #3d4139;
  border-radius: 50%;
}

.qibla-target-zone {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 50%;
  width: 38px;
  height: 25px;
  border-top: 2px solid #b8964e;
  border-right: 2px solid #b8964e;
  border-left: 2px solid #b8964e;
  border-radius: 18px 18px 5px 5px;
  opacity: 0.62;
  transform: translateX(-50%);
}

.qibla-needle {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  width: 122px;
  height: 122px;
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(0deg);
  transition: transform 90ms linear;
  will-change: transform;
}

.qibla-kaaba {
  position: absolute;
  z-index: 3;
  top: -2px;
  left: 50%;
  width: 26px;
  height: 23px;
  border: 1px solid #d4b15d;
  border-radius: 2px;
  background: #090a08;
  box-shadow: 0 5px 13px rgba(0, 0, 0, 0.34);
  transform: translateX(-50%);
}

.qibla-kaaba::before {
  position: absolute;
  top: 6px;
  right: -1px;
  left: -1px;
  height: 4px;
  content: "";
  border-top: 1px solid #efd58e;
  border-bottom: 1px solid #6f5725;
  background: #bc9344;
}

.qibla-kaaba::after {
  position: absolute;
  right: 4px;
  bottom: 0;
  width: 5px;
  height: 9px;
  content: "";
  border: 1px solid #9c7b38;
  border-bottom: 0;
  background: #17130b;
}

.qibla-kaaba i {
  position: absolute;
  top: 13px;
  left: 5px;
  width: 5px;
  height: 5px;
  border: 1px solid #8d7137;
  border-radius: 50%;
}

.qibla-pointer,
.qibla-tail {
  position: absolute;
  z-index: 1;
  left: 50%;
  border-radius: 99px;
  transform: translateX(-50%);
}

.qibla-pointer {
  top: 22px;
  width: 4px;
  height: 40px;
  background: #d2af5d;
  box-shadow: 0 0 8px rgba(210, 175, 93, 0.24);
}

.qibla-tail {
  top: 64px;
  width: 3px;
  height: 43px;
  background: #52625a;
}

.qibla-center {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  border: 3px solid #171915;
  border-radius: 50%;
  background: #d6ba74;
  transform: translate(-50%, -50%);
}

.qibla-compass.aligned {
  border-color: #70ad93;
  box-shadow: inset 0 0 0 8px #1f221e, 0 0 0 4px rgba(112, 173, 147, 0.13), 0 0 30px rgba(112, 173, 147, 0.16);
}

.qibla-compass.aligned .qibla-target-zone {
  border-color: #86c9ab;
  opacity: 1;
  animation: qibla-target-pulse 1.5s ease-in-out infinite;
}

.qibla-compass.aligned .qibla-kaaba {
  border-color: #f0d17f;
  box-shadow: 0 0 0 4px rgba(112, 173, 147, 0.14), 0 0 22px rgba(240, 209, 127, 0.32);
}

.qibla-compass.active:not(.aligned) {
  border-color: #665d43;
  box-shadow: inset 0 0 0 8px #1f221e, 0 0 0 4px rgba(202, 168, 92, 0.08);
}

@keyframes qibla-target-pulse {
  0%,
  100% {
    box-shadow: 0 -3px 10px rgba(134, 201, 171, 0.06);
  }

  50% {
    box-shadow: 0 -3px 18px rgba(134, 201, 171, 0.38);
  }
}

.qibla-copy strong,
.qibla-copy span,
.qibla-copy p {
  display: block;
}

.qibla-copy strong {
  color: #f1ede3;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.qibla-copy span {
  margin-top: 5px;
  color: #d4b86f;
  font-size: 12px;
  font-weight: 720;
}

.qibla-alignment-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin-top: 11px;
  border: 1px solid #48483e;
  border-radius: 999px;
  background: #24251f;
  color: #bab9ae;
  padding: 6px 10px;
  font-size: 9px;
  font-weight: 760;
}

.qibla-alignment-status i {
  position: relative;
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border: 1px solid #8f7740;
  border-radius: 50%;
}

.qibla-alignment-status i::before {
  position: absolute;
  top: 2px;
  left: 4px;
  width: 3px;
  height: 5px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  color: transparent;
  content: "";
  transform: rotate(45deg);
}

.qibla-alignment-status.aligned {
  border-color: #547f6c;
  background: #1b2b24;
  color: #9fd0ba;
}

.qibla-alignment-status.aligned i {
  border-color: #79b79d;
  background: #79b79d;
}

.qibla-alignment-status.aligned i::before {
  color: #101713;
}

.qibla-alignment-status span {
  margin: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.qibla-copy p {
  max-width: 390px;
  margin-top: 12px;
  margin-bottom: 0;
  color: #92938c;
  font-size: 10px;
  line-height: 1.55;
}

.qibla-panel.error .qibla-copy p {
  color: #e0a09a;
}

.prayer-time-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid #30312d;
  border-radius: 6px;
  background: #30312d;
  list-style: none;
  margin: 0;
  padding: 0;
}

.prayer-time-item {
  display: grid;
  gap: 8px;
  min-width: 0;
  background: #1c1d1a;
  padding: 14px;
}

.prayer-time-item.active {
  background: #29261e;
}

.prayer-time-item span {
  color: #9b9a94;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.prayer-time-item strong {
  font-size: 18px;
  letter-spacing: 0;
}

.prayer-time-item small {
  color: #777771;
  font-size: 9px;
}

.prayer-monthly {
  margin-top: 18px;
  border: 1px solid #30312d;
  border-radius: 6px;
  background: #191a17;
}

.prayer-monthly-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
  border-bottom: 1px solid #30312d;
  padding: 12px 14px;
}

.prayer-monthly-header span,
.prayer-monthly-header h3 {
  display: block;
}

.prayer-monthly-header span {
  color: #95958e;
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
}

.prayer-monthly-header h3 {
  margin: 4px 0 0;
  color: #f2eee4;
  font-size: 16px;
}

.prayer-monthly-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.prayer-monthly-controls button {
  display: grid;
  min-width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #3b3a34;
  border-radius: 6px;
  background: #22231f;
  color: #e4c878;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 750;
}

.prayer-monthly-controls button:hover:not(:disabled) {
  border-color: #716342;
  background: #2a281f;
}

.prayer-monthly-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.prayer-monthly-table-wrap {
  position: relative;
  max-height: 390px;
  overflow: auto;
}

.prayer-monthly-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  color: #d9d6cd;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.prayer-monthly-table th,
.prayer-monthly-table td {
  border-bottom: 1px solid #292a26;
  padding: 9px 12px;
  text-align: right;
  white-space: nowrap;
}

.prayer-monthly-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 105px;
  background: #191a17;
  text-align: left;
}

.prayer-monthly-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #20211d;
  color: #92928b;
  font-size: 9px;
  text-transform: uppercase;
}

.prayer-monthly-table thead th:first-child {
  z-index: 3;
  background: #20211d;
}

.prayer-monthly-table tbody tr.today th,
.prayer-monthly-table tbody tr.today td {
  background: #2b271d;
  color: #f0d388;
  font-weight: 750;
}

.prayer-monthly-table tbody tr.today th:first-child {
  box-shadow: inset 3px 0 #d1ac55;
}

.prayer-monthly-empty {
  margin: 0;
  padding: 30px 16px;
  color: #8e8e87;
  font-size: 11px;
  text-align: center;
}

.prayer-settings {
  margin-top: 18px;
  border-top: 1px solid #30312d;
  padding-top: 15px;
}

.prayer-settings summary {
  color: #c8b270;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.prayer-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.prayer-settings-grid label {
  display: grid;
  gap: 7px;
}

.prayer-settings-grid label > span {
  color: #9b9a94;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.prayer-footer {
  align-items: flex-start;
  border-top: 1px solid #2d2e2a;
  color: #85847e;
  font-size: 9px;
  line-height: 1.5;
}

.prayer-footer p {
  max-width: 560px;
  margin: 0;
}

.prayer-footer a {
  color: #b49a5c;
  white-space: nowrap;
}

.prayer-footer > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 14px;
}

.voice-dialog {
  --celestial-core: rgba(255, 246, 203, 0.9);
  --celestial-middle: rgba(241, 196, 91, 0.62);
  --celestial-edge: rgba(202, 139, 34, 0.18);
  --celestial-glint: rgba(255, 255, 250, 0.92);
  --celestial-depth: rgba(120, 73, 11, 0.22);
  --celestial-halo: rgba(242, 201, 107, 0.5);
  --celestial-aura: rgba(213, 159, 55, 0.28);
  --celestial-ray: rgba(255, 237, 185, 0.34);
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #080a09;
  color: #f5f3ec;
  border-radius: 0;
  box-shadow: none;
}

.voice-dialog[data-celestial="dawn"] {
  --celestial-core: rgba(255, 244, 213, 0.92);
  --celestial-middle: rgba(230, 181, 122, 0.6);
  --celestial-edge: rgba(157, 99, 83, 0.18);
  --celestial-glint: rgba(255, 254, 248, 0.9);
  --celestial-depth: rgba(92, 60, 74, 0.2);
  --celestial-halo: rgba(240, 198, 137, 0.46);
  --celestial-aura: rgba(177, 126, 128, 0.25);
  --celestial-ray: rgba(255, 232, 190, 0.32);
}

.voice-dialog[data-celestial="dusk"] {
  --celestial-core: rgba(255, 230, 183, 0.88);
  --celestial-middle: rgba(205, 149, 100, 0.58);
  --celestial-edge: rgba(86, 72, 103, 0.2);
  --celestial-glint: rgba(255, 247, 226, 0.86);
  --celestial-depth: rgba(50, 46, 72, 0.25);
  --celestial-halo: rgba(222, 166, 111, 0.43);
  --celestial-aura: rgba(113, 94, 126, 0.25);
  --celestial-ray: rgba(244, 205, 157, 0.28);
}

.voice-dialog[data-celestial="moon"] {
  --celestial-core: rgba(245, 247, 238, 0.9);
  --celestial-middle: rgba(194, 203, 199, 0.58);
  --celestial-edge: rgba(110, 130, 135, 0.16);
  --celestial-glint: rgba(255, 255, 249, 0.88);
  --celestial-depth: rgba(35, 52, 57, 0.3);
  --celestial-halo: rgba(199, 211, 202, 0.34);
  --celestial-aura: rgba(113, 139, 142, 0.22);
  --celestial-ray: rgba(223, 226, 208, 0.2);
}

.companion-dialog::backdrop,
.account-dialog::backdrop,
.onboarding-dialog::backdrop {
  background: rgba(12, 12, 12, 0.62);
  backdrop-filter: blur(4px);
}

.voice-dialog::backdrop {
  background: #080a09;
}

.voice-shell {
  position: relative;
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
}

.voice-floating-actions {
  position: absolute;
  z-index: 8;
  top: max(20px, env(safe-area-inset-top));
  right: max(20px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.58;
  transition: opacity 160ms ease;
}

.voice-floating-actions:hover,
.voice-floating-actions:focus-within {
  opacity: 1;
}

.voice-close,
.voice-settings-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(235, 231, 216, 0.12);
  background: rgba(25, 28, 26, 0.58);
  color: #d5d3cb;
  border-radius: 50%;
  backdrop-filter: blur(12px);
  font-size: 20px;
  line-height: 1;
}

.voice-settings-button {
  font-size: 15px;
}

.voice-close:hover,
.voice-settings-button:hover {
  border-color: rgba(226, 195, 119, 0.42);
  background: rgba(38, 41, 37, 0.86);
  color: #ffffff;
}

.voice-settings-button:disabled {
  cursor: wait;
  opacity: 0.45;
}

.voice-settings-panel {
  position: absolute;
  z-index: 10;
  top: max(72px, calc(env(safe-area-inset-top) + 64px));
  right: max(20px, env(safe-area-inset-right));
  display: grid;
  width: min(330px, calc(100% - 40px));
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(226, 195, 119, 0.2);
  background: rgba(22, 24, 22, 0.94);
  border-radius: 12px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(20px);
}

.voice-settings-panel[hidden] {
  display: none;
}

.voice-settings-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.voice-settings-heading strong,
.voice-settings-heading small {
  display: block;
}

.voice-settings-heading strong {
  color: #f3f0e8;
  font-size: 14px;
}

.voice-settings-heading small {
  margin-top: 3px;
  color: #96948c;
  font-size: 11px;
}

.voice-companion-meta {
  display: flex !important;
  align-items: center;
  gap: 5px;
}

.voice-companion-meta [lang="ar"] {
  color: #d9bd76;
  font-family: "Geeza Pro", "Noto Naskh Arabic", Tahoma, sans-serif;
  font-size: 13px;
  line-height: 1;
}

.voice-settings-heading button {
  border: 0;
  background: transparent;
  color: #aaa89f;
  padding: 0 2px;
  font-size: 20px;
  line-height: 1;
}

.voice-settings-panel .voice-preview-button {
  width: 100%;
}

.voice-settings-panel > p {
  margin: 0;
  color: #85837c;
  font-size: 10px;
  line-height: 1.45;
}

.voice-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
}

.voice-form {
  --voice-expansion: 0;
  position: relative;
  display: grid;
  width: clamp(210px, 24vw, 320px);
  aspect-ratio: 1;
  place-items: center;
  transform: scale(calc(0.96 + var(--voice-expansion)));
  transform-origin: center;
  transition: transform 90ms linear, filter 360ms ease;
  will-change: transform;
  isolation: isolate;
}

.voice-form::before,
.voice-form::after {
  position: absolute;
  z-index: 0;
  content: "";
  pointer-events: none;
  border-radius: 50%;
}

.voice-form::before {
  inset: 4%;
  background: radial-gradient(
    circle,
    var(--celestial-glint) 0 5%,
    var(--celestial-halo) 24%,
    var(--celestial-aura) 48%,
    transparent 77%
  );
  filter: blur(34px);
  transform: scale(2.08);
  opacity: 0.82;
}

.voice-form::after {
  inset: 8%;
  background:
    conic-gradient(
      from 10deg,
      transparent 0 7%,
      var(--celestial-ray) 11%,
      transparent 16% 29%,
      var(--celestial-ray) 34%,
      transparent 39% 55%,
      var(--celestial-ray) 60%,
      transparent 65% 82%,
      var(--celestial-ray) 88%,
      transparent 94%
    );
  -webkit-mask-image: radial-gradient(circle, transparent 0 26%, #000 48%, transparent 82%);
  mask-image: radial-gradient(circle, transparent 0 26%, #000 48%, transparent 82%);
  filter: blur(25px);
  transform: scale(2.48);
  opacity: 0.72;
}

.voice-form-shadow {
  position: absolute;
  z-index: 1;
  display: block;
  inset: 20%;
  background: radial-gradient(
    circle,
    var(--celestial-halo),
    var(--celestial-aura) 44%,
    transparent 76%
  );
  border-radius: 50%;
  filter: blur(58px);
  transform: scale(2.16);
  opacity: 0.76;
}

.voice-form-body {
  position: absolute;
  z-index: 2;
  inset: 11%;
  display: block;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 31% 27%,
      var(--celestial-glint) 0 6%,
      color-mix(in srgb, var(--celestial-glint) 62%, transparent) 17%,
      transparent 38%
    ),
    radial-gradient(
      circle at 50% 48%,
      var(--celestial-core) 0 25%,
      var(--celestial-middle) 54%,
      var(--celestial-edge) 76%,
      transparent 100%
    );
  background-size: 138% 138%, 112% 112%;
  background-position: 30% 26%, center;
  border: 0;
  border-radius: 50%;
  -webkit-mask-image: radial-gradient(circle at center, #000 0 48%, rgba(0, 0, 0, 0.9) 66%, rgba(0, 0, 0, 0.28) 86%, transparent 100%);
  mask-image: radial-gradient(circle at center, #000 0 48%, rgba(0, 0, 0, 0.9) 66%, rgba(0, 0, 0, 0.28) 86%, transparent 100%);
  box-shadow:
    inset 18px 14px 44px color-mix(in srgb, var(--celestial-glint) 46%, transparent),
    inset -24px -28px 56px var(--celestial-depth);
  filter:
    drop-shadow(0 0 22px var(--celestial-halo))
    drop-shadow(0 0 64px var(--celestial-aura));
  transform: scale(0.98);
  opacity: 0.94;
  transition: background-position 500ms ease, filter 400ms ease;
  will-change: transform;
}

.voice-form-body::before {
  position: absolute;
  content: "";
  inset: 16%;
  background:
    linear-gradient(35deg, transparent 30%, color-mix(in srgb, var(--celestial-glint) 36%, transparent) 50%, transparent 70%);
  border-radius: 50%;
  filter: blur(9px);
  opacity: 0.42;
  transform: rotate(10deg);
}

.voice-form-body::after {
  position: absolute;
  content: "";
  inset: -8% -18% -8% 34%;
  display: none;
  background: radial-gradient(circle at 12% 50%, rgba(8, 10, 10, 0.05), rgba(8, 12, 13, 0.62) 70%);
  border-radius: 50%;
  filter: blur(14px);
}

.voice-dialog[data-celestial="moon"] .voice-form-body::after {
  display: block;
}

.voice-form-light,
.voice-form-depth {
  position: absolute;
  display: block;
  border-radius: 50%;
  pointer-events: none;
}

.voice-form-light {
  top: 17%;
  left: 20%;
  width: 34%;
  height: 24%;
  background: var(--celestial-glint);
  filter: blur(24px);
  opacity: 0.58;
  transform: rotate(-20deg);
}

.voice-form-depth {
  right: 15%;
  bottom: 14%;
  width: 44%;
  height: 34%;
  background: var(--celestial-depth);
  filter: blur(34px);
}

.voice-dialog[data-voice-state="listening"] .voice-form-body {
  animation: furqan-form-listen 3.4s ease-in-out infinite;
}

.voice-dialog[data-voice-state="speaking"] .voice-form-body {
  animation: furqan-form-speak 980ms ease-in-out infinite alternate;
}

.voice-dialog[data-voice-state="speaking"] .voice-form-shadow {
  animation: furqan-shadow-speak 1100ms ease-in-out infinite alternate;
}

.voice-dialog[data-voice-state="speaking"] .voice-form::before {
  animation: furqan-aura-speak 920ms ease-in-out infinite alternate;
}

.voice-dialog[data-voice-state="speaking"] .voice-form::after {
  animation: furqan-aura-speak 1260ms ease-in-out -240ms infinite alternate-reverse;
}

.voice-dialog[data-voice-state="listening"] .voice-form::before,
.voice-dialog[data-voice-state="thinking"] .voice-form::before,
.voice-dialog[data-voice-state="transcribing"] .voice-form::before {
  animation: furqan-aura-breathe 2.8s ease-in-out infinite;
}

.voice-dialog[data-voice-state="thinking"] .voice-form-body,
.voice-dialog[data-voice-state="transcribing"] .voice-form-body {
  animation: furqan-form-think 1.7s ease-in-out infinite;
}

.voice-dialog[data-voice-state="paused"] .voice-form {
  filter: saturate(0.72) brightness(0.88);
}

.voice-dialog[data-voice-state="error"] .voice-form {
  filter: saturate(0.82) brightness(0.94);
}

.voice-dialog[data-voice-state="error"] .voice-form-body {
  border-color: rgba(193, 100, 88, 0.45);
}

.voice-footer {
  position: absolute;
  z-index: 7;
  left: 50%;
  bottom: max(26px, calc(env(safe-area-inset-bottom) + 18px));
  display: grid;
  justify-items: center;
  padding: 0;
  transform: translateX(-50%);
}

.voice-choice {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.voice-choice > span {
  color: #9c9a92;
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.voice-choice select {
  width: 100%;
  min-width: 0;
  height: 42px;
  border: 1px solid #44423c;
  background: #222220;
  color: #f1eee5;
  padding: 0 11px;
  border-radius: 8px;
  color-scheme: dark;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  outline: none;
  text-overflow: ellipsis;
}

.voice-choice select:hover,
.voice-choice select:focus-visible {
  border-color: #6c675b;
}

.voice-choice select:focus-visible {
  box-shadow: 0 0 0 3px rgba(202, 168, 92, 0.15);
}

.voice-preview-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 96px;
  height: 42px;
  border: 1px solid rgba(202, 168, 92, 0.52);
  background: rgba(202, 168, 92, 0.1);
  color: #e9ca80;
  padding: 0 13px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 750;
}

.voice-preview-button:hover {
  border-color: rgba(226, 194, 119, 0.75);
  background: rgba(202, 168, 92, 0.16);
}

.voice-preview-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.voice-play-icon {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid currentColor;
}

.voice-preview-button.busy .voice-play-icon {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(233, 202, 128, 0.35);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: voice-preview-spin 700ms linear infinite;
}

.voice-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.voice-control-button {
  position: relative;
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border: 1px solid #44423c;
  background: #282724;
  color: #f1eee5;
  border-radius: 50%;
}

.voice-control-button:hover {
  border-color: #5b584f;
  background: #32312d;
}

.voice-control-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.voice-control-button.paused {
  border-color: rgba(202, 168, 92, 0.7);
  color: #e3c375;
}

.voice-control-button.interrupt {
  border-color: #76978d;
  color: #9fc2b7;
}

.voice-end-button {
  width: 52px;
  height: 52px;
  border-color: #74413d;
  background: #572f2c;
  color: #ffe7e3;
}

.voice-end-button:hover {
  border-color: #8c4c47;
  background: #683733;
}

.voice-end-button > span {
  width: 14px;
  height: 14px;
  background: currentColor;
  border-radius: 2px;
}

.voice-mic-icon {
  position: relative;
  width: 13px;
  height: 19px;
  border: 2px solid currentColor;
  border-radius: 8px;
}

.voice-mic-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 17px;
  height: 9px;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
  border-radius: 0 0 9px 9px;
  transform: translateX(-50%);
}

.voice-control-button.paused .voice-mic-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: -5px;
  width: 2px;
  height: 27px;
  background: currentColor;
  transform: rotate(-42deg);
}

.voice-privacy {
  max-width: 520px;
  margin: 0;
  color: #85837c;
  font-size: 10px;
  line-height: 1.45;
  text-align: center;
}

.dialog-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(880px, calc(100vh - 32px));
}

.account-dialog {
  width: min(520px, calc(100% - 32px));
}

.account-dialog-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: min(760px, calc(100vh - 32px));
}

.account-dialog-content {
  display: grid;
  gap: 14px;
  overflow: auto;
  padding: 20px;
}

.account-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  padding: 3px;
  background: #efefef;
  border-radius: 8px;
}

.account-mode-tabs button {
  min-height: 36px;
  border: 0;
  background: transparent;
  color: #666666;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 750;
}

.account-mode-tabs button.active {
  background: #ffffff;
  color: #111111;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

#accountForm {
  display: grid;
  gap: 13px;
}

.account-primary-button,
.apple-sign-in-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 750;
}

.apple-sign-in-button[hidden],
.account-name-field[hidden] {
  display: none;
}

.account-primary-button {
  border: 0;
  background: #171717;
  color: #ffffff;
}

.account-primary-button:hover {
  background: #2b2b2b;
}

.account-primary-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.apple-sign-in-button {
  gap: 9px;
  border: 1px solid #171717;
  background: #ffffff;
  color: #171717;
}

.apple-sign-in-button:hover {
  background: #f5f5f5;
}

.apple-sign-in-button > span:first-child {
  font-size: 10px;
}

.account-text-button {
  justify-self: center;
  border: 0;
  background: transparent;
  color: #5f5f5f;
  padding: 4px;
  font-size: 12px;
  font-weight: 700;
}

.account-text-button:hover {
  color: #111111;
  text-decoration: underline;
}

.account-form-status {
  min-height: 18px;
  margin: 0;
  color: #555555;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.account-form-status.error {
  color: #9a3d37;
}

.account-form-status.success {
  color: #176b55;
}

.account-privacy-copy {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

.account-privacy-copy a,
.legal-links a {
  color: #6e521d;
}

.dialog-header,
.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  background: #ffffff;
}

.dialog-header {
  border-bottom: 1px solid var(--border);
}

.dialog-header h2,
.onboarding-shell h2 {
  margin: 3px 0 0;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: 0;
}

.dialog-eyebrow {
  margin: 0;
  color: #8a6929;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dialog-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: #333333;
  border-radius: 8px;
  font-size: 23px;
  line-height: 1;
}

.dialog-close:hover {
  background: #f5f5f5;
}

.dialog-content {
  overflow: auto;
  padding: 0 20px;
}

.settings-section {
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}

.settings-section:last-child {
  border-bottom: 0;
}

.account-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
}

.account-summary > div:first-child {
  min-width: 0;
}

.account-summary strong,
.account-summary small {
  display: block;
}

.account-summary strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-summary small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.account-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.account-actions button,
.subscription-links button {
  min-height: 34px;
  border: 1px solid #d8d8d8;
  background: #ffffff;
  color: #333333;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 750;
}

.account-actions button:hover,
.subscription-links button:hover {
  background: #f5f5f5;
}

.account-state-badge {
  flex: 0 0 auto;
  border: 1px solid #d8d8d8;
  background: #f7f7f7;
  color: #5f5f5f;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.account-state-badge.signed-in {
  border-color: rgba(27, 127, 100, 0.24);
  background: rgba(27, 127, 100, 0.07);
  color: #176b55;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.section-heading h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0;
}

.section-heading p,
.impact-note,
.dialog-footer p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.plan-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(202, 168, 92, 0.32);
  background: var(--gold-soft);
  color: #6e521d;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

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

.field-label {
  display: grid;
  gap: 7px;
}

.field-label > span,
.segmented-field legend {
  color: #343434;
  font-size: 12px;
  font-weight: 700;
}

.field-label small {
  color: var(--muted);
  font-weight: 500;
}

.field-label input {
  width: 100%;
  height: 42px;
  border: 1px solid #d8d8d8;
  background: #ffffff;
  color: var(--text);
  padding: 0 11px;
  border-radius: 8px;
  outline: none;
}

.field-label input:focus {
  border-color: #9b7b3b;
  box-shadow: 0 0 0 3px rgba(202, 168, 92, 0.12);
}

.segmented-field {
  margin: 16px 0 0;
  padding: 0;
  border: 0;
}

.segmented-field legend {
  margin-bottom: 7px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 3px;
  background: #efefef;
  border-radius: 8px;
}

.segmented-control label {
  min-width: 0;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-control span {
  display: grid;
  min-height: 34px;
  place-items: center;
  color: #626262;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.segmented-control input:checked + span {
  background: #ffffff;
  color: #111111;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

.segmented-control input:focus-visible + span {
  outline: 2px solid #9b7b3b;
  outline-offset: -2px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 62px;
  padding: 10px 0;
  border-top: 1px solid #eeeeee;
}

.toggle-row:first-of-type {
  border-top: 0;
}

.toggle-row span,
.toggle-row strong,
.toggle-row small {
  display: block;
}

.toggle-row strong {
  font-size: 13px;
}

.toggle-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.toggle-row input {
  appearance: none;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
  margin: 0;
  border: 1px solid #c4c4c4;
  background: #d7d7d7;
  border-radius: 999px;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.toggle-row input::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  margin: 2px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 160ms ease;
}

.toggle-row input:checked {
  border-color: #1b7f64;
  background: #1b7f64;
}

.toggle-row input:checked::before {
  transform: translateX(18px);
}

.toggle-row input:focus-visible {
  outline: 2px solid #9b7b3b;
  outline-offset: 2px;
}

.toggle-row input:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.memory-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 22px;
  margin-top: 10px;
}

.memory-chip,
.memory-empty {
  color: #555555;
  font-size: 11px;
}

.memory-chip {
  border: 1px solid rgba(27, 127, 100, 0.2);
  background: rgba(27, 127, 100, 0.06);
  padding: 6px 8px;
  border-radius: 999px;
}

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

.membership-option {
  display: grid;
  gap: 12px;
  min-height: 116px;
  border: 1px solid #dddddd;
  background: #ffffff;
  color: var(--text);
  padding: 14px;
  text-align: left;
  border-radius: 8px;
}

.membership-option.featured {
  border-color: rgba(202, 168, 92, 0.52);
  background: #fffdf8;
}

.membership-option:hover {
  border-color: #a9a9a9;
}

.membership-option.active {
  border-color: #1b7f64;
  box-shadow: inset 0 0 0 1px #1b7f64;
}

.membership-title,
.membership-title strong,
.membership-title small,
.membership-detail {
  display: block;
}

.membership-title strong {
  font-size: 14px;
}

.membership-title small,
.membership-detail {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.impact-note {
  border-left: 2px solid var(--gold);
  margin-top: 14px;
  padding: 3px 0 3px 10px;
  color: #574722;
}

.subscription-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.subscription-options[hidden] {
  display: none;
}

.subscription-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 62px;
  border: 1px solid #dddddd;
  background: #ffffff;
  color: var(--text);
  padding: 11px 12px;
  border-radius: 8px;
  text-align: left;
}

.subscription-button.recommended {
  border-color: rgba(202, 168, 92, 0.52);
  background: #fffdf8;
}

.subscription-button:hover {
  border-color: #999999;
}

.subscription-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.subscription-button span,
.subscription-button strong,
.subscription-button small {
  display: block;
}

.subscription-button strong {
  font-size: 13px;
}

.subscription-button small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.subscription-button > span:last-child {
  flex: 0 0 auto;
  color: #6e521d;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.subscription-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.subscription-terms {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.subscription-terms a {
  color: inherit;
  font-weight: 700;
}

.data-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.data-actions button {
  min-height: 36px;
  border: 1px solid #d8d8d8;
  background: #ffffff;
  color: #333333;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.data-actions button:hover {
  background: #f5f5f5;
}

.data-actions .danger-button {
  border-color: rgba(184, 74, 66, 0.32);
  color: #9a3d37;
}

.legal-links {
  display: flex;
  gap: 14px;
  margin: 13px 0 0;
  font-size: 11px;
}

.dialog-footer {
  border-top: 1px solid var(--border);
}

.dialog-footer p {
  margin: 0;
}

.save-settings-button {
  flex: 0 0 auto;
  min-height: 40px;
  border: 0;
  background: #171717;
  color: #ffffff;
  padding: 0 15px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 750;
}

.save-settings-button:hover {
  background: #2b2b2b;
}

.onboarding-dialog {
  width: min(520px, calc(100% - 32px));
}

.onboarding-shell {
  display: grid;
  padding: 28px;
}

.onboarding-mark {
  width: 42px;
  height: 42px;
  display: grid;
  margin-bottom: 20px;
  place-items: center;
  border: 1px solid rgba(202, 168, 92, 0.42);
  background: var(--gold-soft);
  color: #765820;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 850;
}

.onboarding-shell > p:not(.dialog-eyebrow) {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.onboarding-actions {
  display: grid;
  gap: 9px;
  margin-top: 22px;
}

.onboarding-actions button {
  display: grid;
  gap: 3px;
  min-height: 70px;
  border: 1px solid #dddddd;
  background: #ffffff;
  color: var(--text);
  padding: 13px;
  text-align: left;
  border-radius: 8px;
}

.onboarding-actions button:first-child {
  border-color: rgba(202, 168, 92, 0.48);
  background: #fffdf8;
}

.onboarding-actions button:hover {
  border-color: #999999;
}

.onboarding-actions strong,
.onboarding-actions span {
  display: block;
}

.onboarding-actions strong {
  font-size: 13px;
}

.onboarding-actions span,
.onboarding-shell > small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.onboarding-shell > small {
  margin-top: 14px;
  text-align: center;
}

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

@keyframes pulse {
  0%,
  100% {
    opacity: 0.4;
    transform: scale(0.72);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes recitation-ready-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(202, 168, 92, 0.12);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(202, 168, 92, 0.04);
  }
}

@keyframes furqan-form-listen {
  0%,
  100% {
    background-position: 30% 26%, center;
    transform: scale(0.97);
  }

  50% {
    background-position: 37% 23%, center;
    transform: scale(1.015);
  }
}

@keyframes furqan-form-speak {
  0% {
    background-position: 27% 30%, center;
    transform: scale(0.95);
  }

  100% {
    background-position: 42% 21%, center;
    transform: scale(1.06);
  }
}

@keyframes furqan-form-think {
  0%,
  100% {
    background-position: 29% 32%, center;
    transform: scale(0.96);
  }

  50% {
    background-position: 41% 22%, center;
    transform: scale(1.02);
  }
}

@keyframes furqan-shadow-speak {
  from {
    opacity: 0.46;
    transform: scale(1.74);
  }

  to {
    opacity: 0.82;
    transform: scale(2.24);
  }
}

@keyframes furqan-aura-speak {
  from {
    opacity: 0.42;
    transform: scale(1.72);
    filter: blur(30px);
  }

  to {
    opacity: 0.88;
    transform: scale(2.18);
    filter: blur(44px);
  }
}

@keyframes furqan-aura-breathe {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(1.82);
  }

  50% {
    opacity: 0.82;
    transform: scale(2.12);
  }
}

@media (prefers-reduced-motion: reduce) {
  .voice-form,
  .voice-form::before,
  .voice-form::after,
  .voice-form-body,
  .voice-form-shadow,
  .voice-preview-button.busy .voice-play-icon,
  .voice-button.listening .composer-mic-icon,
  .recitation-dialog[data-playback-state="loading"] .recitation-play-button,
  .today-strip:not([hidden]) {
    animation: none !important;
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .chat-panel {
    grid-template-rows: auto auto minmax(0, 1fr) auto minmax(16px, 3vh);
    width: 100%;
  }

  .chat-panel > * {
    grid-column: 1;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 10;
    width: min(306px, 86vw);
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 9;
    display: block;
    background: rgba(0, 0, 0, 0.38);
  }

  .sidebar-scrim[hidden] {
    display: none;
  }

  .mobile-header {
    display: grid;
    grid-row: 1;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 5;
  }

  .mobile-header strong,
  .mobile-header span {
    display: block;
  }

  .mobile-header span {
    color: var(--muted);
    font-size: 12px;
  }

  .icon-button {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);
    border-radius: 10px;
    font-size: 18px;
  }

  .profile-icon-button {
    border-color: rgba(202, 168, 92, 0.34);
    background: var(--gold-soft);
    color: #765820;
    font-size: 12px;
    font-weight: 800;
  }

  .prayer-icon-button {
    color: #765820;
  }

  .home-prayer-banner {
    grid-row: 2;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 14px;
    gap: 9px 12px;
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 11px 16px 12px;
    border-width: 0 0 1px;
    border-color: rgba(202, 168, 92, 0.2);
    border-radius: 0;
    background: rgba(253, 252, 249, 0.94);
    box-shadow: none;
  }

  .home-prayer-date {
    display: grid;
    grid-column: 1 / 3;
    grid-template-columns: minmax(0, 1fr) minmax(108px, auto);
    grid-template-rows: auto auto;
    align-items: center;
    gap: 1px 10px;
  }

  .home-prayer-date small {
    display: none;
  }

  .home-prayer-date strong {
    grid-column: 1;
    grid-row: 1;
    font-size: 12px;
  }

  #homeHijriDate {
    grid-column: 1;
    grid-row: 2;
    font-size: 9px;
  }

  .home-prayer-location {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
    justify-self: end;
    max-width: 44vw;
    margin-top: 0;
    font-size: 9px;
    text-align: right;
  }

  .home-location-icon {
    width: 11px;
    height: 11px;
  }

  .home-prayer-divider {
    display: none;
  }

  .home-prayer-slot {
    padding-top: 9px;
    border-top: 1px solid rgba(28, 29, 26, 0.08);
  }

  .home-prayer-next {
    padding-left: 10px;
    border-left: 1px solid rgba(28, 29, 26, 0.08);
  }

  .home-prayer-slot small {
    font-size: 8px;
  }

  .home-prayer-reading {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
  }

  .home-prayer-name {
    gap: 5px;
  }

  .home-prayer-name strong {
    font-size: 14px;
  }

  .prayer-phase-icon {
    width: 16px;
    height: 16px;
  }

  .home-prayer-reading b {
    font-size: 14px;
  }

  .home-prayer-slot em {
    font-size: 8px;
  }

  .home-prayer-banner.is-location-unset .home-prayer-current {
    display: none;
  }

  .home-prayer-banner.is-location-unset .home-prayer-next {
    grid-column: 1 / 3;
    padding-left: 0;
    border-left: 0;
  }

  .home-prayer-banner.is-location-unset .home-prayer-next small {
    display: none;
  }

  .home-prayer-open {
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: center;
  }

  .home-empty,
  .messages,
  .composer {
    width: min(calc(100% - 28px), 820px);
  }

  .home-empty {
    grid-row: 3;
    padding: 18px 0 12px;
  }

  .home-logo {
    width: 94px;
    height: 94px;
    border-radius: 20px;
  }

  .home-logo-button {
    border-radius: 24px;
  }

  .today-strip {
    width: 100%;
    margin-top: 17px;
    padding: 4px 25px;
  }

  .today-date strong,
  .today-date span {
    font-size: 9px;
  }

  .today-occasion small {
    font-size: 8px;
  }

  .today-occasion strong {
    font-size: 16px;
  }

  .today-occasion > span {
    font-size: 12px;
    line-height: 1.45;
  }

  .today-strip.occasion {
    grid-template-columns: minmax(0, 1fr) 72px 14px;
    gap: 9px;
    padding: 10px;
  }

  .today-strip.occasion .today-art {
    width: 72px;
    min-height: 72px;
  }

  .today-open-icon {
    right: 3px;
    font-size: 16px;
  }

  .messages {
    grid-row: 3;
  }

  .composer {
    grid-row: 4;
    grid-template-columns: 1fr;
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  }

  .composer-hint {
    display: none;
  }

  .composer > button {
    width: 100%;
    height: 46px;
    border-radius: 14px;
  }

  .composer textarea {
    height: 48px;
    min-height: 48px;
    border-radius: 14px;
  }

  .evidence-overview {
    align-items: stretch;
  }

  .evidence-chip {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
  }

  .evidence-collections {
    flex-basis: 100%;
    margin-left: 0;
    text-align: center;
  }

  .fiqh-overview-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .fiqh-overview-heading strong {
    text-align: start;
  }

  .companion-dialog,
  .account-dialog,
  .onboarding-dialog {
    width: 100%;
    max-width: none;
    max-height: calc(100vh - 12px);
    margin: auto 0 0;
    border-radius: 8px 8px 0 0;
  }

  .voice-dialog {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .recitation-dialog {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
  }

  .recitation-header {
    min-height: 68px;
    padding: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left));
  }

  .recitation-mark {
    width: 38px;
    height: 38px;
    font-size: 11px;
  }

  .recitation-heading h2 {
    font-size: 15px;
  }

  .recitation-heading p {
    font-size: 9px;
  }

  .recitation-close {
    width: 38px;
    height: 38px;
  }

  .recitation-content {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: max-content max-content;
    align-content: start;
    overflow-y: auto;
  }

  .recitation-now {
    grid-row: 2;
    overflow: visible;
    padding: 24px 18px 28px;
    border-right: 0;
    border-bottom: 1px solid #2b302d;
  }

  .recitation-kicker {
    margin-bottom: 20px;
  }

  .recitation-chapter-line h3 {
    font-size: 27px;
  }

  .recitation-chapter-line > strong {
    font-size: 21px;
  }

  .recitation-arabic {
    font-size: 29px;
    line-height: 1.85;
  }

  .recitation-options {
    margin-top: 25px;
  }

  .recitation-surah-results {
    max-height: 220px;
  }

  .recitation-surah-overview > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .recitation-surah-overview span {
    text-align: left;
  }

  .recitation-reader {
    grid-row: 1;
    min-height: min(720px, calc(100dvh - 76px));
    overflow: visible;
  }

  .recitation-reader-header {
    position: sticky;
    z-index: 3;
    top: 0;
    flex-wrap: wrap;
    gap: 8px;
    padding: 9px 12px;
  }

  .mushaf-page-tools {
    flex: 1 1 auto;
    gap: 8px;
  }

  .mushaf-tracking-status {
    max-width: 150px;
  }

  .mushaf-reader {
    min-height: min(690px, calc(100dvh - 126px));
    grid-template-columns: 32px minmax(0, 1fr) 32px;
    gap: 3px;
    padding: 10px 5px 14px;
  }

  .mushaf-spread {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .mushaf-page {
    width: min(100%, 470px);
    height: auto;
    max-height: none;
  }

  .mushaf-word {
    font-size: clamp(14px, 4.15vw, 21px);
  }

  .mushaf-page-button {
    width: 30px;
    height: 40px;
  }

  .recitation-verses {
    display: block;
    overflow: visible;
  }

  .recitation-verses-heading {
    min-height: 0;
    align-items: stretch;
    flex-direction: column;
    padding: 16px 18px;
  }

  .recitation-reader-tools {
    justify-content: space-between;
  }

  .recitation-reader-tools > span {
    max-width: 130px;
  }

  .recitation-reader-tools label {
    flex: 1 1 auto;
    min-width: 0;
  }

  #recitationVerseList {
    overflow: visible;
    padding: 0 14px;
  }

  .recitation-verse-main {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 11px;
    padding: 24px 2px 15px;
  }

  .recitation-verse-number {
    width: 30px;
    height: 30px;
  }

  .recitation-verse-list-copy > strong {
    font-size: 26px;
    line-height: 1.9;
  }

  .recitation-verse-actions {
    padding-right: 2px;
  }

  .recitation-tafsir-panel {
    margin: 0 2px 22px 45px;
    padding: 16px;
  }

  .recitation-tafsir-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .recitation-tafsir-copy {
    max-height: 52vh;
  }

  .recitation-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding: 8px max(14px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }

  .recitation-footer p {
    display: none;
  }

  .stories-header {
    min-height: 68px;
    padding: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left));
  }

  .stories-heading-mark {
    display: none;
  }

  .stories-header {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
  }

  .stories-mobile-back {
    display: grid;
    grid-column: 1;
  }

  .stories-heading-copy {
    grid-column: 2;
  }

  .stories-layout {
    display: block;
    overflow: hidden;
  }

  .stories-library,
  .story-reader {
    width: 100%;
    height: 100%;
    border-right: 0;
  }

  .stories-shell[data-mobile-view="library"] .story-reader,
  .stories-shell[data-mobile-view="library"] .story-audio-player,
  .stories-shell[data-mobile-view="library"] .stories-mobile-back {
    display: none;
  }

  .stories-shell[data-mobile-view="reader"] .stories-library {
    display: none;
  }

  .stories-library {
    padding: 16px 12px 30px;
  }

  .story-continue-card {
    min-height: 70px;
  }

  .story-list-item {
    min-height: 62px;
  }

  .story-cover {
    min-height: 196px;
    padding: 34px 22px 26px;
  }

  .story-cover::after {
    right: 28px;
    bottom: 23px;
    width: 65px;
    height: 65px;
  }

  .story-cover-copy h3 {
    font-size: 34px;
  }

  .story-cover-copy > span {
    margin-left: 8px;
    font-size: 25px;
  }

  .story-cover-copy > p:not(:first-child) {
    max-width: calc(100% - 60px);
    font-size: 11px;
  }

  .story-book-meta {
    gap: 12px;
    font-size: 8px;
  }

  .story-reader-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 11px 16px;
  }

  .story-reader-toolbar label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .story-reader-toolbar select,
  .story-progress-copy {
    width: 100%;
    max-width: none;
  }

  .story-chapter {
    padding: 42px 22px 38px;
  }

  .story-chapter h3 {
    font-size: 29px;
  }

  .story-chapter-body {
    margin-top: 22px;
    font-size: 18px;
    line-height: 1.72;
  }

  .story-chapter-controls {
    grid-template-columns: 1fr;
    padding: 0 18px 48px;
  }

  .story-audio-player {
    grid-template-columns: minmax(0, 1fr) 38px 52px 38px 62px;
    grid-template-rows: auto auto auto;
    gap: 7px;
    min-height: 138px;
    padding: 8px max(12px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }

  .story-audio-identity {
    grid-column: 1 / 5;
  }

  .story-audio-art {
    width: 34px;
    height: 34px;
  }

  .story-speed {
    grid-column: 5;
    grid-row: 1;
  }

  .story-audio-skip:first-of-type {
    grid-column: 2;
    grid-row: 2;
  }

  .story-audio-play {
    grid-column: 3;
    grid-row: 2;
    width: 52px;
    height: 52px;
  }

  .story-audio-skip:nth-of-type(3) {
    grid-column: 4;
    grid-row: 2;
  }

  .story-auto-continue {
    grid-column: 1;
    grid-row: 2;
  }

  .story-audio-timeline {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .calendar-dialog {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .calendar-header {
    padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 12px max(14px, env(safe-area-inset-left));
  }

  .calendar-art {
    height: 168px;
  }

  .calendar-date-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding: 12px 16px;
  }

  .calendar-date-line span {
    text-align: left;
  }

  .calendar-event-tabs,
  .calendar-event-detail {
    padding-right: 16px;
    padding-left: 16px;
  }

  .calendar-event-detail h3 {
    font-size: 28px;
  }

  .calendar-footer {
    align-items: stretch;
    flex-direction: column;
    padding: 10px max(14px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }

  .calendar-footer button {
    width: 100%;
  }

  .prayer-dialog {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .prayer-header {
    padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 12px max(14px, env(safe-area-inset-left));
  }

  .prayer-content {
    padding: 22px 16px 28px;
  }

  .prayer-location-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .prayer-location-heading button {
    width: 100%;
    justify-content: center;
  }

  .qibla-heading {
    flex-direction: column;
  }

  .qibla-heading button {
    width: 100%;
  }

  .qibla-content {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .qibla-copy p {
    max-width: 320px;
  }

  .qibla-alignment-status {
    margin-right: auto;
    margin-left: auto;
  }

  .prayer-time-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .prayer-settings-grid {
    grid-template-columns: 1fr;
  }

  .prayer-footer {
    padding: 10px max(14px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }

  .voice-floating-actions {
    top: max(14px, env(safe-area-inset-top));
    right: max(14px, env(safe-area-inset-right));
  }

  .voice-stage {
    padding: 0;
  }

  .voice-form {
    width: clamp(190px, 54vw, 270px);
  }

  .voice-settings-panel {
    top: max(66px, calc(env(safe-area-inset-top) + 58px));
    right: max(14px, env(safe-area-inset-right));
    width: min(330px, calc(100% - 28px));
  }

  .dialog-shell {
    max-height: calc(100vh - 12px);
  }

  .account-dialog-shell {
    max-height: calc(100vh - 12px);
  }

  .dialog-header,
  .dialog-footer {
    padding: 14px;
  }

  .dialog-header h2,
  .onboarding-shell h2 {
    font-size: 18px;
  }

  .dialog-content {
    padding: 0 14px;
  }

  .field-grid,
  .membership-grid,
  .subscription-options {
    grid-template-columns: 1fr;
  }

  .account-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .account-actions {
    width: 100%;
  }

  .account-actions button {
    flex: 1 1 auto;
  }

  .toggle-row {
    gap: 12px;
  }

  .dialog-footer p {
    display: none;
  }

  .save-settings-button {
    width: 100%;
  }

  .onboarding-shell {
    padding: 22px 18px;
  }
}
