* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--body);
  background: var(--muted);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  font-family: var(--font-head);
  color: var(--heading);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.4em;
}
p { margin: 0 0 1em; }

.top {
  background: var(--ink);
  color: var(--surface);
}

.top__inner, .wrap, .foot__inner {
  width: min(960px, calc(100% - 40px));
  margin: 0 auto;
}

.top__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 10px 0;
}

.brand {
  display: flex;
  align-items: center;
  color: var(--surface);
}
.brand:hover { text-decoration: none; opacity: 0.88; }

.brand img {
  display: block;
  height: 52px;
  width: auto;
}

.top__tools {
  min-width: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.top__who {
  display: inline-flex;
  align-items: center;
  flex-shrink: 1;
  min-width: 0;
  gap: 8px;
  margin: 0;
  height: 40px;
  padding: 0 12px;
  color: var(--surface);
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}

a.top__who,
a.top__who:hover,
a.top__who:focus {
  text-decoration: none;
}

button.top__who {
  border: 0;
  background: transparent;
  cursor: pointer;
}

button.top__who:hover,
button.top__who:focus-visible {
  color: var(--accent);
}

button.top__who .icon:last-child {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

input[type="text"][readonly] {
  background: var(--muted);
  color: var(--body);
  cursor: default;
}

.field-hint {
  margin: 6px 0 16px;
  font-size: 13px;
  color: var(--body);
}

a.top__who:hover,
a.top__who:focus {
  color: var(--accent);
}

.top__who .icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.top__who-name {
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.top__logout {
  margin: 0;
  display: flex;
  flex: 0 0 auto;
}

.top__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--surface);
  cursor: pointer;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 14px;
}

.top__icon:hover {
  color: var(--accent);
}

a.top__icon,
a.top__icon:hover { text-decoration: none; }

.top__icon .icon {
  width: 18px;
  height: 18px;
}
.top nav { display: flex; gap: 18px; font-size: 14px; }
.top nav a { color: var(--surface); }

.top nav a:hover,
.top nav a[aria-current="page"] { color: var(--accent); text-decoration: none; }

.top__menu { display: contents; }
.top__burger { display: none; }

.top__bars,
.top__bars::before,
.top__bars::after {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 1px;
  background: currentcolor;
  content: "";
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.top__bars { position: relative; }
.top__bars::before { position: absolute; top: -7px; }
.top__bars::after { position: absolute; top: 7px; }

main { flex: 1; padding: 40px 0; }

.foot {
  background: var(--ink);
  color: color-mix(in srgb, var(--surface) 88%, transparent);
  padding: 12px 0;
  font-size: 13px;
  margin-top: auto;
  flex-shrink: 0;
}

.foot__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.foot__name,
.foot__version {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: 0.02em;
}

.foot__name {
  font-weight: 600;
}

.foot__version {
  font-weight: 500;
}
.lede { font-size: 19px; max-width: 40rem; }
.lede--small { font-size: 15px; margin-top: -0.2em; }

.card__state {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--body);
}

.card__state[hidden] { display: none; }

.flash {
  list-style: none;
  margin: 0 0 24px;
  padding: 14px 18px;
  background: var(--surface);
  color: var(--heading);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow:
    0 1px 0 color-mix(in srgb, var(--ink) 4%, transparent),
    0 10px 28px color-mix(in srgb, var(--ink) 14%, transparent);
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-top: 28px;
}

.section-title {
  margin: 28px 0 0;
  font-size: 20px;
}

.section-title + .grid,
.section-lede + .grid { margin-top: 12px; }
.section-title + .section-lede { margin: 6px 0 0; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-top: 8px;
}
.section-head:first-child { margin-top: 0; }

.section-head h1,
.section-head h2 { margin: 0; }
.section-head .lede { margin-bottom: 0; }
.section-head .btn { flex: 0 0 auto; margin-top: 2px; }
.board { margin-top: 4px; }

.board__loose > .grid,
.group > .grid { margin-top: 12px; }
.grid--versions { gap: 8px; }

.group {
  margin-top: 28px;
  padding: 16px 18px 18px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgb(var(--ink-rgb) / 6%);
}
.group:first-child { margin-top: 20px; }

.group__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.group__main {
  flex: 1 1 12rem;
  min-width: 0;
}

.group__title {
  margin: 0;
  font-size: 18px;
}

.group__title a {
  display: block;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group__title a:hover { color: var(--accent); }

.group__description {
  margin: 2px 0 0;
  color: var(--body);
  font-size: 14px;
  line-height: 1.4;
}

.group__empty {
  margin: 0;
  padding: 20px 22px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  color: var(--body);
  background: var(--muted);
  text-align: center;
}
[data-section]:has([data-revision-id]) > [data-empty] { display: none; }

[data-section].is-drop-target {
  box-shadow: 0 0 0 2px var(--accent);
  border-radius: var(--radius);
}
.group.is-dragging { opacity: 0.55; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  box-shadow: 0 1px 0 rgb(var(--ink-rgb) / 6%);
  position: relative;
}

.card:hover,
.card:focus-within { z-index: 3; }

.card__order {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 0 0 auto;
  align-items: center;
}

.card__grip {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: var(--heading);
  cursor: grab;
  border-radius: 6px;
}
.card__grip:active { cursor: grabbing; }
.board.js-sortable .card__grip { display: flex; }

.board.js-sortable .card__order-buttons {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.board.js-sortable .card__order:focus-within .card__order-buttons {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
}

.card.is-dragging {
  opacity: 0.55;
}

.card.is-drop-target {
  box-shadow: 0 0 0 2px var(--accent);
}

.card.is-stack-target,
.group.is-stack-target,
.card.is-file-target,
.group.is-file-target {
  box-shadow: 0 0 0 3px var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.card--version {
  padding: 8px 12px;
  gap: 10px;
  background: var(--muted);
  box-shadow: none;
}

.card--version h2 { font-size: 15px; font-weight: 600; }

.card--version .card__main,
.card--version .card__heading { flex-basis: 8rem; }

.card--version .card__heading { flex-wrap: wrap; }
.card--version .row-actions { flex-wrap: nowrap; }

.card--version .card__grip {
  width: 32px;
  height: 32px;
}

.icon {
  display: block;
  width: 22px;
  height: 22px;
  overflow: visible;
  fill: none;
  stroke: currentcolor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.card h2 { margin: 0; font-size: 22px; }

.card__heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 220px;
}

.card__heading h2 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card__heading h2 a {
  display: block;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card__heading h2 a:hover { color: var(--accent); }

.card__heading .badge { margin-left: 0; }

.card:has(.row-menu[open]) { z-index: 4; }

.card__version {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin: 0;
  flex: 0 0 auto;
}

.card__version select {
  appearance: none;
  box-sizing: border-box;
  width: auto;
  min-width: 10.5rem;
  height: 38px;
  margin: 0;
  padding: 0 36px 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 14px;
  line-height: 38px;
  color: var(--heading);
  background: var(--surface);
  cursor: pointer;
}

.card__version select:hover {
  border-color: color-mix(in srgb, var(--heading) 28%, var(--line));
}

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

.card__version .icon {
  position: absolute;
  right: 10px;
  width: 16px;
  height: 16px;
  pointer-events: none;
  color: var(--body);
}

.card__actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.meta {
  margin: 0;
  font-size: 14px;
  color: var(--body);
}


.modal.is-info [data-modal-cancel],
[hidden] {
  display: none !important;
}

.modal__html {
  margin: 0 0 22px;
}

.meta-list {
  margin: 0;
  display: grid;
  gap: 8px 0;
}

.meta-list > div {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 2px 12px;
  align-items: baseline;
  font-size: 15px;
  line-height: 1.4;
}

.meta-list dt {
  margin: 0;
  color: var(--heading);
  font-weight: 700;
}

.meta-list dd {
  margin: 0;
  color: var(--body);
  overflow-wrap: break-word;
}

.modal__html p {
  margin: 0 0 0.7em;
}

.modal__html .meta-list {
  margin: 14px 0 0;
}


.card.is-hidden .card__main { opacity: 0.62; }

.card__sub {
  margin: 0;
  color: var(--body);
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
}

.card.is-fresh,
.group.is-fresh { animation: fresh-flash 2.4s ease-out; }

@keyframes fresh-flash {
  0%, 40% { box-shadow: 0 0 0 3px var(--accent); }
  100% { box-shadow: 0 0 0 3px transparent; }
}

.vis { display: block; }
.vis--hidden { display: none; }
.card.is-hidden .vis--shown { display: none; }
.card.is-hidden .vis--hidden { display: block; }
.card.is-hidden [data-visibility-button] { color: var(--fire); }

.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--fire) 14%, var(--surface));
  color: var(--fire);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge[hidden] { display: none; }

.badge--count {
  letter-spacing: 0;
  text-transform: none;
}

.badge--muted {
  background: color-mix(in srgb, var(--ink) 10%, var(--muted));
  color: var(--heading);
}

.empty {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 22px;
  color: var(--heading);
}

.btn {
  display: inline-block;
  background: var(--fire);
  color: var(--surface);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 6px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { text-decoration: none; filter: brightness(1.05); }

.btn--ghost {
  background: transparent;
  color: var(--heading);
  border: 1px solid var(--line);
}
.btn--small { padding: 8px 12px; font-size: 13px; }

.btn.btn--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: 0;
  line-height: 0;
  overflow: visible;
}

.btn.btn--icon.is-filled {
  color: var(--accent);
}

.btn.btn--with-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1;
  white-space: nowrap;
}

.btn.btn--with-icon .icon {
  width: 18px;
  height: 18px;
}

.btn.is-disabled {
  opacity: 0.28;
  cursor: default;
  pointer-events: none;
}

.panel [data-login="name"] {
  margin: 0;
}

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 28px;
}

.drop {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  background: var(--muted);
}

.drop.is-over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--muted));
}
.drop.is-busy { pointer-events: none; }
.drop__text { margin: 0; color: var(--heading); }

.drop__hint {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--body);
}

.drop__text label {
  display: inline;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
}

.drop__file {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--body);
  word-break: break-all;
}

.progress {
  height: 8px;
  margin: 16px auto 0;
  max-width: 360px;
  background: color-mix(in srgb, var(--ink) 12%, var(--muted));
  border-radius: 999px;
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  width: 0;
  background: var(--fire);
  transition: width 0.12s linear;
}

.progress.is-indeterminate .progress__bar {
  width: 32%;
  animation: progress-slide 1.1s ease-in-out infinite;
}

.progress__label {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--heading);
}

@keyframes progress-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(360%); }
}
.card__main { flex: 1 1 220px; min-width: 0; }

.note-editor__surface .note-page { user-select: none; }

.visually-hidden,
input[type="file"].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;
}
label { display: block; font-weight: 700; color: var(--heading); margin-bottom: 8px; }

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.check input[type="checkbox"] {
  width: 1.1em;
  height: 1.1em;
  margin: 0;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

input[type="file"],
input[type="password"],
input[type="text"],
textarea,
select {
  display: block;
  width: 100%;
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  background: var(--surface);
  color: inherit;
}
textarea { resize: vertical; min-height: 4.5rem; }
.row-actions { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.row-actions form { display: flex; margin: 0; }

.row-actions .btn.btn--icon {
  border: 0;
  background: transparent;
  color: var(--heading);
  filter: none;
}

.row-actions .btn.btn--icon.is-filled {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.row-actions .btn.btn--icon:hover,
.row-menu[open] > summary {
  background: color-mix(in srgb, var(--heading) 8%, transparent);
  filter: none;
}

.row-actions .btn.btn--icon.is-filled:hover {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
}

.row-menu { position: relative; }

.row-menu > summary {
  list-style: none;
}

.row-menu > summary::-webkit-details-marker { display: none; }

.row-menu__panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 2;
  width: max-content;
  min-width: 12.5rem;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 24px rgb(var(--ink-rgb) / 12%);
}

.row-menu__panel form { display: block; }

.row-menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  margin: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--heading);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.row-menu__item:hover {
  background: color-mix(in srgb, var(--heading) 8%, transparent);
}

.row-menu__item .icon {
  width: 18px;
  height: 18px;
}

.row-menu__item--danger {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 6px 6px;
  color: var(--fire);
}

@media (width <= 700px) {
  .section-head { flex-direction: column; }
}

.modal,
.modal.is-info,
.modal.modal--edit,
.modal.modal--note {
  border: 0;
  padding: 0;
  background: transparent;
  width: min(52rem, calc(100vw - 32px));
  max-width: min(52rem, calc(100vw - 32px));
  height: min(42rem, calc(100dvh - 40px));
  max-height: min(42rem, calc(100dvh - 40px));
}

.modal .modal__box {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.modal.modal--compact {
  height: fit-content;
  max-height: none;
}

.modal.modal--compact .modal__box {
  height: auto;
  max-height: calc(100dvh - 40px);
  overflow: auto;
}

.modal.modal--compact textarea { min-height: 4.5rem; }

.modal.modal--compact .modal__box > .site-fields { overflow: visible; }

.site-more {
  margin: 0 0 16px;
}

.site-more > summary {
  margin-bottom: 12px;
  font-weight: 700;
  color: var(--heading);
  cursor: pointer;
}

.backup-part {
  margin: 0 0 20px;
}

.backup-part h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.backup-part form {
  margin: 0;
}

.backup-part + .backup-part {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.backup-warn {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: var(--muted);
}

.backup-warn--danger {
  color: var(--fire);
}

.backup-part input[type="file"] {
  display: block;
  max-width: 100%;
  margin: 0 0 12px;
}

.modal .modal__box > :not(.note-editor, .modal__html, textarea) {
  flex-shrink: 0;
}

.modal .note-editor,
.modal textarea {
  flex: 1 1 auto;
  min-height: 0;
}

.modal textarea {
  max-height: none;
  resize: none;
}

.modal .modal__box > .site-fields {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.modal .site-fields textarea {
  flex: none;
  min-height: 4.5rem;
}

.modal.modal--edit .note-editor {
  display: flex;
  flex-direction: column;
  min-height: 10rem;
}

.modal.modal--edit .note-editor__surface,
.modal.modal--edit .note-editor__preview {
  flex: 1 1 auto;
  min-height: 7rem;
  max-height: none;
  overflow: auto;
}

.modal.modal--note .note-editor {
  flex: 1 1 auto;
  min-height: 0;
  margin-bottom: 12px;
}

.modal.modal--note .note-editor__surface,
.modal.modal--note .note-editor__preview {
  min-height: 12rem;
  padding: 1.2rem 1.4rem 1.6rem;
}

.modal.modal--edit .note-meta {
  flex: 0 1 auto;
  max-height: 12rem;
  overflow: auto;
}

.modal .modal__html {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.modal .modal__actions {
  margin-top: auto;
}

.note-editor {
  position: relative;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
}

.note-editor__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  padding: 3px 8px;
  background: var(--muted);
  border-bottom: 1px solid var(--line);
}

.note-editor__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1px;
  padding: 0 8px;
}

.note-editor__group + .note-editor__group {
  border-left: 1px solid color-mix(in srgb, var(--ink) 18%, var(--line));
}

.note-editor__group--tones {
  flex: 1 1 auto;
  gap: 4px;
  padding-right: 8px;
}

.note-editor__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--heading);
  cursor: pointer;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
}

.note-editor__btn:hover,
.note-editor__btn:focus-visible,
.note-editor__btn.is-on {
  background: color-mix(in srgb, var(--ink) 10%, var(--muted));
  outline: none;
}
.note-editor__btn--italic { font-style: italic; }

.note-editor__btn--tone.is-on {
  box-shadow: 0 0 0 1px var(--surface), 0 0 0 2px var(--heading);
  outline: none;
}

.note-editor__count {
  margin: 0 0 0 auto;
  padding: 0 2px 0 8px;
  color: color-mix(in srgb, var(--body) 62%, var(--muted));
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

.note-editor__count.is-over {
  color: var(--fire);
  font-weight: 700;
}

.note-editor__btn--tone {
  width: 14px;
  height: 14px;
  margin: 0;
  border: 1px solid rgb(0 0 0 / 18%);
  border-radius: 50%;
}

.note-editor__btn--tone-01,
.note-editor__btn--tone-01:hover,
.note-editor__btn--tone-01:focus-visible { background: #1f2937; }

.note-editor__btn--tone-02,
.note-editor__btn--tone-02:hover,
.note-editor__btn--tone-02:focus-visible { background: #4b5563; }

.note-editor__btn--tone-03,
.note-editor__btn--tone-03:hover,
.note-editor__btn--tone-03:focus-visible { background: #9a3412; }

.note-editor__btn--tone-04,
.note-editor__btn--tone-04:hover,
.note-editor__btn--tone-04:focus-visible { background: #b45309; }

.note-editor__btn--tone-05,
.note-editor__btn--tone-05:hover,
.note-editor__btn--tone-05:focus-visible { background: #b91c1c; }

.note-editor__btn--tone-06,
.note-editor__btn--tone-06:hover,
.note-editor__btn--tone-06:focus-visible { background: #9d174d; }

.note-editor__btn--tone-07,
.note-editor__btn--tone-07:hover,
.note-editor__btn--tone-07:focus-visible { background: #6d28d9; }

.note-editor__btn--tone-08,
.note-editor__btn--tone-08:hover,
.note-editor__btn--tone-08:focus-visible { background: #1d4ed8; }

.note-editor__btn--tone-09,
.note-editor__btn--tone-09:hover,
.note-editor__btn--tone-09:focus-visible { background: #0f766e; }

.note-editor__btn--tone-10,
.note-editor__btn--tone-10:hover,
.note-editor__btn--tone-10:focus-visible { background: #166534; }

.note-mention {
  flex: 0 1 16rem;
  min-height: 8rem;
  display: none;
  flex-direction: column;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--muted) 70%, var(--surface));
}

.note-mention:not([hidden]) {
  display: flex;
}

.note-mention__hint {
  flex-shrink: 0;
  margin: 0;
  padding: 10px 12px 6px;
  color: color-mix(in srgb, var(--body) 68%, var(--muted));
  font-size: 12px;
  font-weight: 700;
}

.note-mention__tree {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0 8px 8px;
}

.note-mention__empty {
  margin: 0;
  padding: 4px 12px 12px;
  color: var(--body);
  font-size: 14px;
}

.page-tree {
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-tree .page-tree {
  margin-left: 0.4rem;
  padding-left: 0.9rem;
  border-left: 1px solid var(--line);
}

.page-tree__folder { margin: 0; }

.page-tree__dir {
  margin: 10px 0 4px;
  color: color-mix(in srgb, var(--body) 72%, var(--muted));
  font-size: 12px;
  font-weight: 700;
}

.page-tree__file {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.page-tree__file:hover,
.page-tree__file:focus-visible,
.page-tree__file.is-active {
  background: color-mix(in srgb, var(--ink) 8%, var(--muted));
  outline: none;
}

.page-tree__title {
  min-width: 0;
  font-weight: 600;
  color: var(--heading);
}

.page-tree__path {
  flex: 0 0 auto;
  color: color-mix(in srgb, var(--body) 62%, var(--muted));
  font-size: 12px;
}

.note-editor__btn .icon {
  width: 14px;
  height: 14px;
}

.note-editor__btn--wide {
  width: auto;
  gap: 5px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.note-editor__btn--tone-none {
  background:
    linear-gradient(135deg, transparent 44%, #b91c1c 44%, #b91c1c 56%, transparent 56%),
    var(--surface);
}

.note-editor__btn--tone-none:hover,
.note-editor__btn--tone-none:focus-visible {
  background:
    linear-gradient(135deg, transparent 44%, #b91c1c 44%, #b91c1c 56%, transparent 56%),
    var(--surface);
}

.note-editor__btn[hidden] { display: none; }

.note-editor__btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.note-editor__preview {
  overflow: auto;
  padding: 10px 12px;
  background: var(--surface);
}

.note-editor__preview[hidden] { display: none; }

.note-editor__error {
  margin: 0;
  padding: 8px 12px;
  border-top: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 600;
}

.note-editor__error[hidden] { display: none; }

.note-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--muted) 70%, var(--surface));
}

.note-link[hidden] { display: none; }

.note-link input {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.note-link .btn {
  flex: 0 0 auto;
  margin: 0;
  padding: 7px 12px;
  font-size: 13px;
}

.note-draft {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
  padding: 7px 12px;
  border-radius: 6px;
  background: var(--muted);
  color: var(--heading);
  font-size: 13px;
}

.note-draft[hidden] { display: none; }

.note-draft button {
  margin: 0;
  padding: 2px 4px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.note-editor__surface {
  min-height: 8rem;
  max-height: 16rem;
  overflow: auto;
  padding: 10px 12px;
  color: var(--body);
}
.note-editor__surface:focus { outline: none; }

.note-editor__surface:empty::before {
  content: attr(data-placeholder);
  color: color-mix(in srgb, var(--body) 70%, var(--muted));
}

.note-meta {
  margin: 4px 0 16px;
}

.note-meta summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--heading);
}

.note-meta .meta-list { margin-top: 12px; }

.modal::backdrop {
  background: color-mix(in srgb, var(--ink) 72%, transparent);
  backdrop-filter: blur(3px);
}

body:has([data-modal][open]) dialog.modal:not([data-modal])::backdrop {
  background: transparent;
  backdrop-filter: none;
}

.modal__box {
  margin: 0;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--ink) 6%, transparent),
    0 12px 28px color-mix(in srgb, var(--ink) 22%, transparent),
    0 28px 64px color-mix(in srgb, var(--ink) 28%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .modal::backdrop { backdrop-filter: none; }
}

.modal__box h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.modal__box > p {
  margin: 0 0 22px;
  color: var(--body);
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.help-coach {
  position: fixed;
  z-index: 80;
  display: flex;
  flex-direction: column;
  width: min(360px, calc(100vw - 24px));
  overflow: hidden;
  background: var(--surface);
  color: var(--body);
  border: 1px solid color-mix(in srgb, var(--line) 80%, var(--heading));
  border-radius: calc(var(--radius) + 4px);
  box-shadow:
    0 1px 0 rgb(var(--ink-rgb) / 4%),
    0 18px 40px rgb(var(--ink-rgb) / 16%);
}

.help-coach:not(.is-placed) {
  visibility: hidden;
}

.help-coach[hidden] {
  display: none !important;
}

.help-coach__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
}

.help-coach__kicker {
  margin: 0;
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fire);
}

.help-coach__meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.help-coach__pos {
  margin: 0;
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--body);
  font-variant-numeric: tabular-nums;
}

.help-coach__bar {
  height: 3px;
  margin: 0 16px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--muted);
}

.help-coach__bar span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--fire);
  transition: width 0.2s ease;
}

.help-coach__title {
  margin: 0;
  padding: 14px 16px 0;
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--heading);
}

.help-coach__title[hidden] {
  display: none;
}

.help-coach__text {
  margin: 0;
  padding: 8px 16px 4px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--heading);
}

.help-coach__text strong,
.help-coach__tips strong {
  font-weight: 700;
}

.help-coach__tips {
  margin: 10px 16px 0;
  padding: 9px 12px 10px;
  border-left: 3px solid var(--fire);
  border-radius: 0 6px 6px 0;
  background: var(--muted);
  font-family: var(--font-body);
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--body);
}

.help-coach__tips[hidden] {
  display: none;
}

.help-coach__tips-label {
  margin: 0 0 4px;
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fire);
}

.help-coach__tip-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.help-coach__tip-list li + li {
  margin-top: 4px;
}

.help-coach__text kbd {
  display: inline-block;
  margin: 0 0.1em;
  padding: 0.12em 0.45em;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--muted);
  box-shadow: 0 1px 0 var(--line);
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--heading);
}

.help-coach__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line);
}

.help-coach__nav {
  display: flex;
  flex: 1 1 auto;
  gap: 8px;
}

.help-coach__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: -4px -8px -4px 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--body);
  cursor: pointer;
}

.help-coach__close .icon {
  width: 16px;
  height: 16px;
}

.help-coach__close:hover {
  background: var(--muted);
  color: var(--heading);
}

.help-coach__back,
.help-coach__next {
  margin: 0;
  padding: 8px 14px;
  border-radius: 6px;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.help-coach__back {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--heading);
}

.help-coach__back[hidden] {
  display: none;
}

.help-coach__back:hover {
  background: var(--muted);
}

.help-coach__next {
  margin-left: auto;
  border: 0;
  background: var(--fire);
  color: var(--surface);
}

.help-coach__next:hover {
  filter: brightness(1.05);
}

.help-spot {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.help-spot[hidden] {
  display: none !important;
}

.help-spot__hole {
  position: absolute;
  box-sizing: border-box;
  border: 3px solid var(--fire);
  border-radius: 6px;
  background: transparent;
  box-shadow: 0 0 0 9999px color-mix(in srgb, var(--ink) 72%, transparent);
}

.help-spot__hole.is-on {
  animation: help-spot-pulse 1.2s ease-out 1;
}

.help-spot.is-ring .help-spot__hole {
  box-shadow: none;
}

.help-spot.is-ring .help-spot__hole.is-on {
  animation-name: help-spot-pulse-ring;
}

@keyframes help-spot-pulse {
  0% {
    box-shadow:
      0 0 0 0 color-mix(in srgb, var(--fire) 45%, transparent),
      0 0 0 9999px color-mix(in srgb, var(--ink) 72%, transparent);
  }

  100% {
    box-shadow:
      0 0 0 16px transparent,
      0 0 0 9999px color-mix(in srgb, var(--ink) 72%, transparent);
  }
}

@keyframes help-spot-pulse-ring {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--fire) 45%, transparent); }
  100% { box-shadow: 0 0 0 16px transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .help-spot__hole.is-on {
    animation: none;
  }
}

.help-frame {
  position: relative;
  margin: 4px 0 8px;
  padding: 20px 14px 14px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: var(--surface);
}

.help-frame__label {
  position: absolute;
  top: -9px;
  left: 16px;
  margin: 0;
  padding: 0 8px;
  background: var(--surface);
  color: var(--body);
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.help-frame__stage {
  position: relative;
  overflow: hidden;
  min-height: 28rem;
  background: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgb(var(--ink-rgb) / 8%);
}

.help-frame__view {
  display: block;
  width: 100%;
  height: min(36rem, calc(100dvh - 18rem));
  border: 0;
  background: var(--muted);
}

.help-frame__view[data-part="board"] {
  height: min(48rem, calc(100dvh - 18rem));
}

.help-frame__shield {
  position: absolute;
  inset: 0;
  cursor: default;
}

.help-parts {
  display: flex;
  gap: 4px;
  margin: 0 0 22px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  background: var(--muted);
}

.help-part {
  display: inline-flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--body);
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.help-part .icon {
  width: 16px;
  height: 16px;
}

.help-part.is-on {
  background: var(--surface);
  color: var(--heading);
  box-shadow: 0 1px 0 rgb(var(--ink-rgb) / 8%);
}

.help-part:hover:not(.is-on) {
  color: var(--heading);
}


/* Review page of the admin */
a.badge--link { text-decoration: none; }
a.badge--link:hover { text-decoration: none; filter: brightness(0.94); }

[data-export-form] .check { margin-bottom: 10px; }

.export-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 20px;
  min-height: 0;
  margin-bottom: 8px;
}

.export-label {
  display: block;
  margin: 0 0 8px;
  color: var(--heading);
  font-size: 14px;
  font-weight: 700;
}

.export-options textarea {
  margin: 0;
  font-size: 14px;
}

.export-preview {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.export-preview__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}

.export-stats {
  margin-bottom: 8px;
  color: var(--body);
  font-size: 13px;
}

.modal .export-preview__text {
  flex: 1 1 auto;
  width: 100%;
  min-height: 17rem;
  margin: 0;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--ink) 4%, var(--surface));
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre;
}

.modal.modal--export .modal__box { overflow: auto; }

@media (width <= 720px) {
  .export-grid { grid-template-columns: minmax(0, 1fr); }
}

.review-scope,
.review-note {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--body);
}

.review-status {
  min-height: 1.4em;
  margin: 0;
  font-size: 14px;
  color: var(--body);
}

.review-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 16px;
  margin: 8px 0 20px;
}

.review-head h1 { margin: 2px 0 4px; }

.review-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}

.review-back .icon,
.review-tab .icon,
.review-seg .icon,
.review-note-btn .icon,
.review-spot__more summary .icon {
  width: 16px;
  height: 16px;
}

.review-head__sub {
  margin: 0;
  font-size: 16px;
  color: var(--body);
}

.review-head__ver {
  margin-left: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.review-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.review-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: -1px;
  padding: 10px 14px;
  border-bottom: 2px solid transparent;
  color: var(--body);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.review-tab:hover {
  color: var(--heading);
  text-decoration: none;
}

.review-tab.is-active {
  border-bottom-color: var(--accent);
  color: var(--heading);
}

.review-tab__n {
  min-width: 1.7em;
  padding: 0 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 8%, var(--surface));
  font-size: 12px;
  text-align: center;
}

.review-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.review-toolbar .check {
  margin: 0;
  font-size: 14px;
}

.review-toolbar form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.review-toolbar select {
  width: auto;
  margin: 0;
  padding: 6px 10px;
  font-size: 14px;
}

.review-page__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 28px 0 0;
  font-size: 18px;
}

.review-page__title span {
  color: var(--body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}

.review-spot {
  margin-top: 12px;
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgb(var(--ink-rgb) / 6%);
}

.review-spot__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 3%, var(--surface));
}

.review-chip {
  padding: 1px 8px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--ink) 10%, var(--surface));
  color: var(--heading);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.review-spot__title {
  color: var(--heading);
  overflow-wrap: anywhere;
}

.review-spot__section {
  font-size: 13px;
  color: var(--body);
}

.review-spot__more {
  flex-basis: 100%;
  font-size: 13px;
  color: var(--body);
}

.review-spot__more summary {
  display: flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  cursor: pointer;
  list-style: none;
}

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

.review-spot__facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 14px;
  margin: 8px 0 0;
}

.review-spot__facts dt {
  font-weight: 700;
  color: var(--heading);
}

.review-spot__facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.review-spot__facts code { font-size: 12px; }

.review-comment {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0 12px;
  padding: 16px 20px;
  border-left: 3px solid var(--accent);
}

.review-comment + .review-comment { border-top: 1px solid var(--line); }

.review-comment.is-done,
.review-comment.is-rejected {
  border-left-color: color-mix(in srgb, var(--ink) 22%, var(--surface));
}

.review-comment__pick {
  display: flex;
  margin: 0;
  padding-top: 3px;
}

.review-comment__pick input {
  width: 1.1em;
  height: 1.1em;
  margin: 0;
  accent-color: var(--accent);
}

.review-comment__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
  font-size: 13px;
  color: var(--body);
}

.review-comment__meta strong {
  font-size: 15px;
  color: var(--heading);
}

.review-agree {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
}

.review-agree .icon {
  width: 14px;
  height: 14px;
}

.review-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.review-state .icon {
  width: 14px;
  height: 14px;
}

.review-state--open {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent);
}

.review-state--done {
  background: color-mix(in srgb, var(--ink) 10%, var(--surface));
  color: var(--heading);
}

.review-state--rejected {
  border: 1px dashed color-mix(in srgb, var(--ink) 40%, var(--surface));
  color: var(--body);
}

.review-comment__body {
  margin: 8px 0 12px;
  color: var(--heading);
  font-size: 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.review-comment.is-done .review-comment__body,
.review-comment.is-rejected .review-comment__body { opacity: 0.62; }

.review-comment:target {
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

.review-comment__note {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-left: 3px solid color-mix(in srgb, var(--ink) 25%, var(--surface));
  border-radius: 0 6px 6px 0;
  background: color-mix(in srgb, var(--ink) 4%, var(--surface));
  color: var(--body);
  font-size: 14px;
}

.review-comment__note p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.review-comment__note strong {
  display: block;
  margin-bottom: 2px;
  color: var(--heading);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.review-decision {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

.review-seg {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.review-seg button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--surface);
  color: var(--body);
  font: inherit;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.review-seg button:first-child { border-left: 0; }

.review-seg button:hover {
  background: color-mix(in srgb, var(--ink) 6%, var(--surface));
  color: var(--heading);
}

.review-seg button[aria-pressed="true"] {
  background: var(--fire);
  color: var(--surface);
}

.review-seg button:focus-visible,
.review-note-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.review-spot__more summary .icon:first-child {
  transform: rotate(-90deg);
  transition: transform 0.15s;
}

.review-spot__more[open] summary .icon:first-child { transform: none; }

.review-note-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--body);
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.review-note-btn:hover { color: var(--heading); }

.review-quote {
  margin: 0 0 14px;
  padding: 8px 12px;
  border-left: 3px solid var(--line);
  border-radius: 0 6px 6px 0;
  background: color-mix(in srgb, var(--ink) 4%, var(--surface));
  color: var(--body);
  font-size: 14px;
}

.review-quote strong {
  display: block;
  color: var(--heading);
  font-size: 13px;
}

.review-quote span {
  display: -webkit-box;
  overflow: hidden;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}

.modal .review-count {
  margin: 4px 0 14px;
  color: var(--body);
  font-size: 13px;
  text-align: right;
}

.review-bar {
  position: sticky;
  bottom: 16px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--surface);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--ink) 30%, transparent);
}

.review-bar[hidden] { display: none; }

.review-bar__count {
  margin-right: auto;
  font-size: 14px;
  font-weight: 700;
}

.review-bar .btn--ghost {
  border-color: color-mix(in srgb, var(--surface) 40%, transparent);
  color: var(--surface);
}

@media (width <= 560px) {
  .review-comment { padding: 14px; }
  .review-state { margin-left: 0; }
}

/* Phone layout: one width for the app chrome. See doc 19. */
@media (width <= 700px) {
  .top__inner,
  .wrap,
  .foot__inner { width: calc(100% - 32px); }

  .top__inner {
    flex-wrap: wrap;
    gap: 0 12px;
    min-height: 60px;
    padding: 8px 0;
  }

  .brand img { height: 40px; }

  .top__menu:has(.top__tools :is(a, button)) .top__burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0 -10px 0 auto;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--surface);
    cursor: pointer;
  }

  .top__burger:hover,
  .top__burger:focus-visible { color: var(--accent); }

  .top__menu.is-open .top__bars { background: transparent; }
  .top__menu.is-open .top__bars::before { top: 0; transform: rotate(45deg); }
  .top__menu.is-open .top__bars::after { top: 0; transform: rotate(-45deg); }

  .top__tools {
    display: none;
    flex: 0 0 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 4px 0 10px;
    border-top: 1px solid color-mix(in srgb, var(--surface) 18%, transparent);
  }

  .top__menu.is-open .top__tools { display: flex; }
  .top__session { flex-direction: column; align-items: stretch; gap: 0; }
  .top__logout { display: block; }

  .top__who,
  .top__icon {
    justify-content: flex-start;
    width: 100%;
    height: 48px;
    padding: 0 4px;
  }

  .top__who-name { max-width: none; flex: 1 1 auto; text-align: left; }
  .top__icon { flex-direction: row-reverse; justify-content: flex-end; }

  main { padding: 24px 0 32px; }
  .section-head { gap: 12px; margin-bottom: 16px; }
  h1 { font-size: 28px; }
  .lede { font-size: 17px; }
  .panel { padding: 16px; }
  .grid { margin-top: 20px; }
  .group { padding: 14px; }

  .card {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
  }

  .card__main { flex: 1 1 0; }
  .card__heading { flex-wrap: wrap; }

  .card__heading h2,
  .card__heading h2 a {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .card__heading .badge { margin-left: 0; }

  .card__actions,
  .row-actions { flex: 1 1 100%; justify-content: flex-start; }

  .card__actions .btn { flex: 0 0 auto; }
  .card__version { flex: 1 1 auto; }
  .card__version select { width: 100%; min-width: 0; }
  .card--version { padding: 10px 12px; }
}

/* Touch pointer: targets of 44 px and fields of 16 px, at any width. See doc 19. */
@media (pointer: coarse) {
  .btn,
  .top__icon,
  .top__who,
  .help-part,
  .help-coach__back,
  .help-coach__next,
  .row-menu__item,
  .check { min-height: 44px; }

  .top__icon,
  .top__who { height: 44px; }

  .btn.btn--icon,
  .card__grip,
  .card--version .card__grip {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }

  .help-coach__close {
    width: 44px;
    height: 44px;
    margin: -8px -8px -8px 0;
  }

  .card__version select {
    height: 44px;
    line-height: 44px;
  }

  /* A finger cannot drag a card. Show the buttons that move it instead. */
  .board.js-sortable .card__grip { display: none; }

  .board.js-sortable .card__order-buttons {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
  }

  .row-menu__item { padding: 0 12px; }

  .note-editor__btn {
    width: 44px;
    height: 44px;
  }

  .note-editor__group--tones { gap: 0; }

  .note-editor__btn--tone,
  .note-editor__btn--tone:is(:hover, :focus-visible) {
    padding: 14px;
    border: 0;
    background-clip: content-box;
  }

  .site-more > summary {
    display: flex;
    align-items: center;
    min-height: 44px;
  }

  .drop__lead { display: none; }

  .drop__text label {
    display: inline-block;
    padding: 10px 6px;
  }

  input[type="password"],
  input[type="text"],
  textarea,
  select { font-size: 16px; }
}

/* A card on a phone with a touch pointer: the move buttons sit beside the title. */
@media (pointer: coarse) and (width <= 700px) {
  .card__order {
    order: 1;
    flex-direction: row;
  }

  .card__order-buttons {
    display: flex;
    gap: 4px;
  }

  .row-actions { order: 2; }
}

/* The guide on a phone: the coach docks at the bottom and the tabs scroll. See doc 19. */
@media (width <= 700px) {
  .help-demo { padding-bottom: 42dvh; }

  .help-parts {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .help-part {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .help-frame { padding: 18px 8px 8px; }

  .help-frame__view,
  .help-frame__view[data-part="board"] { height: min(40rem, 70dvh); }

  .help-coach--dock {
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 8px;
    width: auto;
    max-height: 40dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .help-coach--dock .help-coach__foot {
    position: sticky;
    bottom: 0;
    background: var(--surface);
  }
}

/* Touch screen: a swipe on the coach steps. The buttons stay for a screen reader. See doc 19. */
.help-coach__swipe-hint { display: none; }

@media (pointer: coarse) {
  .help-coach { touch-action: pan-y; }

  .help-coach__swipe-hint {
    display: block;
    margin: 0;
    color: var(--body);
    font: 600 12px/1.4 var(--font-head);
  }

  .help-coach__nav .help-coach__back,
  .help-coach__nav .help-coach__next {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .help-coach.is-final .help-coach__nav .help-coach__next {
    position: static;
    width: auto;
    height: auto;
    min-height: 44px;
    margin: 0;
    padding: 9px 14px;
    overflow: visible;
    clip-path: none;
  }
}
