/* ==========================================================================
   AutoR — reusable components
   ========================================================================== */

/* Page header --------------------------------------------------------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.page-head-copy {
  min-width: 0;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow .demo-dot {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.1);
}
.page-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.035em;
}
.page-sub {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--muted);
}
.page-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
}

/* Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 15px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.16s var(--ease), background 0.16s, border-color 0.16s, box-shadow 0.16s, color 0.16s;
}
.btn .icon {
  width: 17px;
  height: 17px;
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  color: #fffefb;
  background: linear-gradient(180deg, #1e2a33, var(--blue));
  border-color: #0b1217;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 6px 16px -8px rgba(18, 28, 35, 0.8);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #26343e, #16222b);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 10px 22px -10px rgba(18, 28, 35, 0.85);
}

.btn-dark {
  color: #fffefb;
  background: var(--ink);
  border-color: var(--ink);
}
.btn-dark:hover {
  background: #26343e;
}

.btn-lime {
  color: #121c23;
  background: var(--lime);
  border-color: #ecc354;
  box-shadow: 0 8px 20px -12px rgba(255, 194, 26, 0.9);
}
.btn-lime:hover {
  background: #fadc8a;
}

.btn-white {
  color: var(--ink-soft);
  background: var(--surface);
  border-color: var(--line);
  box-shadow: 0 1px 2px rgba(18, 28, 35, 0.03);
}
.btn-white:hover {
  border-color: #dcd9d4;
  background: #fffefc;
  box-shadow: 0 4px 12px rgba(18, 28, 35, 0.06);
}

.btn-soft {
  color: var(--blue-dark);
  background: #fffbed;
  border-color: #fff7de;
}
.btn-soft:hover {
  background: #fff8e4;
}

.btn-ghost {
  color: var(--muted);
  background: transparent;
  border-color: transparent;
}
.btn-ghost:hover {
  color: var(--ink);
  background: rgba(18, 28, 35, 0.045);
}

.btn-danger {
  color: #b42318;
  background: var(--red-soft);
  border-color: #fee4e2;
}
.btn-danger:hover {
  background: #fee4e2;
}

.btn-sm {
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 12px;
}
.btn-sm .icon {
  width: 15px;
  height: 15px;
}
.btn-xs {
  height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 11.5px;
  gap: 6px;
}
.btn-xs .icon {
  width: 13px;
  height: 13px;
}
.btn-lg {
  height: 46px;
  padding: 0 19px;
  border-radius: 12px;
  font-size: 14px;
}
.btn-block {
  width: 100%;
}

.icon-btn-sm {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--muted);
  transition: background 0.16s, color 0.16s;
}
.icon-btn-sm:hover {
  background: rgba(18, 28, 35, 0.05);
  color: var(--ink);
}
.icon-btn-sm .icon {
  width: 17px;
  height: 17px;
}

/* Cards --------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.card-pad {
  padding: 22px;
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.card-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.card-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.16s;
}
.card-more .icon {
  width: 13px;
  height: 13px;
}
.card-more:hover {
  color: var(--blue);
}

/* Badges & chips ------------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 23px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.badge .icon {
  width: 12px;
  height: 12px;
}
.badge-green { color: var(--green-deep); background: var(--green-soft); }
.badge-blue { color: var(--blue-dark); background: #fffbef; }
.badge-amber { color: #b54708; background: var(--amber-soft); }
.badge-red { color: #b42318; background: var(--red-soft); }
.badge-violet { color: #5b3fd6; background: var(--violet-soft); }
.badge-gray { color: var(--ink-soft); background: #f7f6f2; }
.badge-lime { color: #4d3b0b; background: #f9f0d8; }
.badge-dark { color: #fff8e1; background: rgba(255, 255, 255, 0.1); }
.badge-dot::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px;
  border-radius: 7px;
  background: #faf8f5;
  border: 1px solid #f5f2ec;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
  white-space: nowrap;
}
.chip .icon {
  width: 12px;
  height: 12px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--green-deep);
  background: var(--green-soft);
  border-radius: 6px;
  padding: 3px 6px;
  white-space: nowrap;
}
.delta .icon {
  width: 11px;
  height: 11px;
}
.delta.down {
  color: var(--green-deep);
}
.delta.neutral {
  color: var(--muted);
  background: #f7f6f2;
}
.delta.amber {
  color: #b54708;
  background: var(--amber-soft);
}

/* Avatars ------------------------------------------------------------- */
.avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  flex: none;
  background: #f6f4ef;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid rgba(18, 28, 35, 0.06);
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-sm { width: 32px; height: 32px; font-size: 11px; }
.avatar-md { width: 42px; height: 42px; }
.avatar-lg { width: 52px; height: 52px; font-size: 15px; }
.avatar-xl { width: 64px; height: 64px; font-size: 18px; }
.avatar-ring {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px #f1eee6;
}
.avatar-online::after {
  content: "";
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--surface);
}
.avatar-group {
  display: flex;
  align-items: center;
}
.avatar-group .avatar {
  margin-left: -8px;
  border: 2px solid var(--surface);
}
.avatar-group .avatar:first-child {
  margin-left: 0;
}

/* Tabs / segmented ---------------------------------------------------- */
.segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: #fffaeb;
  border: 1px solid #f5f3ed;
}
.segmented button {
  height: 27px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  transition: background 0.16s, color 0.16s, box-shadow 0.16s;
}
.segmented button:hover {
  color: var(--ink-soft);
}
.segmented button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(18, 28, 35, 0.1);
}

.tab-row {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--line);
}
.tab-row button {
  position: relative;
  height: 40px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.tab-row button::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: transparent;
  transition: background 0.16s;
}
.tab-row button.active {
  color: var(--ink);
}
.tab-row button.active::after {
  background: var(--blue);
}
.tab-row button:hover {
  color: var(--ink);
}

/* Switch -------------------------------------------------------------- */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: none;
  width: 38px;
  height: 22px;
  cursor: pointer;
}
.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.switch-track,
.switch > span:not(.sr-only) {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: #e0ddd9;
  transition: background 0.2s;
  pointer-events: none;
}
.switch-track::after,
.switch > span:not(.sr-only)::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fffefb;
  box-shadow: 0 1px 2px rgba(18, 28, 35, 0.22);
  transition: transform 0.2s var(--ease);
}
.switch input:checked + .switch-track,
.switch input:checked + span {
  background: var(--blue);
}
.switch input:checked + .switch-track::after,
.switch input:checked + span::after {
  transform: translateX(16px);
}
.switch input:focus-visible + .switch-track,
.switch input:focus-visible + span {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.switch input:disabled {
  cursor: not-allowed;
}
.switch input:disabled + .switch-track,
.switch input:disabled + span {
  opacity: 0.5;
}
.switch.switch-sm {
  width: 32px;
  height: 19px;
}
.switch.switch-sm .switch-track::after,
.switch.switch-sm > span:not(.sr-only)::after {
  top: 2.5px;
  left: 2.5px;
  width: 14px;
  height: 14px;
}
.switch.switch-sm input:checked + .switch-track::after,
.switch.switch-sm input:checked + span::after {
  transform: translateX(13px);
}

/* Forms --------------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field + .field {
  margin-top: 15px;
}
.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
}
.field-label small {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted-light);
}
.field-hint {
  font-size: 11px;
  color: var(--muted-light);
  line-height: 1.45;
}
.input,
.textarea,
.select {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: #fffefc;
  color: var(--ink);
  font-size: 12.5px;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}
.input::placeholder,
.textarea::placeholder {
  color: #bcb7ad;
}
.input:hover,
.textarea:hover,
.select:hover {
  border-color: #d8d5d0;
}
.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: #567287;
  background: #fffefb;
  box-shadow: 0 0 0 3px rgba(255, 194, 26, 0.18);
}
.textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.55;
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
  cursor: pointer;
}
.input-icon-wrap {
  position: relative;
}
.input-icon-wrap .icon {
  position: absolute;
  left: 11px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--muted-light);
  pointer-events: none;
}
.input-icon-wrap .input {
  padding-left: 34px;
}
.form-hint {
  padding: 11px 12px;
  border-radius: 9px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
  display: flex;
  gap: 8px;
}
.form-hint .icon {
  width: 15px;
  height: 15px;
  margin-top: 1px;
  color: var(--blue);
  flex: none;
}

/* Segmented radio cards */
.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.choice-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 13px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fffefc;
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s, box-shadow 0.16s;
}
.choice-card:hover {
  border-color: #d3d0c9;
}
.choice-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.choice-card strong {
  font-size: 12.5px;
  font-weight: 600;
}
.choice-card span {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}
.choice-card .choice-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1.5px solid #e2e0dc;
  color: transparent;
  display: grid;
  place-items: center;
  transition: all 0.16s;
}
.choice-card .choice-check .icon {
  width: 11px;
  height: 11px;
}
.choice-card input:checked ~ .choice-check {
  border-color: var(--blue);
  background: var(--blue);
  color: #fffefb;
}
.choice-card:has(input:checked) {
  border-color: #4f697b;
  background: #fffcf5;
  box-shadow: 0 0 0 3px rgba(255, 194, 26, 0.126);
}

/* Slider */
.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--blue) 0 var(--range-p, 40%), #f2efe7 var(--range-p, 40%) 100%);
  outline: none;
  cursor: pointer;
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fffefb;
  border: 2px solid var(--blue);
  box-shadow: 0 1px 3px rgba(18, 28, 35, 0.18);
  cursor: grab;
}
.range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fffefb;
  border: 2px solid var(--blue);
  box-shadow: 0 1px 3px rgba(18, 28, 35, 0.18);
  cursor: grab;
}
.range:active::-webkit-slider-thumb {
  cursor: grabbing;
}
.range-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.range-value {
  min-width: 58px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* Popovers ------------------------------------------------------------ */
.popover-wrap {
  position: relative;
}
.popover {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 80;
  width: 340px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 22px 50px -18px rgba(18, 28, 35, 0.3);
  animation: pop-in 0.18s var(--ease) both;
  overflow: hidden;
}
@keyframes pop-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
}
.popover-head strong {
  font-size: 12.5px;
  font-weight: 600;
}
.popover-head button {
  font-size: 11px;
  font-weight: 500;
  color: var(--blue);
}
.notification-item {
  display: flex;
  gap: 10px;
  padding: 12px 15px;
  border-bottom: 1px solid #f8f7f3;
  transition: background 0.15s;
}
.notification-item:last-child {
  border-bottom: 0;
}
.notification-item:hover {
  background: var(--surface-soft);
}
.notification-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #fffbef;
  color: var(--blue);
  flex: none;
}
.notification-icon .icon {
  width: 15px;
  height: 15px;
}
.notification-icon.green {
  background: var(--green-soft);
  color: var(--green-deep);
}
.notification-icon.amber {
  background: var(--amber-soft);
  color: #b54708;
}
.notification-item p {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-soft);
}
.notification-item p strong {
  color: var(--ink);
}
.notification-item time {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  color: var(--muted-light);
}
.user-popover {
  width: 224px;
  padding: 6px;
}
.user-popover-top {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 9px 9px 11px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 5px;
}
.user-popover-top strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
}
.user-popover-top span {
  font-size: 10.5px;
  color: var(--muted);
}
.popover-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 9px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--ink-soft);
  text-align: left;
  transition: background 0.15s;
}
.popover-menu-item:hover {
  background: var(--surface-soft);
}
.popover-menu-item .icon {
  width: 15px;
  height: 15px;
  color: var(--muted);
}
.popover-menu-item.danger {
  color: #b42318;
}
.popover-menu-item.danger .icon {
  color: #d92d20;
}
.popover-menu-item .shortcut {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted-light);
}

/* Toasts -------------------------------------------------------------- */
.toast-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 13px;
  border-radius: 12px;
  background: #0c1113;
  color: #fff8e1;
  box-shadow: 0 20px 44px -18px rgba(14, 23, 29, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: auto;
  animation: toast-in 0.3s var(--ease) both;
}
.toast.leaving {
  animation: toast-out 0.22s ease both;
}
.toast-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 194, 26, 0.12);
  color: var(--lime);
  flex: none;
}
.toast-icon .icon {
  width: 15px;
  height: 15px;
}
.toast.success .toast-icon {
  background: rgba(18, 183, 106, 0.16);
  color: #6ce9a6;
}
.toast.info .toast-icon {
  background: rgba(255, 194, 26, 0.14);
  color: #fcda7d;
}
.toast-body {
  min-width: 0;
  padding-top: 1px;
}
.toast-body strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 2px;
}
.toast-body p {
  font-size: 11.5px;
  line-height: 1.45;
  color: #c5c1b9;
}
.toast-close {
  margin-left: auto;
  color: #9e9789;
  padding: 2px;
  flex: none;
}
.toast-close:hover {
  color: #fffefb;
}
.toast-close .icon {
  width: 14px;
  height: 14px;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(6px) scale(0.98); }
}

/* Modal / drawer ------------------------------------------------------ */
.modal-root {
  position: relative;
  z-index: 150;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(14, 23, 29, 0.46);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: fade-in 0.2s ease both;
  overflow-y: auto;
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal {
  width: min(520px, 100%);
  max-height: min(820px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  box-shadow: var(--shadow-float);
  animation: modal-in 0.26s var(--ease) both;
  overflow: hidden;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal.modal-lg {
  width: min(660px, 100%);
}
.modal.modal-sm {
  width: min(420px, 100%);
}
.modal-backdrop.drawer-backdrop {
  place-items: stretch end;
  padding: 12px;
}
.modal.drawer {
  width: min(460px, 100%);
  height: 100%;
  max-height: 100%;
  border-radius: 18px;
  animation: drawer-in 0.3s var(--ease) both;
}
@keyframes drawer-in {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.modal-head h2 {
  font-size: 18px;
  letter-spacing: -0.03em;
}
.modal-head p {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
}
.modal-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
  flex: none;
}
.modal-close:hover {
  background: #f6f4ef;
  color: var(--ink);
}
.modal-close .icon {
  width: 17px;
  height: 17px;
}
.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
}
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 15px 22px;
  border-top: 1px solid var(--line);
  background: #fffefc;
  flex: none;
}
.modal-foot .foot-note {
  margin-right: auto;
  font-size: 10.5px;
  color: var(--muted-light);
}
.modal-divider {
  height: 1px;
  background: var(--line);
  margin: 18px 0;
}
.modal-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted-light);
  margin-bottom: 9px;
}

/* Command palette ----------------------------------------------------- */
.palette-backdrop {
  place-items: start center;
  padding-top: clamp(60px, 12vh, 150px);
}
.palette {
  width: min(600px, 100%);
  background: var(--surface);
  border-radius: 17px;
  box-shadow: var(--shadow-float);
  border: 1px solid rgba(255, 255, 255, 0.6);
  overflow: hidden;
  animation: modal-in 0.24s var(--ease) both;
}
.palette-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 17px;
  border-bottom: 1px solid var(--line);
}
.palette-search .icon {
  width: 19px;
  height: 19px;
  color: var(--muted);
}
.palette-search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
}
.palette-search kbd {
  font-family: var(--font);
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted-light);
}
.palette-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 8px;
}
.palette-group {
  padding: 8px 9px 5px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-light);
}
.palette-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 9px;
  text-align: left;
  transition: background 0.12s;
}
.palette-item:hover,
.palette-item.is-active {
  background: var(--surface-blue);
}
.palette-item-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #fffbee;
  color: var(--muted);
  flex: none;
}
.palette-item.is-active .palette-item-icon,
.palette-item:hover .palette-item-icon {
  background: #fff9e6;
  color: var(--blue);
}
.palette-item-icon .icon {
  width: 15px;
  height: 15px;
}
.palette-item-text {
  min-width: 0;
  flex: 1;
}
.palette-item-text strong {
  display: block;
  font-size: 12px;
  font-weight: 500;
}
.palette-item-text span {
  display: block;
  font-size: 10.5px;
  color: var(--muted-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.palette-item-shortcut {
  font-size: 10px;
  color: var(--muted-light);
}
.palette-empty {
  padding: 38px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.palette-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 15px;
  border-top: 1px solid var(--line);
  background: #fffefa;
  font-size: 10px;
  color: var(--muted-light);
}
.palette-foot span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.palette-foot kbd {
  font-family: var(--font);
  font-size: 9px;
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fffefb;
}

/* Empty state --------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 44px 22px;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--muted);
}
.empty-icon .icon {
  width: 22px;
  height: 22px;
}
.empty-state h3 {
  font-size: 14px;
  margin-bottom: 5px;
}
.empty-state p {
  max-width: 300px;
  margin: 0 auto;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

/* Page enter */
.page {
  animation: page-in 0.4s var(--ease) both;
}
@keyframes page-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Misc */
.divider {
  height: 1px;
  background: var(--line);
}
.hover-lift {
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s;
}
.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px -22px rgba(18, 28, 35, 0.28);
}
.muted { color: var(--muted); }
.strong { font-weight: 600; }
.tabular { font-variant-numeric: tabular-nums; }
.text-blue { color: var(--blue); }
.text-green { color: var(--green-deep); }
.text-amber { color: #b54708; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Toasts must never block actions behind them. */
.toast {
  pointer-events: none;
}
.toast-close {
  pointer-events: auto;
}
