/* ROOM 211 design system. Every page loads this file; rules are in DESIGN.md. */
:root {
  color-scheme: light;
  accent-color: var(--color-accent);

  /* Color */
  --color-page: #ebebf0;
  --color-surface: #ffffff;
  --color-sunken: #f3f3f6;
  --color-control: #dcdce2;
  --color-line: #e2e2e7;
  --color-line-strong: #bcbcc4;
  --color-card-border: #d2d2d9;
  --color-ink: #1d1d1f;
  --color-ink-muted: #56565b;
  --color-accent: #0071e3;
  --color-on-accent: #ffffff;
  --color-accent-text: #0062c4;
  --color-accent-soft: #eaf3fe;
  --color-header: #e6e6ec;
  --color-board-column: #dcdce3;
  --color-editable: #e8f1fd;
  --color-editable-hover: #d9e8fb;
  --color-auto: #f3f3f6;
  --color-good: #1a7f37;
  --color-good-soft: #e6f6ea;
  --color-bad: #c9190b;
  --color-bad-soft: #fdecea;
  --color-warn: #9a5b00;
  --color-warn-soft: #fdf2e0;
  --color-status-accrued: #c77700;
  --color-status-handed: #7a4fd0;
  --color-chart-1: #0071e3;
  --color-chart-2: #e8590c;
  /* Further categorical slots, always used in this order after 1 and 2. */
  --color-chart-3: #1baf7a;
  --color-chart-4: #eda100;
  --color-chart-5: #e87ba4;
  --color-chart-6: #008300;
  --color-chart-7: #6250d6;
  --color-chart-8: #e34948;
  --color-chart-other: #8e8e93;
  /* What a search found */
  --color-found-strong: #ffe27a;
  --color-found-edge: #e0b400;
  /* The Back button in the navigation bar */
  --color-back: #d70015;
  --color-back-hover: #b30012;
  /* Sticky notes in SOP diagrams */
  --color-note: #fff6cc;
  --color-note-edge: #d9c46a;

  /* Type: San Francisco on Apple devices, the system font elsewhere */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-md: 15px;
  --text-lg: 17px;
  --text-section: 21px;
  --text-sheet-title: 34px;
  --text-title: 40px;

  /* Space and shape */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --shadow-rest: 0 1px 2px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-raised: 0 8px 28px rgba(0, 0, 0, 0.14);
  --page-width: 1024px;
  --motion: 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-page);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: 1.47;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Navigation bar: translucent, Back on the left, the name in the middle */
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: 52px;
  padding: var(--space-2) var(--space-5);
  border-bottom: 1px solid var(--color-line-strong);
  background: rgba(245, 245, 247, 0.85);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

/* The logo in the header, which leads back to the home screen. */
.wordmark {
  position: absolute;
  left: 50%;
  display: block;
  border-radius: var(--radius-sm);
  transform: translateX(-50%);
  transition: opacity var(--motion);
}

.wordmark:hover {
  opacity: 0.7;
}

.wordmark img {
  display: block;
  width: auto;
  height: 34px;
}

/* Back: a red pill with white text, so the way out is easy to find */
.back-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 34px;
  padding: 0 var(--space-4) 0 var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--color-back);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  color: var(--color-on-accent);
  font-size: var(--text-md);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--motion);
}

.back-button::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 3px;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: rotate(45deg);
}

.back-button:hover {
  background: var(--color-back-hover);
}

/* Primary action */
.button-primary {
  min-height: 32px;
  padding: 0 var(--space-4);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-on-accent);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--motion);
}

.button-primary:hover {
  opacity: 0.88;
}

.button-primary:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Secondary action */
.button-secondary {
  min-height: 32px;
  padding: 0 var(--space-4);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-control);
  color: var(--color-ink);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: opacity var(--motion);
}

.button-secondary:hover {
  opacity: 0.75;
}

.button-secondary:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Destructive action */
.button-danger {
  min-height: 32px;
  padding: 0 var(--space-4);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-bad);
  color: var(--color-surface);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: opacity var(--motion);
}

.button-danger:hover {
  opacity: 0.88;
}

.button-danger:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Dialogs */
.dialog {
  width: min(420px, calc(100vw - 2 * var(--space-4)));
  padding: var(--space-6);
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-raised);
  color: var(--color-ink);
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.25);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.dialog-title {
  margin: 0 0 var(--space-3);
  font-size: var(--text-section);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.dialog-text {
  margin: 0 0 var(--space-4);
  color: var(--color-ink-muted);
  font-size: var(--text-md);
}

.dialog-text strong {
  color: var(--color-ink);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-5);
}

/* Form fields */
.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}

.form-field[hidden] {
  display: none;
}

.form-label {
  color: var(--color-ink-muted);
  font-size: var(--text-sm);
}

.form-input {
  width: 100%;
  min-height: 36px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--color-page);
  color: var(--color-ink);
  font: inherit;
}

.form-input:focus {
  box-shadow: inset 0 0 0 2px var(--color-accent);
}

.form-error {
  min-height: 1.4em;
  margin: 0;
  color: var(--color-bad);
  font-size: var(--text-sm);
}

/* Switching views: a segmented control */
.sheet-tabs {
  display: flex;
  gap: 2px;
  max-width: 100%;
  padding: 2px;
  overflow-x: auto;
  border-radius: 9px;
  background: var(--color-control);
}

.sheet-tab {
  flex: none;
  min-height: 28px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--color-ink);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--motion), box-shadow var(--motion);
}

.sheet-tab:focus-visible {
  outline-offset: -2px;
}

.sheet-tab[aria-current="true"] {
  background: var(--color-surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  color: var(--color-accent-text);
  font-weight: 600;
}

/* Headline figures */
.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-auto);
}

.stat + .stat {
  margin-top: var(--space-2);
}

.stat-label {
  color: var(--color-ink-muted);
  font-size: var(--text-sm);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.stat-value--small {
  font-size: var(--text-lg);
}

/* Showing amounts in dinars or euros */
.currency-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.currency-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.currency-slot-end {
  margin-left: auto;
}

/* Which fields can be edited */
.field-legend {
  display: flex;
  flex: none;
  gap: var(--space-3);
  color: var(--color-ink-muted);
  font-size: var(--text-xs);
}

.field-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.field-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14);
}

.field-swatch--edit {
  background: var(--color-editable);
}

.field-swatch--auto {
  background: var(--color-surface);
}

.stat-sub {
  color: var(--color-ink-muted);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

/* Page content */
.page-content {
  width: 100%;
  max-width: calc(var(--page-width) + 2 * var(--space-6));
  margin: 0 auto;
  padding: var(--space-12) var(--space-6);
}

.page-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.page-heading .page-title {
  margin-bottom: 0;
}

.page-title {
  margin: 0 0 var(--space-8);
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

/* Navigation cards: the way into every section */
.nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: var(--space-5);
}

.nav-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-6);
  min-height: 156px;
  padding: var(--space-6);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-rest);
  color: var(--color-ink);
  font: inherit;
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow var(--motion), transform var(--motion);
}

.nav-card::after {
  content: "";
  position: absolute;
  top: 34px;
  right: var(--space-6);
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--color-accent);
  border-right: 2px solid var(--color-accent);
  transform: rotate(45deg);
}

.nav-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-raised);
  transform: scale(1.015);
}

.nav-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.nav-card-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

  .nav-card:hover {
    transform: none;
  }
}

@media (max-width: 520px) {
  :root {
    --text-title: 32px;
  }

  .app-header {
    padding: var(--space-2) var(--space-4);
  }

  .page-content {
    padding: var(--space-8) var(--space-4);
  }

  .nav-card {
    min-height: 132px;
  }
}

/* A person: their initials in a round tile */
.avatar {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-accent-text);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
}

.avatar--large {
  width: 40px;
  height: 40px;
  font-size: var(--text-sm);
}

/* A photo in place of the initials */
.avatar.has-photo {
  background-color: var(--color-control);
  background-position: center;
  background-size: cover;
  color: transparent;
}

/* Signature pad (js/signature-pad.js): white like paper, with a baseline */
.sign-pad {
  position: relative;
  height: 170px;
  overflow: hidden;
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-md);
  background: #fff;
}

.sign-pad canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

.sign-pad-line {
  position: absolute;
  right: var(--space-6);
  bottom: 44px;
  left: var(--space-6);
  border-top: 1px solid var(--color-line-strong);
}

.sign-pad-hint {
  position: absolute;
  bottom: 18px;
  left: var(--space-6);
  color: var(--color-ink-muted);
  font-size: var(--text-sm);
  pointer-events: none;
}

.sign-pad-actions {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: var(--space-4);
  margin: var(--space-2) 0 var(--space-4);
}

.sign-pad-problem {
  margin-right: auto;
  color: var(--color-bad);
  font-size: var(--text-sm);
}

.sign-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-accent-text);
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
}

.sign-link:hover {
  text-decoration: underline;
}

/* Entering a date or a month: typed, or picked from a calendar (js/date-picker.js) */
.date-control {
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
}

.date-input {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 var(--space-2);
  border: 0;
  outline: none;
  background: transparent;
  color: var(--color-ink);
  font: inherit;
  letter-spacing: inherit;
}

.date-input::placeholder {
  color: var(--color-ink-muted);
  opacity: 1;
}

.date-input.is-invalid {
  color: var(--color-bad);
}

.date-button {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-right: 2px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-accent-text);
  cursor: pointer;
  transition: background-color var(--motion);
}

.date-button:hover:not(:disabled) {
  background: var(--color-editable-hover);
}

.date-button:disabled {
  color: var(--color-ink-muted);
  cursor: default;
}

.date-button svg,
.date-popover-nav svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.date-field {
  display: flex;
  align-items: center;
  min-height: 36px;
  border-radius: var(--radius-sm);
  background: var(--color-editable);
  transition: background-color var(--motion);
}

.date-field:hover {
  background: var(--color-editable-hover);
}

.date-field:focus-within {
  box-shadow: inset 0 0 0 2px var(--color-accent);
}

.date-popover {
  position: fixed;
  z-index: 80;
  width: 268px;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-raised);
}

.date-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.date-popover-title {
  flex: 1;
  font-size: var(--text-md);
  font-weight: 600;
  text-align: center;
}

.date-popover-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-accent-text);
  cursor: pointer;
}

.date-popover-nav:hover {
  background: var(--color-sunken);
}

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

.date-popover.is-month .date-popover-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-1);
}

.date-weekday {
  padding: var(--space-1) 0;
  color: var(--color-ink-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  text-align: center;
}

.date-cell {
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-ink);
  font: inherit;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.date-cell.is-month {
  height: 38px;
  border-radius: var(--radius-sm);
}

.date-cell:hover {
  background: var(--color-sunken);
}

.date-cell.is-today {
  box-shadow: inset 0 0 0 1.5px var(--color-accent);
  color: var(--color-accent-text);
  font-weight: 600;
}

.date-cell.is-chosen {
  background: var(--color-accent);
  box-shadow: none;
  color: var(--color-on-accent);
  font-weight: 600;
}

.date-popover-foot {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-line);
}

.date-popover-link {
  padding: var(--space-1) var(--space-2);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-accent-text);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
}

.date-popover-link:hover:not(:disabled) {
  background: var(--color-sunken);
}

.date-popover-link:disabled {
  color: var(--color-ink-muted);
  cursor: default;
}

/* ---- Accounts (js/auth.js, js/auth-guard.js, login.html) ---- */

/* Who is signed in, at the right of the navigation bar */
.account {
  position: relative;
  margin-left: auto;
}

/* After the Show in EUR checkbox, which already sits at the right */
.currency-slot-end ~ .account {
  margin-left: 0;
}

.account-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 34px;
  padding: 0 var(--space-3) 0 6px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-ink);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--motion);
}

.account-button:hover,
.account-button[aria-expanded="true"] {
  background: var(--color-control);
}

.account-button .avatar {
  width: 26px;
  height: 26px;
  font-size: 11px;
}

.account-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 240px;
  padding: var(--space-2);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-raised);
}

.account-menu[hidden] {
  display: none;
}

.account-who {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: var(--space-1);
  padding: var(--space-2) var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-line);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.account-who span {
  color: var(--color-ink-muted);
}

.account-who .account-starting {
  margin-top: var(--space-1);
  color: var(--color-warn);
  font-size: var(--text-xs);
  font-weight: 600;
}

/* Notifications, left of the account: one bell, one list of new chat
   messages and mentions, the count red while a mention waits */
.notify {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.currency-slot-end ~ .notify,
.notify + .account {
  margin-left: 0;
}

.notify-wrap {
  position: relative;
}

.notify-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-ink-muted);
  cursor: pointer;
  transition: background-color var(--motion);
}

.notify-button:hover,
.notify-button[aria-expanded="true"] {
  background: var(--color-control);
  color: var(--color-ink);
}

.notify-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notify-count {
  position: absolute;
  top: 1px;
  right: -1px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border: 2px solid var(--color-surface);
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-size: 10px;
  font-weight: 700;
  line-height: 13px;
  text-align: center;
}

.notify-count.has-mention {
  background: var(--color-bad);
}

.notify-count[hidden] {
  display: none;
}

.notify-panel {
  width: min(340px, calc(100vw - 2 * var(--space-4)));
}

.notify-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2) var(--space-2);
  font-size: var(--text-sm);
}

.notify-clear {
  padding: 2px var(--space-2);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-accent-text);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
}

.notify-clear:hover {
  background: var(--color-accent-soft);
}

.notify-empty {
  margin: 0;
  padding: var(--space-2) var(--space-2) var(--space-3);
  color: var(--color-ink-muted);
  font-size: var(--text-sm);
}

.notify-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-2);
  border-top: 1px solid var(--color-line);
  color: var(--color-ink);
  font-size: var(--text-xs);
  text-decoration: none;
}

.notify-item:hover {
  background: var(--color-sunken);
}

.notify-item.is-mention {
  margin-top: 2px;
  border-top-color: transparent;
  border-radius: var(--radius-sm);
  background: var(--color-accent-soft);
}

.notify-item.is-mention:hover {
  background: var(--color-editable-hover);
}

.notify-item.is-mention + .notify-item {
  border-top-color: transparent;
}

.notify-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--color-sunken);
  color: var(--color-ink-muted);
}

.notify-item.is-mention .notify-icon {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.notify-item.is-assign .notify-icon {
  background: var(--color-good-soft);
  color: var(--color-good);
}

.notify-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notify-words {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.notify-line {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
}

.notify-line strong {
  color: var(--color-ink);
  font-size: var(--text-sm);
}

.notify-item.is-mention .notify-line strong {
  color: var(--color-accent-text);
}

.notify-when {
  flex: none;
  color: var(--color-ink-muted);
}

.notify-text {
  color: var(--color-ink-muted);
  overflow-wrap: anywhere;
}

.notify-pill {
  margin-top: 2px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-weight: 700;
}

.account-item {
  padding: var(--space-2);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-ink);
  font: inherit;
  font-size: var(--text-sm);
  text-align: left;
  cursor: pointer;
}

a.account-item {
  display: block;
  text-decoration: none;
}

.account-item:hover {
  background: var(--color-sunken);
}

.account-item.is-danger {
  color: var(--color-bad);
}

/* Your photo, in its dialog */
.account-photo-stage {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-4);
}

.avatar.account-photo-preview {
  width: 112px;
  height: 112px;
  font-size: 34px;
}

.account-photo-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
}

.account-photo-tools .account-photo-remove {
  color: var(--color-bad);
}

.account-photo-tools [hidden] {
  display: none;
}

.account-error:empty {
  display: none;
}

.account-flash {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  z-index: 30;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--color-ink);
  color: var(--color-surface);
  font-size: var(--text-sm);
  transform: translateX(-50%);
}

@media (max-width: 640px) {
  .account-name {
    display: none;
  }

  .account-button {
    padding-right: 6px;
  }
}

/* The sign-in page */
.login-main {
  display: flex;
  justify-content: center;
  padding: var(--space-12) var(--space-4);
}

.login-card {
  width: min(400px, 100%);
  padding: var(--space-8) var(--space-6);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-rest);
}

.login-title {
  margin: 0 0 var(--space-2);
  font-size: var(--text-section);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login-text {
  margin: 0 0 var(--space-5);
  color: var(--color-ink-muted);
  font-size: var(--text-sm);
  line-height: 1.45;
}

.login-error {
  min-height: 1.3em;
  margin: var(--space-1) 0 var(--space-3);
}

.login-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.login-submit {
  flex: 1;
}

/* Move Data (move-data.html): the two cards, one under the other. */
.move-main {
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.move-count {
  margin: 0 0 var(--space-4);
  color: var(--color-ink);
  font-size: var(--text-sm);
  font-weight: 600;
}

a.login-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.login-stack {
  width: min(400px, 100%);
}

.login-more {
  margin: var(--space-4) 0 0;
  text-align: center;
  font-size: var(--text-sm);
}

html[data-server="on"] .login-more {
  display: none;
}

.login-more a {
  color: var(--color-ink-muted);
}

/* A count on a tab, like unread messages on Chat */
.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
