:root {
  --bg: #f5f2ee;
  --surface: #ffffff;
  --surface-2: #faf7f3;
  --text: #1d1915;
  --muted: #776c62;
  --line: #e8e1d9;
  --accent: #f2551d;
  --accent-ink: #ffffff;
  --accent-soft: #fdeee6;
  --ok: #2f9e44;
  --ok-soft: #e5f5e9;
  --danger: #e03131;
  --warn: #d9480f;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(29, 25, 21, 0.05), 0 6px 20px rgba(29, 25, 21, 0.05);
  --top-h: 60px;
  --tab-h: 64px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121010;
    --surface: #1d1a18;
    --surface-2: #262220;
    --text: #f3ede7;
    --muted: #a59a90;
    --line: #34302c;
    --accent-soft: #3b2418;
    --ok-soft: #1d3324;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.45 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll {
  overflow: hidden;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
a {
  color: var(--accent);
}
p {
  margin: 0;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 14px;
}
.warn {
  color: var(--warn);
}
[hidden] {
  display: none !important;
}

/* ------------------------------------------------------------------ icons */
.ic {
  display: inline-flex;
  flex: none;
  width: 20px;
  height: 20px;
}
.ic svg {
  width: 100%;
  height: 100%;
}

/* ------------------------------------------------------------------ boot / login */
.boot,
.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login {
  background:
    radial-gradient(70% 50% at 10% 0%, var(--accent-soft) 0%, transparent 70%),
    var(--bg);
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.login-card {
  width: min(100%, 380px);
  padding: 32px 24px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.login-card h1 {
  margin: 8px 0 4px;
  font: 800 30px/1.1 'Roboto Condensed', sans-serif;
  letter-spacing: 0.02em;
}
.login-card > .muted {
  margin-bottom: 22px;
}
.login-logo {
  width: 52px;
  height: 52px;
  color: var(--accent);
}
.login-error {
  margin: -4px 0 14px;
  color: var(--danger);
  font-size: 14px;
}

/* ------------------------------------------------------------------ app frame */
.app {
  min-height: 100dvh;
  padding: calc(var(--top-h) + var(--safe-t)) 0 calc(var(--tab-h) + var(--safe-b));
}
.topbar {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--top-h) + var(--safe-t));
  padding: var(--safe-t) 8px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.tb-logo {
  width: 30px;
  height: 30px;
  margin: 0 4px;
  color: var(--accent);
  flex: none;
}
.tb-titles {
  flex: 1;
  min-width: 0;
}
.tb-titles h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-biz {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.tb-biz span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.tb-biz .ic {
  width: 14px;
  height: 14px;
}
.tb-actions {
  display: flex;
  gap: 4px;
}

.view {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 16px 110px;
}

.tabbar {
  position: fixed;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}
.tab .ic {
  width: 24px;
  height: 24px;
}
.tab.active {
  color: var(--accent);
}

.fab-slot {
  position: fixed;
  z-index: 15;
  right: 16px;
  bottom: calc(var(--tab-h) + var(--safe-b) + 16px);
}
@media (min-width: 800px) {
  .fab-slot {
    right: calc(50% - 380px + 16px);
  }
}
.fab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 20px 0 16px;
  border: 0;
  border-radius: 26px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 40%, transparent);
}
.fab .ic {
  width: 22px;
  height: 22px;
}

/* ------------------------------------------------------------------ cards & rows */
.stack {
  display: grid;
  gap: 12px;
}
.stack.tight {
  gap: 8px;
}
.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
}
.card.is-current {
  border-color: var(--accent);
}
.form-card {
  padding: 16px;
}
.form-card + .form-card,
.form-card + .stack,
.stack + .btn-block {
  margin-top: 12px;
}
.view > .card + .card {
  margin-top: 12px;
}
.card-title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
}
.row-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
}
.row-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
}
.row-main {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
}
.row-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}
.clip {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.row-meta .ic {
  width: 15px;
  height: 15px;
}
.row-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
}
.ic.muted {
  color: var(--muted);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b4aaa0;
}
.dot.on {
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-soft);
}

.badge {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.badge-live {
  background: var(--ok-soft);
  border-color: transparent;
  color: var(--ok);
}
.badge-live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: blink 1.4s ease-in-out infinite;
}
@keyframes blink {
  50% {
    opacity: 0.25;
  }
}

/* thumbnails & previews */
.thumb,
.thumb-wide {
  position: relative;
  flex: none;
  width: 96px;
  height: 54px;
  border-radius: 8px;
  overflow: hidden;
  background: #0d0c0b;
}
.thumb.portrait {
  width: 40px;
  height: 71px;
  margin: 0 28px;
}
.thumb-wide {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 0;
}
.thumb-empty {
  display: grid;
  place-items: center;
  color: #6d645c;
  background: var(--surface-2);
  border: 1px dashed var(--line);
}
.big-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #0d0c0b;
}
.big-preview.portrait {
  width: min(100%, 220px);
  aspect-ratio: 9 / 16;
  margin: 0 auto;
}
.preview-card {
  padding: 12px;
}
.preview-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
  margin-top: 10px;
  font-size: 14px;
}
.now-label {
  font-weight: 600;
}
.preview-sticky {
  position: sticky;
  z-index: 5;
  top: calc(var(--top-h) + var(--safe-t));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: -16px -16px 12px;
  padding: 10px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.preview-sticky .big-preview {
  flex: 1;
  min-width: 0;
  max-width: 440px;
  cursor: zoom-in;
}
.preview-toolbar {
  flex: none;
  display: grid;
  gap: 6px;
  justify-items: stretch;
}
.preview-toolbar .segmented {
  flex-direction: column;
}
.preview-toolbar .seg {
  justify-content: flex-start;
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
}
.preview-zoom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
}
.preview-zoom .ic {
  width: 16px;
  height: 16px;
}
.fullpreview {
  position: fixed;
  z-index: 70;
  inset: 0;
  background: #000;
  cursor: zoom-out;
}
.fullpreview-box {
  position: absolute;
  inset: 0;
}
.fullpreview-hint {
  position: absolute;
  left: 50%;
  bottom: calc(16px + var(--safe-b));
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 13px;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (min-width: 600px) {
  .content-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.content-card {
  overflow: hidden;
}
.content-info {
  display: grid;
  gap: 2px;
  padding: 10px 12px 12px;
}

.info-strip {
  display: flex;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}
.info-strip > span {
  display: inline;
}
.info-strip .ic {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  vertical-align: -3px;
}
.info-strip b {
  color: var(--text);
}

.item-row {
  display: flex;
  align-items: center;
  overflow: hidden;
}
.item-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 6px 10px 10px;
  border: 0;
  background: none;
  text-align: left;
}
.item-row.is-off .item-open {
  opacity: 0.5;
}
.item-side {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 6px;
}
.updown {
  display: grid;
}

/* ------------------------------------------------------------------ empty states */
.empty {
  padding: 36px 12px;
  text-align: center;
}
.empty-icon {
  display: inline-grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}
.empty-icon .ic {
  width: 30px;
  height: 30px;
}
.empty h3 {
  margin: 0 0 6px;
  font-size: 19px;
}
.empty p {
  max-width: 420px;
  margin: 0 auto 18px;
  color: var(--muted);
}
.howto {
  max-width: 420px;
  margin: 16px auto 0;
  text-align: left;
}
.howto ol,
.howto-list {
  margin: 0 0 18px;
  padding-left: 22px;
  display: grid;
  gap: 8px;
  color: var(--muted);
}
.howto b,
.howto-list b {
  color: var(--text);
}
.howto .btn {
  width: 100%;
}

/* ------------------------------------------------------------------ forms */
.field {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}
.field:last-child {
  margin-bottom: 0;
}
.label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.hint {
  font-size: 13px;
  color: var(--muted);
}
.input {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--surface);
}
textarea.input {
  height: auto;
  min-height: 46px;
  padding: 11px 14px;
  resize: vertical;
  line-height: 1.35;
}
select.input {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23776c62' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
}
.input.num {
  width: 110px;
  margin-bottom: 8px;
}
.code-input {
  height: 66px;
  text-align: center;
  font: 800 34px/1 'Roboto Condensed', sans-serif;
  letter-spacing: 0.18em;
}
.input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.two-col,
.time-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.two-col .field,
.time-row .field {
  margin-bottom: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 650;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 0.1s, opacity 0.15s;
}
.btn:active {
  transform: scale(0.98);
}
.btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.btn.is-busy {
  opacity: 0.7;
  cursor: progress;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-secondary {
  background: var(--surface);
  border-color: var(--line);
}
.btn-ghost {
  background: transparent;
}
.btn-ghost.danger {
  color: var(--danger);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-sm {
  height: 36px;
  padding: 0 12px;
  font-size: 14px;
}
.btn-sm .ic {
  width: 17px;
  height: 17px;
}
.btn-block {
  width: 100%;
}
.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-weight: 650;
  font-size: 15px;
  text-decoration: none;
}
.btn-link .ic {
  width: 18px;
  height: 18px;
}
.form-card > .btn-link {
  margin: -6px 0 10px;
}
.icon-btn {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--text);
}
.icon-btn:active {
  background: var(--surface-2);
}
.icon-btn:disabled {
  opacity: 0.25;
}
.icon-btn.sm {
  width: 32px;
  height: 30px;
}
.icon-btn.sm .ic {
  width: 18px;
  height: 18px;
}

/* switch */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.switch-track {
  position: relative;
  flex: none;
  width: 46px;
  height: 28px;
  border-radius: 14px;
  background: var(--line);
  transition: background 0.2s;
}
.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s;
}
.switch input:checked + .switch-track {
  background: var(--ok);
}
.switch input:checked + .switch-track .switch-thumb {
  transform: translateX(18px);
}
.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.switch-label {
  font-size: 15px;
}

/* segmented */
.segmented {
  display: flex;
  width: 100%;
  padding: 3px;
  gap: 3px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.seg {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 8px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.seg .ic {
  width: 16px;
  height: 16px;
}
.seg.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* chips & days */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
}
.sched {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.sched:empty {
  display: none;
}
.day-chips {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}
.day {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
}
.day.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* colours */
.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.swatch {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 50%;
}
.swatch.on {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.swatch-auto {
  width: auto;
  padding: 0 12px;
  border-radius: 18px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
}
.swatch-pair {
  border-radius: 10px;
  font-weight: 800;
  font-size: 14px;
}
.swatch-custom {
  background: conic-gradient(#e03131, #f59f00, #2f9e44, #1c7ed6, #7048e8, #e03131);
  color: #fff;
  cursor: pointer;
}
.swatch-custom input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.swatch-custom .ic {
  width: 16px;
  height: 16px;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5));
}

.theme-picker {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.theme-opt {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  line-height: 1.15;
}
.theme-chip {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1.3;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.theme-chip span {
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 22%;
  height: 14%;
  border-radius: 3px;
}
.theme-opt.on {
  color: var(--text);
  font-weight: 700;
}
.theme-opt.on .theme-chip {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* media */
.upload-drop {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 100%;
  padding: 22px 12px;
  border: 2px dashed var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 650;
}
.upload-drop .ic {
  width: 30px;
  height: 30px;
  margin-bottom: 4px;
  color: var(--accent);
}
.upload-drop small {
  font-weight: 400;
  color: var(--muted);
}
.media-thumb {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
  background: #0d0c0b;
}
.media-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.progress {
  height: 6px;
  margin-top: 10px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.progress-bar {
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.2s;
}

/* menu editor */
.section-label {
  margin: 20px 4px 8px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.section-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 20px 4px 8px;
}
.section-label-row .section-label {
  margin: 0;
}
.sec-card {
  padding: 12px;
}
.sec-head {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.sec-head .input {
  font-weight: 700;
}
.mi-labels,
.mi-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px 50px 32px;
  gap: 6px;
  align-items: center;
}
.mi-labels {
  padding: 0 2px 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}
.mi-labels span:nth-child(3) {
  text-align: center;
}
.mi {
  padding: 5px 0;
}
.mi .input {
  height: 42px;
  padding: 0 10px;
}
.mi-price {
  position: relative;
}
.mi-price .input {
  padding-right: 22px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.mi-price span {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
}
.mi.is-out .mi-main .input {
  text-decoration: line-through;
  color: var(--muted);
}
.mi-extra {
  display: grid;
  gap: 6px;
  margin: 6px 0 4px;
  padding: 10px;
  border-radius: 12px;
  background: var(--surface-2);
}
.mi-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.sec-card > .btn-link {
  margin-top: 4px;
}

/* playlist add sheet */
.type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.type-tile {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 14px 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 600;
}
.type-tile .ic {
  width: 26px;
  height: 26px;
  color: var(--accent);
}
.pick-list {
  display: grid;
}
.pick-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  text-align: left;
}

/* publish bar */
.publish-spacer {
  height: 40px;
}
.publish-bar {
  position: fixed;
  z-index: 15;
  left: 0;
  right: 0;
  bottom: calc(var(--tab-h) + var(--safe-b));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 760px;
  margin: 0 auto;
  padding: 10px 16px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.05);
}
@media (min-width: 760px) {
  .publish-bar {
    border: 1px solid var(--line);
    border-radius: 16px 16px 0 0;
  }
}
.publish-status {
  font-size: 13px;
  color: var(--ok);
  font-weight: 600;
}
.publish-status.pending {
  color: var(--warn);
}
.btn-publish {
  min-width: 150px;
}

/* actions */
.action-card {
  padding: 2px 16px;
}
.action-list {
  display: grid;
}
.action-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  text-align: left;
  font-size: 16px;
}
.action-item:last-child {
  border-bottom: 0;
}
.action-item > span:not(.ic) {
  flex: 1;
  min-width: 0;
}
.action-item small {
  display: block;
  margin-top: 1px;
  font-size: 13px;
  color: var(--muted);
}
.action-item.danger {
  color: var(--danger);
}
.action-item.current {
  font-weight: 700;
}
.action-item.tall > .ic {
  width: 44px;
  height: 44px;
  padding: 11px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}
.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.card > .action-list {
  padding: 0 16px;
}
.creds {
  margin: 12px 0 0;
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: all;
}

/* ------------------------------------------------------------------ sheets */
.sheet-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(10, 8, 6, 0.45);
  opacity: 0;
  transition: opacity 0.22s;
}
.sheet-backdrop.show {
  opacity: 1;
}
.sheet {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet-wide {
  max-width: 720px;
}
.sheet-backdrop.show .sheet {
  transform: none;
}
@media (min-width: 700px) {
  .sheet-backdrop {
    align-items: center;
  }
  .sheet {
    border-radius: 22px;
    transform: translateY(24px);
    opacity: 0;
    transition: transform 0.22s, opacity 0.22s;
  }
  .sheet-backdrop.show .sheet {
    opacity: 1;
  }
  .sheet-grip {
    display: none;
  }
}
.sheet-grip {
  width: 40px;
  height: 4px;
  margin: 8px auto 0;
  border-radius: 2px;
  background: var(--line);
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px 0 20px;
}
.sheet-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sheet-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 20px 18px;
}
.sheet-body > p.muted,
.sheet-body form > p.muted {
  margin-bottom: 14px;
}
.sheet-foot {
  display: flex;
  gap: 8px;
  padding: 12px 16px calc(12px + var(--safe-b));
  border-top: 1px solid var(--line);
}
.sheet-foot .btn {
  flex: 1;
}

/* ------------------------------------------------------------------ toasts */
.toasts {
  position: fixed;
  z-index: 60;
  left: 16px;
  right: 16px;
  bottom: calc(var(--tab-h) + var(--safe-b) + 84px);
  display: grid;
  justify-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 480px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #1d1915;
  color: #fff;
  font-size: 14.5px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show {
  opacity: 1;
  transform: none;
}
.toast .ic {
  color: #69db7c;
}
.toast-error {
  background: var(--danger);
}
.toast-error .ic {
  color: #fff;
}
