/* Theme tokens. Change these colors to customize the site. */
:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #fff;
  --surface-soft: #f8f9fc;
  --text: #252b36;
  --muted: #788190;
  --border: #e5e9f1;
  --blue: #2567db;
  --blue-hover: #1855c3;
  --blue-soft: #eaf1fe;
  --danger: #c43b48;
  --shadow: 0 6px 30px #24396c06;
  --sheet-shadow: 0 3px 18px #314c7710;
  --highlight: #fff2a8;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151b26;
  --surface: #1d2532;
  --surface-soft: #232d3c;
  --text: #e3e8f1;
  --muted: #9ba9be;
  --border: #323e50;
  --blue: #77a7ff;
  --blue-hover: #96bcff;
  --blue-soft: #283e60;
  --danger: #ff96a3;
  --shadow: 0 6px 30px #0002;
  --sheet-shadow: 0 3px 18px #0002;
  --highlight: #665516;
}

/* Base elements and accessible focus states. */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial,Helvetica,sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button,input,select {
  font: inherit;
}

button,a,input,select {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button: disabled {
  cursor: wait;
  opacity: .55;
}

button {
  color: inherit;
}

a {
  color: var(--blue);
}

[hidden] {
  display: none!important;
}

svg.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.icon-definitions {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

button: focus-visible,a:focus-visible,select:focus-visible {
  outline: 3px solid #80adff;
  outline-offset: 3px;
}

input: focus-visible {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

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

/* Shared brand, icons and buttons. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  white-space: nowrap;
  color: var(--text);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -1.3px;
}

.brand-mark {
  width: 37px;
  height: 39px;
  border-radius: 11px;
  background: var(--blue);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: Arial,Helvetica,sans-serif;
  font-size: 32px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -2px;
  padding: 0 3px 8px 0;
  position: relative;
  flex-shrink: 0;
}

.brand-mark>span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #a9c9ff;
  position: absolute;
  right: 6px;
  bottom: 7px;
}

.brand-dot {
  color: var(--blue);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  flex-shrink: 0;
}

.icon-button:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  min-height: 42px;
  padding: 10px 18px;
  text-decoration: none;
  transition: background .15s;
}

.button-primary {
  background: var(--blue);
  color: #fff;
}

.button-primary:hover {
  background: var(--blue-hover);
}

:root[data-theme="dark"] .button-primary {
  color: #12213b;
}

.button-secondary {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.button-secondary:hover {
  background: var(--surface-soft);
}

.button-danger {
  background: var(--danger);
  color: #fff;
}

.initial-loading {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  gap: 12px;
}

.initial-loading .brand-mark {
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: .6;
    transform: translateY(-3px);
  }
}

/* Login and first-time administrator setup. */
.auth-view {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(360px,43%) 1fr;
}

.auth-intro {
  background: #205ccb;
  color: #fff;
  padding: 46px 11%;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.brand-light {
  color: #fff;
  z-index: 1;
}

.brand-light .brand-mark {
  background: #ffffff21;
}

.brand-light .brand-dot {
  color: #bad1ff;
}

.intro-copy {
  margin: auto 0;
  position: relative;
  z-index: 1;
  padding: 72px 0 90px;
}

.eyebrow,.auth-kicker,.sheet-eyebrow {
  font-size: 10px;
  letter-spacing: 1.7px;
  font-weight: 700;
}

.intro-copy .eyebrow {
  color: #c0d6ff;
}

.intro-copy h1 {
  font-size: clamp(44px,5vw,73px);
  line-height: 1.09;
  letter-spacing: -3.1px;
  font-weight: 600;
  margin: 23px 0 22px;
}

.intro-copy p {
  color: #c8dbff;
  font-size: 16px;
  line-height: 1.9;
}

.intro-stroke {
  margin-top: 38px;
  width: 55px;
  height: 4px;
  border-radius: 2px;
  background: #a5c6ff;
}

.intro-footer {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #c8dbff;
  font-size: 11px;
  z-index: 1;
}

.intro-footer .icon {
  width: 15px;
  height: 15px;
}

.intro-decoration {
  position: absolute;
  right: -185px;
  bottom: 100px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  border: 1px solid #ffffff13;
}

.intro-decoration span {
  position: absolute;
  border: 1px solid #ffffff13;
  border-radius: 50%;
  inset: 40px;
}

.intro-decoration span:nth-child(2) {
  inset: 80px;
}

.intro-decoration span:nth-child(3) {
  inset: 120px;
}

.auth-side {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  padding: 90px 42px;
}

.auth-theme {
  position: absolute;
  right: 30px;
  top: 28px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.auth-card {
  width: 100%;
  max-width: 355px;
}

.auth-kicker {
  color: var(--blue);
  font-size: 9px;
  letter-spacing: 1.4px;
}

.auth-card h2 {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -1.2px;
  margin: 15px 0 10px;
}

.auth-description {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  margin: 0 0 31px;
}

.auth-card form {
  width: 100%;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin: 19px 0 8px;
}

input {
  width: 100%;
  height: 45px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s;
}

input: :placeholder {
  color: #939cac;
  font-size: 12px;
}

input[readonly] {
  background: var(--surface-soft);
  color: var(--muted);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 44px;
}

.password-field .password-toggle {
  position: absolute;
  right: 4px;
  top: 4px;
}

.password-toggle .icon {
  width: 17px;
  height: 17px;
}

.login-submit {
  width: 100%;
  justify-content: space-between;
  margin-top: 25px;
  min-height: 46px;
  font-size: 12px;
  padding: 12px 16px;
}

.access-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 10px;
  color: var(--muted);
  margin: 21px 0;
}

.access-note .icon {
  width: 13px;
  height: 13px;
}

.setup-link {
  display: block;
  text-align: center;
  font-size: 11px;
  margin: 20px 0;
}

.auth-footer {
  position: absolute;
  bottom: 28px;
  left: 42px;
  right: 42px;
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--muted);
}

.auth-footer span:first-child {
  font-size: 8px;
  letter-spacing: 1.5px;
}

.mobile-brand {
  display: none;
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  line-height: 1.6;
  margin: 14px 0 0;
  padding: 10px 12px;
  background: color-mix(in srgb,var(--danger) 7%,var(--surface));
  border: 1px solid color-mix(in srgb,var(--danger) 18%,var(--surface));
  border-radius: 7px;
}

/* Notebook header, account menu and note tabs. */
.notebook-view {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-header {
  height: 76px;
  min-height: 76px;
  display: flex;
  align-items: center;
  padding: 0 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 20;
  gap: 24px;
}

.app-header .brand {
  font-size: 25px;
}

.app-header .brand-mark {
  width: 32px;
  height: 34px;
  border-radius: 9px;
  font-size: 29px;
}

.header-divider {
  height: 23px;
  width: 1px;
  background: var(--border);
}

.workspace-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.workspace-nav {
  align-self: stretch;
  display: flex;
  align-items: stretch;
  gap: 20px;
}

.workspace-nav a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 3px solid transparent;
}

.workspace-nav a[aria-current="page"] {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.workspace-nav a:hover { color: var(--blue); }

.header-actions > #prescription-history-link { border: 1px solid var(--border); width: 34px; height: 34px; }

@media (max-width: 600px) {
  .notebook-view .app-header { gap: 12px; padding: 0 12px; }
  .notebook-view .app-header .brand > span:last-child { display: none; }
  .workspace-nav { gap: 14px; font-size: 12px; }
  .notebook-view .header-actions { gap: 7px; }
  .header-actions > #prescription-history-link { width: 31px; height: 31px; }
}
@media (max-width: 360px) {
  .notebook-view .app-header { gap: 8px; padding: 0 8px; }
  .workspace-nav { gap: 10px; font-size: 11px; }
  .notebook-view .header-actions { gap: 5px; }
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 19px;
}

.header-actions>#theme-toggle {
  border: 1px solid var(--border);
  width: 34px;
  height: 34px;
}

.account-wrap,.note-options-wrap {
  position: relative;
}

.account-button {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 0;
  padding: 4px 0;
  font-size: 12px;
  font-weight: 500;
}

.account-button>.icon {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 9px);
  min-width: 224px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 7px;
  box-shadow: 0 12px 40px #18396a20;
  z-index: 50;
}

.dropdown-menu p {
  margin: 6px 10px 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  color: var(--muted);
}

.dropdown-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 11px 9px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
}

.dropdown-menu button:hover {
  background: var(--surface-soft);
}

.dropdown-menu .icon {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.dropdown-menu .menu-danger,.dropdown-menu .menu-danger .icon {
  color: var(--danger);
}

.notes-navigation {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 32px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  min-height: 68px;
}

.note-tabs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: thin;
  align-self: stretch;
  padding-bottom: 10px;
  align-items: center;
}

.note-tab {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  max-width: 220px;
  height: 37px;
  padding: 0 17px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

.note-tab span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-tab .icon {
  width: 15px;
  height: 15px;
}

.note-tab:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.note-tab[aria-selected="true"] {
  background: var(--blue-soft);
  border-color: color-mix(in srgb,var(--blue) 10%,var(--blue-soft));
  color: var(--blue);
}

.add-note {
  align-self: flex-start;
  height: 37px;
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px dashed #bfccdf;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.add-note:hover {
  background: var(--blue-soft);
  border-color: var(--blue);
}

.add-note .icon {
  width: 15px;
  height: 15px;
}

.editor-toolbar {
  min-height: 61px;
  padding: 12px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.toolbar-format {
  display: flex;
  align-items: center;
  gap: 3px;
  overflow-x: auto;
  scrollbar-width: thin;
  min-width: 0;
}

.toolbar-format select {
  background: var(--surface);
  border: 0;
  border-radius: 6px;
  color: var(--text);
  padding: 5px 18px 5px 0;
  min-width: 116px;
  font-size: 11px;
  height: 32px;
  cursor: pointer;
}

.toolbar-divider {
  display: block;
  min-width: 1px;
  width: 1px;
  height: 18px;
  margin: 0 9px;
  background: var(--border);
}

.tool-button {
  width: 31px;
  height: 31px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  flex-shrink: 0;
  color: #6d788a;
}

.tool-button .icon {
  width: 17px;
  height: 17px;
}

.text-tool {
  font-family: Georgia,serif;
  font-size: 16px;
}

.tool-button:hover,.tool-button[aria-pressed="true"] {
  background: var(--blue-soft);
  color: var(--blue);
}

.clear-format {
  position: relative;
  font: 16px Georgia,serif;
}

.clear-format>span {
  font: 11px Arial;
  position: absolute;
  bottom: -3px;
  right: -7px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-shrink: 0;
}

.save-status {
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  white-space: nowrap;
}

.save-status .icon {
  height: 12px;
  width: 12px;
}

.save-status[data-state="error"] {
  color: var(--danger);
}

.save-status[data-state="saving"] {
  color: var(--blue);
}

.button-save {
  min-height: 32px;
  padding: 5px 10px;
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  border-radius: 6px;
  gap: 6px;
}

.button-save:hover {
  background: var(--blue-soft);
  border-color: var(--blue);
  color: var(--blue);
}

.button-save .icon {
  width: 14px;
  height: 14px;
}

.global-error {
  margin: 0;
  padding: 10px 32px;
  background: color-mix(in srgb,var(--danger) 9%,var(--surface));
  color: var(--danger);
  font-size: 12px;
  line-height: 1.5;
  border-bottom: 1px solid var(--border);
}

/* Editor sheet, heading styles and bottom shortcuts. */
.notebook-main {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 30px 32px 34px;
  scroll-behavior: smooth;
}

.note-sheet {
  width: 100%;
  max-width: 1130px;
  min-height: calc(100% - 1px);
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  box-shadow: var(--sheet-shadow);
  display: flex;
  flex-direction: column;
  padding: 37px 48px 0;
}

.sheet-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 25px;
  margin-bottom: 22px;
  gap: 15px;
}

.sheet-eyebrow {
  font-size: 8px;
  letter-spacing: 1.7px;
  color: var(--muted);
}

.note-title-button {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  margin-top: 9px;
  max-width: 100%;
}

.note-title-button h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.3;
  letter-spacing: -.9px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.note-title-button .icon {
  width: 15px;
  height: 15px;
  color: var(--muted);
  opacity: 0;
  transition: opacity .15s;
}

.note-title-button:hover .icon,.note-title-button:focus-visible .icon {
  opacity: 1;
}

.note-editor {
  outline: none;
  flex: 1;
  min-height: 240px;
  font-size: 15px;
  line-height: 1.9;
  overflow-wrap: anywhere;
  padding-bottom: 50px;
  color: var(--text);
}

.note-editor:empty:before {
  content: attr(data-placeholder);
  white-space: pre-line;
  color: var(--muted);
  opacity: .7;
  pointer-events: none;
  line-height: 2;
  font-size: 14px;
}

.note-editor p,.note-editor div {
  margin: 0 0 13px;
}

.note-editor h1,.note-editor h2,.note-editor h3 {
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.4px;
  scroll-margin: 30px;
  margin: 26px 0 14px;
  color: var(--text);
}

.note-editor h1 {
  font-size: 26px;
}

.note-editor h2 {
  font-size: 21px;
}

.note-editor h3 {
  font-size: 18px;
}

.note-editor>:first-child {
  margin-top: 0;
}

.note-editor ul,.note-editor ol {
  padding-left: 25px;
  margin: 10px 0 20px;
}

.note-editor li {
  padding-left: 5px;
}

.note-editor li p {
  margin-bottom: 5px;
}

.note-editor a {
  color: var(--blue);
  text-decoration-color: color-mix(in srgb,var(--blue) 50%,var(--surface));
  text-underline-offset: 3px;
}

.note-editor img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  margin: 18px 0;
}

.note-editor mark {
  background: var(--highlight);
  color: inherit;
  border-radius: 2px;
}

.note-editor blockquote {
  border-left: 3px solid var(--blue);
  padding-left: 17px;
  color: var(--muted);
  margin-left: 0;
}

.sheet-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--border);
  min-height: 47px;
  color: var(--muted);
  font-size: 9px;
}

.editor-tip {
  display: flex;
  align-items: center;
  gap: 4px;
}

.editor-tip kbd {
  font-family: inherit;
  padding: 2px 4px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 3px;
}

.headings-footer {
  display: flex;
  align-items: center;
  gap: 23px;
  padding: 13px 32px calc(13px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
  min-height: 59px;
  box-shadow: 0 -4px 25px #213d5e03;
}

.headings-label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1.3px;
  white-space: nowrap;
}

.headings-label .icon {
  width: 16px;
  height: 16px;
}

.heading-links {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  min-width: 0;
}

.heading-button {
  padding: 7px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 10px;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}

.heading-button:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-soft);
}

.heading-button[data-level="2"] {
  padding-left: 10px;
}

.no-headings {
  font-size: 10px;
  color: var(--muted);
  opacity: .8;
}

.empty-state {
  max-width: 500px;
  margin: 0 auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 35px 0 70px;
}

.empty-icon {
  position: relative;
  width: 72px;
  height: 78px;
  border: 1px solid #d4e2fb;
  border-radius: 21px;
  background: var(--blue-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 33px;
  color: var(--blue);
  transform: rotate(-5deg);
}

.empty-icon .icon {
  width: 33px;
  height: 33px;
  stroke-width: 1.3;
}

.empty-icon>span {
  position: absolute;
  bottom: -7px;
  right: -8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 22px;
  line-height: 25px;
  border: 3px solid var(--bg);
}

.empty-state .eyebrow {
  color: var(--blue);
  font-size: 8px;
  letter-spacing: 1.4px;
}

.empty-state h1 {
  font-size: 27px;
  line-height: 1.3;
  letter-spacing: -.8px;
  font-weight: 600;
  margin: 16px 0 10px;
}

.empty-state p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
  max-width: 370px;
  margin: 0 0 27px;
}

.empty-state .button {
  font-size: 12px;
}

.empty-hint {
  font-size: 10px;
  color: var(--muted);
  margin-top: 22px;
}

/* Native dialogs, administrator forms and notifications. */
.modal {
  border: 1px solid var(--border);
  border-radius: 15px;
  box-shadow: 0 24px 100px #081b4240;
  padding: 28px;
  width: calc(100% - 32px);
  max-width: 440px;
  max-height: calc(100dvh - 48px);
  overflow: auto;
  background: var(--surface);
  color: var(--text);
}

.modal::backdrop {
  background: #10234466;
  backdrop-filter: blur(4px);
}

.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 12px;
}

.dialog-heading h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.5px;
  margin: 0;
  line-height: 1.4;
}

.dialog-heading .icon-button {
  width: 30px;
  height: 30px;
  margin: -4px -4px 0 0;
}

.dialog-heading .sheet-eyebrow {
  display: block;
  margin-bottom: 7px;
}

.dialog-description {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.75;
  margin: 12px 0 18px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 26px;
}

.dialog-actions .button {
  font-size: 12px;
  min-height: 39px;
  padding: 9px 14px;
}

.modal-wide {
  max-width: 630px;
  padding: 30px;
}

.users-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 9px;
  margin: 20px 0;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}

.user-row:last-child {
  border: 0;
}

.user-details {
  min-width: 0;
  flex: 1;
}

.user-details strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.user-details small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.user-row .user-state {
  font-size: 9px;
  color: var(--blue);
  padding: 4px 6px;
  background: var(--blue-soft);
  border-radius: 4px;
}

.user-row .user-state.inactive {
  color: var(--muted);
  background: var(--surface-soft);
}

.user-controls {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-controls button {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 5px;
  padding: 7px 8px;
  font-size: 9px;
}

.user-controls button:hover {
  background: var(--surface-soft);
}

.user-create-form {
  padding-top: 5px;
}

.user-create-form h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 12px 0 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.form-grid small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
  margin-top: 7px;
}

.conflict-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 25px;
}

.conflict-actions .button {
  font-size: 12px;
}

.toast {
  position: fixed;
  bottom: 82px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 13px 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 30px #15295325;
  background: var(--text);
  color: var(--surface);
  font-size: 12px;
  z-index: 100;
  text-align: center;
}

/* Responsive adjustments: wide screens, tablets and phones. */
@media(min-width:1500px) {
  .auth-intro {
    padding-left: 15%;
  }
  .auth-card {
    max-width: 380px;
  }
  .notebook-main {
    padding-top: 36px;
  }
  .note-sheet {
    padding: 43px 62px 0;
  }
}

@media(max-width:1100px) {
  .editor-toolbar {
    padding-left: 24px;
    padding-right: 24px;
    gap: 8px;
  }
  .toolbar-divider {
    margin: 0 5px;
  }
  .toolbar-actions {
    gap: 9px;
  }
  .save-status {
    max-width: 120px;
    overflow: hidden;
  }
  .auth-intro {
    padding-left: 10%;
    padding-right: 10%;
  }
  .intro-copy h1 {
    font-size: 55px;
  }
  .notebook-main {
    padding: 24px;
  }
  .app-header,.notes-navigation,.headings-footer {
    padding-left: 24px;
    padding-right: 24px;
  }
  .note-sheet {
    padding: 32px 34px 0;
  }
}

@media(max-width:850px) {
  .toolbar-format {
    flex: 1;
  }
  .toolbar-actions .save-status {
    display: none;
  }
  .toolbar-divider {
    margin: 0 5px;
  }
  .tool-button {
    width: 30px;
  }
  .auth-view {
    grid-template-columns: 38% 62%;
  }
  .auth-intro {
    padding: 36px 11%;
  }
  .intro-copy h1 {
    font-size: 45px;
    letter-spacing: -2px;
  }
  .intro-copy p {
    font-size: 13px;
  }
  .intro-copy .eyebrow {
    font-size: 8px;
    line-height: 1.7;
    display: block;
  }
  .intro-footer {
    font-size: 9px;
    line-height: 1.5;
  }
  .auth-side {
    padding: 80px 32px;
  }
  .auth-card h2 {
    font-size: 27px;
  }
  .auth-footer {
    left: 32px;
    right: 32px;
  }
  .sheet-footer #last-saved {
    display: none;
  }
}

@media(max-width:600px) {
  .auth-view {
    display: block;
  }
  .auth-intro {
    display: none;
  }
  .auth-side {
    min-height: 100dvh;
    padding: 90px 27px 105px;
  }
  .auth-card {
    max-width: 360px;
  }
  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 47px;
  }
  .mobile-brand .brand-mark {
    width: 32px;
    height: 35px;
    font-size: 29px;
  }
  .auth-kicker {
    font-size: 8px;
  }
  .auth-card h2 {
    font-size: 28px;
    margin-top: 12px;
  }
  .auth-description {
    font-size: 12px;
    margin-bottom: 26px;
  }
  .auth-theme {
    right: 22px;
    top: 22px;
  }
  .auth-footer {
    left: 27px;
    right: 27px;
    font-size: 8px;
  }
  .auth-footer span:first-child {
    font-size: 7px;
  }
  .app-header {
    height: 64px;
    min-height: 64px;
    padding: 0 16px;
    gap: 14px;
  }
  .app-header .brand {
    font-size: 23px;
    gap: 8px;
  }
  .app-header .brand-mark {
    width: 29px;
    height: 31px;
    font-size: 27px;
    border-radius: 8px;
  }
  .workspace-label,.header-divider {
    display: none;
  }
  .header-actions {
    gap: 12px;
  }
  .account-button {
    gap: 6px;
  }
  .account-button #user-name {
    display: none;
  }
  .account-button>.icon {
    width: 12px;
  }
  .avatar {
    width: 30px;
    height: 30px;
  }
  .header-actions>#theme-toggle {
    width: 31px;
    height: 31px;
  }
  .header-actions>#theme-toggle .icon {
    width: 16px;
    height: 16px;
  }
  .notes-navigation {
    padding: 12px 16px 0;
    gap: 8px;
    min-height: 60px;
  }
  .note-tab {
    height: 34px;
    padding: 0 12px;
    font-size: 11px;
    gap: 6px;
    max-width: 170px;
  }
  .note-tab .icon {
    width: 13px;
  }
  .add-note {
    width: 35px;
    height: 34px;
    padding: 0;
  }
  .add-note span {
    display: none;
  }
  .editor-toolbar {
    min-height: 53px;
    padding: 9px 12px;
    gap: 9px;
  }
  .toolbar-format select {
    min-width: 98px;
    width: 98px;
    font-size: 10px;
    padding-right: 0;
  }
  .tool-button {
    height: 30px;
    width: 30px;
  }
  .toolbar-divider {
    margin: 0 4px;
  }
  .toolbar-actions {
    border-left: 1px solid var(--border);
    padding-left: 8px;
  }
  .button-save {
    width: 31px;
    height: 31px;
    padding: 0;
    border: none;
    color: var(--blue);
  }
  .button-save span {
    display: none;
  }
  .button-save .icon {
    width: 17px;
    height: 17px;
  }
  .notebook-main {
    padding: 15px 12px 20px;
  }
  .note-sheet {
    border-radius: 10px;
    padding: 26px 22px 0;
    box-shadow: 0 2px 10px #15295306;
  }
  .sheet-heading {
    padding-bottom: 19px;
    margin-bottom: 20px;
  }
  .sheet-eyebrow {
    font-size: 7px;
    letter-spacing: 1.3px;
  }
  .note-title-button h1 {
    font-size: 23px;
    letter-spacing: -.5px;
  }
  .note-title-button .icon {
    display: none;
  }
  .sheet-heading>.note-options-wrap>.icon-button {
    width: 27px;
    height: 27px;
    margin-top: 13px;
  }
  .note-editor {
    font-size: 14px;
    line-height: 1.85;
    padding-bottom: 40px;
    min-height: 230px;
  }
  .note-editor:empty:before {
    font-size: 12px;
    line-height: 2;
  }
  .note-editor h1 {
    font-size: 23px;
  }
  .note-editor h2 {
    font-size: 20px;
  }
  .note-editor h3 {
    font-size: 17px;
  }
  .sheet-footer {
    font-size: 8px;
    min-height: 42px;
    gap: 8px;
  }
  .headings-footer {
    min-height: 53px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    gap: 12px;
  }
  .headings-label span {
    display: none;
  }
  .headings-label .icon {
    width: 15px;
    height: 15px;
  }
  .heading-button {
    font-size: 9px;
    padding: 7px 10px;
    max-width: 200px;
  }
  .no-headings {
    font-size: 9px;
  }
  .global-error {
    padding: 9px 16px;
    font-size: 11px;
  }
  .empty-state {
    padding: 25px 15px 60px;
  }
  .empty-state .eyebrow {
    font-size: 7px;
    line-height: 1.6;
    max-width: 230px;
  }
  .empty-state h1 {
    font-size: 23px;
    max-width: 290px;
  }
  .empty-state p {
    font-size: 12px;
  }
  .empty-icon {
    width: 63px;
    height: 68px;
    margin-bottom: 30px;
  }
  .modal {
    padding: 23px;
    max-height: calc(100dvh - 32px);
  }
  .modal-wide {
    padding: 23px;
  }
  .dialog-heading h2 {
    font-size: 18px;
  }
  .form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .user-row {
    flex-wrap: wrap;
    padding: 12px;
    gap: 8px;
  }
  .user-controls {
    width: 100%;
    padding-left: 42px;
    justify-content: flex-start;
  }
  .user-controls button {
    font-size: 10px;
  }
  .toast {
    bottom: 68px;
    width: max-content;
  }
  .dialog-actions .button {
    font-size: 11px;
  }
}

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

.reauth-button {
  padding:  0;
  border:  0;
  background:  transparent;
  color:  inherit;
  font-size:  inherit;
  text-decoration:  underline;
  text-underline-offset:  3px;
  font-weight:  600;
}
