.btn-osool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.collapsing {
  transition: height var(--dur-base) var(--ease);
}
.btn-osool:hover {
  background: var(--surface-soft);
  border-color: var(--muted);
}
.btn-primary-osool {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.btn-primary-osool:hover {
  background: color-mix(in srgb, var(--accent) 90%, var(--ink));
  color: var(--on-accent);
  border-color: var(--accent);
}
.btn-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: none;
  border: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  min-height: 44px;
  padding: 5px 0;
}
.btn-text:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.icon-button {
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 44px;
  padding: 8px;
  border-radius: 8px;
  color: var(--muted);
  position: relative;
}
.icon-button:hover {
  background: var(--tint);
  color: var(--accent);
}
.notification-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  position: absolute;
  top: 9px;
  inset-inline-end: 11px;
  border: 1px solid var(--page);
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-width: 0;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-subtitle {
  font-size: 11px;
  margin-top: 4px;
}
.provenance {
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  min-height: 25px;
  padding: 3px 7px;
  display: inline-flex;
  gap: 5px;
  align-items: center;
  white-space: nowrap;
}
.provenance::before {
  content: "";
  width: 4px;
  height: 4px;
  border: 1px solid currentColor;
  border-radius: 50%;
}
.provenance:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.segmented {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--surface-soft);
  padding: 3px;
  border-radius: 7px;
}
.segmented button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  min-width: 36px;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 5px;
}
.segmented button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px #17251f12;
}
.segmented button:hover {
  color: var(--accent);
}
.input-osool {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  min-height: 44px;
  padding: 10px 12px;
  width: 100%;
}
.input-osool::placeholder {
  color: var(--muted);
}
.input-with-icon {
  position: relative;
}
.input-with-icon > .icon {
  position: absolute;
  inset-inline-start: 12px;
  top: 14px;
  width: 16px;
  height: 16px;
  color: var(--muted);
}
.input-with-icon input {
  padding-inline-start: 36px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--tint);
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 650;
}
.coverage-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: inline-block;
  background: currentColor;
}
.count-badge {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 5px;
  margin-inline-start: 7px;
}
.empty-state {
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
}
.empty-state > .icon {
  width: 28px;
  height: 28px;
  margin-bottom: 12px;
  color: var(--accent);
}
.empty-state h3 {
  color: var(--ink);
  margin-bottom: 6px;
}
.empty-state p {
  font-size: 12px;
  max-width: 330px;
  margin: auto;
}
.empty-state .btn-osool {
  margin-top: 15px;
}
.notice {
  padding: 15px 16px;
  border-radius: 10px;
  background: var(--surface-soft);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
}
.notice .icon {
  margin-inline-end: 7px;
  color: var(--accent);
}
.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  min-height: 44px;
  cursor: pointer;
}
.inline-check input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}
.panel-error {
  padding: 40px;
  min-height: 220px;
  display: grid;
  place-content: center;
  gap: 16px;
  text-align: center;
}
/* Native dialogs supply a top layer, focus containment, and Escape semantics. */
dialog {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0;
  box-shadow: var(--shadow);
  max-height: 100dvh;
}
dialog::backdrop {
  background: #0d1a2466;
  backdrop-filter: blur(3px);
}
dialog[open] {
  animation: dialog-in var(--dur-slow) var(--ease);
}
.drawer {
  position: fixed;
  inset-block: 0;
  inset-inline-start: auto;
  inset-inline-end: 0;
  margin: 0;
  width: min(440px, 100%);
  height: 100dvh;
  max-width: 100%;
  border-radius: 18px 0 0 18px;
  max-height: 100dvh;
  overflow: auto;
}
.drawer[open] {
  animation-name: drawer-in;
}
@keyframes drawer-in {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
html[dir="rtl"] .drawer[open] {
  animation-name: drawer-in-rtl;
}
@keyframes drawer-in-rtl {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.dialog-header {
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 2;
}
.dialog-header h2 {
  font-size: 20px;
}
.dialog-body {
  padding: 24px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}
.dialog-body > p {
  margin-bottom: 20px;
}
.dialog-body h3 {
  margin: 24px 0 12px;
}
.dialog-body h3:first-child {
  margin-top: 0;
}
.dialog-body .notice {
  margin-block: 20px;
}
.search-dialog {
  margin: 12vh auto auto;
  width: min(620px, calc(100% - 32px));
  border-radius: 18px;
  max-height: 75dvh;
  overflow: auto;
}
.search-input-row {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.search-input-row input {
  min-width: 0;
  flex: 1;
  font-size: 16px;
  border: 0;
  background: none;
  color: var(--ink);
  height: 44px;
}
.search-input-row input:focus-visible {
  outline-offset: 0;
}
.search-results {
  padding: 12px;
  min-height: 180px;
}
.search-group {
  padding: 8px 12px;
}
.search-result {
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: start;
  min-height: 58px;
}
.search-result:hover,
.search-result:focus {
  background: var(--tint);
}
.search-result .result-main {
  flex: 1;
  font-size: 13px;
  font-weight: 650;
}
.search-result small {
  color: var(--muted);
  font-size: 11px;
}
.search-help {
  border-top: 1px solid var(--border);
  padding: 12px 24px;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}
.palette-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.palette-choice {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 8px;
  font-size: 11px;
  min-height: 84px;
}
.palette-choice[aria-pressed="true"] {
  border: 2px solid var(--accent);
  background: var(--tint);
}
.palette-swatch {
  display: block;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  margin: 0 auto 9px;
  background: var(--swatch);
  box-shadow: 0 0 0 4px var(--surface);
}
.choice-list {
  display: grid;
  gap: 8px;
}
.chooser-row {
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.chooser-row > div {
  flex: 1;
}
.chooser-row strong {
  font-size: 13px;
}
.chooser-row small {
  display: block;
  color: var(--muted);
}
.preview-logo {
  width: 64px;
  height: 64px !important;
  font-size: 22px !important;
  margin-bottom: 20px;
}
.preview-title {
  font-size: 26px !important;
  margin: 0 0 5px !important;
}
.detail-list {
  margin: 24px 0;
}
.detail-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.detail-list dt {
  font-weight: 500;
  color: var(--muted);
}
.detail-list dd {
  margin: 0;
  text-align: end;
}
.notification-row {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.notification-row p {
  font-size: 13px;
  color: var(--ink);
}
.notification-row small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}
.toast-region {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  z-index: 100;
  background: var(--ink);
  color: var(--surface);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: calc(100% - 32px);
  font-size: 12px;
}
.toast-region button {
  color: inherit;
  border: 0;
  background: none;
  min-height: 44px;
  font-weight: 750;
  text-decoration: underline;
}
.skeleton {
  height: 220px;
  background: var(--surface-soft);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.reference-section {
  padding: 28px;
  margin-bottom: 24px;
}
.reference-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}
.reference-swatch {
  height: 90px;
  border-radius: 12px;
  padding: 16px;
  background: var(--sample-bg);
  color: var(--sample-ink);
  display: flex;
  align-items: end;
}
.reference-section > h2 {
  margin-bottom: 18px;
}
.reference-stack {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.reference-type {
  font-size: 40px;
  letter-spacing: -1px;
  margin: 12px 0;
}
@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (max-width: 767px) {
  .drawer {
    border-radius: 0;
  }
  .dialog-header,
  .dialog-body {
    padding: 20px;
  }
  .reference-grid {
    grid-template-columns: 1fr;
  }
  .reference-section {
    padding: 20px;
  }
  .toast-region {
    bottom: 16px;
    inset-inline-end: 16px;
  }
  .search-dialog {
    margin-top: 24px;
    max-height: calc(100dvh - 48px);
  }
  .provenance {
    min-height: 30px;
  }
  .segmented button {
    min-height: 38px;
  }
}
