@font-face {
    font-family: 'Lato';
    src: url('fonts/Lato-Regular.ttf') format('truetype');
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Lato';
    src: url('fonts/Lato-Bold.ttf') format('truetype');
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: 'Lato';
    src: url('fonts/Lato-Italic.ttf') format('truetype');
    font-style: italic;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Lato';
    src: url('fonts/Lato-BoldItalic.ttf') format('truetype');
    font-style: italic;
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: 'Manrope';
    src: url('fonts/Manrope-Variable.ttf') format('truetype');
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
}

:root {
    color-scheme: dark;
    --bg: #000000;
    --panel: #191c24;
    --ink: #f4f5fa;
    --muted: #b0b5c5;
    --accent: #00bd52;
    --line: #353945;
    --input: #101218;
    --accent-border: #00bd52;
    --accent-text: #69e59f;
    --violet-text: #bba2f5;
    font-family: 'Lato', sans-serif;
    color: var(--ink);
    background: var(--bg);
    font-synthesis: none;
    line-height: 1.5;
}

* {
    box-sizing: border-box;
}

html {
    scroll-padding-top: 24px;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    padding: 32px 24px;
    background: radial-gradient(ellipse at 50% 15%, #141824 0%, transparent 65%), #000000;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a,
input,
summary {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
    border: 0;
    transition:
        background 0.15s,
        color 0.15s,
        border-color 0.15s,
        box-shadow 0.15s;
}

button:disabled {
    cursor: default;
    opacity: 0.42;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.scene-canvas:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

a {
    color: inherit;
    text-decoration: none;
}

[hidden] {
    display: none !important;
}

.medicine-cabinet {
    width: 100%;
    max-width: 1220px;
    min-width: 0;
    margin: auto;
    border: 1px solid #353945;
    border-radius: 16px;
    background: #111319;
    box-shadow:
        0 24px 70px #0006,
        inset 0 1px #00bd5214;
}

.shopfront {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 12px 28px;
    border-bottom: 1px solid var(--line);
}

.maomao-mark {
    display: inline-block;
    font:
        750 32px/1 'Manrope',
        'Lato',
        sans-serif;
    letter-spacing: -1.2px;
}

.logout {
    margin: 0;
}

.logout-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    font-size: 13px;
}

.logout-button:hover {
    color: var(--accent-text);
    background: #00bd520d;
    border-color: #596078;
}

.logout-button svg {
    width: 18px;
    height: 18px;
}

.chapter {
    margin: 0 -28px 24px;
    padding: 10px 28px;
    border-bottom: 1px solid var(--line);
    background: #00000026;
}

h1 {
    margin: 0;
    padding: 19px 0;
    font-size: 20px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.4px;
}

h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
}

h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
}

.muted {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.65;
}

.herb-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.mixing-bench {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
    gap: 24px;
    align-items: start;
}

.remedy {
    min-width: 0;
}

.shelf-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.jade-tag {
    color: var(--accent-text);
    padding: 3px 8px;
    border: 1px solid #00bd5240;
    border-radius: 5px;
    background: #00bd5212;
    font:
        11px/1.5 'Lato',
        sans-serif;
    white-space: nowrap;
}

.now-playing {
    padding: 20px;
    border: 1px solid #353945;
    border-radius: 12px;
    background: var(--panel);
    box-shadow: inset 0 1px #ffffff08;
    color: #f4f5fa;
    --ink: #f4f5fa;
    --muted: #b0b5c5;
    --line: #353945;
    --input: #101218;
}

.now-playing h2 {
    font-weight: 700;
}

.now-playing .quiet,
.now-playing .round {
    color: var(--ink);
}

.now-playing .quiet:hover:not(:disabled),
.now-playing .round:hover:not(:disabled) {
    background: #2a2e3b;
}

.artwork {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 7px;
    background: var(--input);
}

.artwork img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#emptyArtwork {
    display: flex;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--muted);
    font-size: 12px;
}

.play-art {
    font-size: 42px;
    color: var(--accent-text);
    line-height: 1;
}

.playback-chip {
    position: absolute;
    bottom: 10px;
    left: 10px;
    padding: 5px 10px;
    border: 1px solid #ffffff26;
    border-radius: 5px;
    background: #101218ed;
    color: #f4f5fa;
    font:
        11px/1.4 'Lato',
        sans-serif;
}

.video-info {
    padding-top: 18px;
}

.video-info h3 {
    font-size: 21px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.35px;
    overflow-wrap: anywhere;
}

.video-info p {
    margin: 8px 0 20px;
    font-size: 12px;
}

.video-info p:empty {
    margin: 0 0 22px;
}

.timeline progress {
    display: block;
    width: 100%;
    height: 4px;
    overflow: hidden;
    border: 0;
    border-radius: 4px;
    background: var(--line);
    accent-color: var(--accent-text);
}

progress::-webkit-progress-bar {
    background: var(--line);
}

progress::-webkit-progress-value {
    background: var(--accent);
}

progress::-moz-progress-bar {
    background: var(--accent);
}

.timeline > div {
    display: flex;
    justify-content: space-between;
    margin-top: 9px;
    color: var(--muted);
    font:
        12px/1.5 'Lato',
        sans-serif;
}

.transport {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 21px;
}

.round {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.control-icon,
.seek-icon {
    display: block;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.seek-icon {
    width: 27px;
    height: 27px;
}

.seek-icon text {
    fill: currentColor;
    stroke: none;
    font:
        700 10px 'Lato',
        sans-serif;
    text-anchor: middle;
}

.play-icon,
.pause-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.scene-mode {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
    max-width: 420px;
}
.scene-mode > label {
    margin: 0;
}
.scene-usage {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
}
.scene-usage label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.scene-usage input[type='checkbox'] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--accent);
}

.audio-controls {
    margin-top: 20px;
    padding: 18px 0;
    border-top: 1px solid var(--line);
}
.volume-heading,
.audio-boost {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.volume-heading output {
    font-variant-numeric: tabular-nums;
    font-size: 13px;
}
.audio-controls input[type='range'] {
    display: block;
    width: 100%;
    min-height: 40px;
    padding: 0;
    accent-color: var(--accent);
    cursor: pointer;
}
.audio-boost label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.audio-boost input[type='checkbox'] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--accent);
}
.audio-boost select {
    width: 108px;
    min-width: 0;
}
.audio-controls :disabled {
    cursor: default;
}

#togglePlayback[data-command='resume'] .pause-icon,
#togglePlayback[data-command='pause'] .play-icon {
    display: none;
}

.now-playing .play-toggle {
    width: 56px;
    height: 56px;
    flex-basis: 56px;
    background: var(--accent);
    border-color: var(--accent-text);
    color: #061a10;
    font-size: 20px;
    box-shadow:
        0 3px 12px #0003,
        inset 0 1px #fff3;
}

.now-playing .play-toggle:hover:not(:disabled) {
    background: #20ca68;
}

.seek-form {
    margin-top: 23px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.seek-form .input-row {
    max-width: 260px;
}

.seek-form input {
    font-family: 'Lato', sans-serif;
}

.seek-form p {
    font-size: 11px;
    margin: 9px 0 0;
}

.retry {
    display: block;
    margin: 16px auto 0;
}

.primary,
.quiet,
.remove {
    min-height: 44px;
    padding: 10px 15px;
    border: 1px solid var(--accent-border);
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.primary {
    background: var(--accent);
    border-color: var(--accent-text);
    color: #061a10;
    font-weight: 700;
    white-space: nowrap;
    box-shadow:
        inset 0 1px #fff3,
        0 2px 5px #0002;
}

.primary:hover:not(:disabled) {
    background: #20ca68;
    border-color: #20ca68;
}

.primary span {
    margin-left: 12px;
}

.quiet {
    background: #ffffff03;
    color: var(--ink);
    border-color: var(--line);
}

.quiet:hover:not(:disabled),
.remove:hover:not(:disabled) {
    background: #282c38;
    border-color: #626a82;
}

.text-button {
    min-height: 44px;
    padding: 8px 0;
    background: transparent;
    color: var(--ink);
    font-size: 12px;
}

.text-button:hover:not(:disabled) {
    text-decoration: underline;
    text-underline-offset: 4px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--input);
    color: var(--ink);
    font-size: 13px;
    box-shadow: inset 0 1px 3px #0002;
}

input:focus,
select:focus {
    border-color: #69e59f;
}

input::placeholder {
    color: var(--muted);
    opacity: 0.85;
}

input[type='checkbox'] {
    width: 18px;
    height: 18px;
    min-height: 0;
    margin: 0;
    accent-color: var(--accent-text);
    flex-shrink: 0;
}

.count {
    display: inline-block;
    margin-left: 8px;
    min-width: 25px;
    padding: 3px 7px;
    border: 1px solid var(--line);
    border-radius: 5px;
    text-align: center;
    color: var(--accent-text);
    background: #00bd5212;
    font:
        12px/1.3 'Lato',
        sans-serif;
}

.queue-panel {
    padding: 4px 0 0;
}

.queue-panel > .shelf-label {
    padding: 0 0 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.add-form {
    padding: 14px 14px 4px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #191c24;
}

.input-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.input-row input {
    flex: 1;
}

.add-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 5px;
}

.add-options > span {
    color: var(--muted);
    font-size: 11px;
}

.queue-list {
    max-height: 470px;
    margin: 0;
    padding: 0;
    overflow: auto;
    list-style: none;
    display: grid;
    gap: 8px;
    scrollbar-width: thin;
    scrollbar-color: #626a82 transparent;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    border: 1px solid #2c2e33;
    border-radius: 9px;
    background: #191c24;
}

.queue-item:focus-within {
    background: #172d23;
}

.queue-number {
    flex: 0 0 18px;
    color: var(--muted);
    font:
        11px/1.5 'Lato',
        sans-serif;
}

.queue-thumb {
    width: 86px;
    height: 50px;
    flex: 0 0 86px;
    object-fit: cover;
    border-radius: 5px;
    background: #242833;
}

.queue-copy {
    min-width: 0;
    flex: 1;
}

.queue-copy strong {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.5;
    font-weight: 700;
    white-space: normal;
    text-overflow: ellipsis;
}

.queue-meta {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 5px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.queue-channel {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.queue-runtime {
    flex-shrink: 0;
    color: var(--violet-text);
    font-family: 'Lato', sans-serif;
    padding: 1px 5px;
    border-radius: 4px;
    background: #8f5fe81a;
}

.queue-copy a {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font:
        10px/1.5 'Lato',
        sans-serif;
}

.queue-copy a:hover {
    text-decoration: underline;
}

.queue-moves {
    display: flex;
    flex-direction: column;
    flex: 0 0 34px;
    gap: 2px;
}

.queue-move {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 3px 7px;
    font-size: 17px;
    line-height: 1.1;
    border-radius: 5px;
}

.queue-move:hover:not(:disabled) {
    background: #00bd5220;
    text-decoration: none;
}

.remove {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 7px 9px;
    border-color: transparent;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
}

.empty-queue {
    padding: 64px 0;
    border-top: 1px solid var(--line);
    text-align: center;
    color: var(--muted);
}

.queue-empty-icon {
    display: block;
    margin-bottom: 12px;
    color: #a0a8bc;
    font-size: 24px;
}

.empty-queue h3 {
    font:
        italic 22px 'Lato',
        sans-serif;
}

.queue-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 9px;
    margin-top: 5px;
}

.backroom {
    display: contents;
}

.backroom > .remedy {
    min-width: 0;
    scroll-margin-top: 24px;
}

.backroom h2 {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.4px;
}

.backroom .shelf-label {
    margin-bottom: 24px;
}

.scene-toolbar,
.scene-selection {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.scene-upload {
    margin: 0;
    cursor: pointer;
    font-weight: 400;
}

.scene-canvas {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0d0e12;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    outline-offset: 3px;
}

.scene-canvas-label {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #b0b5c5;
    font:
        12px 'Lato',
        sans-serif;
    pointer-events: none;
}

#sceneLayers {
    position: absolute;
    inset: 0;
}

.scene-item {
    position: absolute;
    border: 1px solid transparent;
    padding: 0;
    background: transparent;
    border-radius: 0;
    cursor: move;
    touch-action: none;
}

.scene-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    display: block;
}

.scene-item.selected {
    border-color: var(--accent-text);
    outline: 1px solid #000000;
}

.scene-handle {
    display: none;
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 15px;
    height: 15px;
    border: 2px solid #191c24;
    background: var(--accent);
    cursor: nwse-resize;
}

.scene-item.selected .scene-handle {
    display: block;
}

.scene-selection {
    padding-top: 15px;
}

.scene-clock-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    gap: 16px;
    margin-top: 18px;
}
.scene-clock-fields[hidden] {
    display: none;
}
.scene-clock-fields label {
    min-width: 0;
}
.scene-clock-fields input,
.scene-clock-fields select {
    width: 100%;
}

.scene-selection label {
    margin: 0;
}

.scene-selection input {
    width: 76px;
    padding: 8px;
}

.scene-selection .quiet {
    padding: 8px 11px;
}

.scene-library {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.scene-library article {
    min-width: 0;
    display: grid;
    gap: 8px;
}

.scene-library img {
    width: 100%;
    height: 90px;
    object-fit: contain;
    background: repeating-conic-gradient(#343846 0 25%, #232630 0 50%) 0 / 16px 16px;
}

.scene-library button {
    padding: 8px;
}

.preset-controls {
    margin: 20px 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #191c24;
}

.preset-controls label:not(:first-child) {
    margin-top: 14px;
}

.preset-controls select {
    flex: 1;
    min-width: 0;
}

.preset-controls .input-row {
    flex-wrap: wrap;
}

.preset-controls input {
    min-width: 120px;
}

.notification-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 18px;
}

.notification-options > div {
    min-width: 0;
}

.notification-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.notification-active {
    grid-column: 1;
    margin-top: 22px;
    padding: 16px;
    border: 1px solid #00bd5240;
    border-radius: 10px;
    background: #00bd520c;
}

.notification-active p {
    margin: 6px 0 0;
    overflow-wrap: anywhere;
}

.schedule-form {
    grid-column: 2;
    padding-left: 30px;
    border-left: 1px solid var(--line);
}

.schedule-form h3 {
    font-size: 15px;
}

.schedule-form label {
    margin-top: 16px;
}

.schedule-form button {
    margin-top: 16px;
}

.extras-panel form {
    margin-top: 22px;
}

.check-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--ink);
}

.admin-list {
    margin-top: 20px;
    max-height: 320px;
    overflow: auto;
    color: var(--muted);
    font-size: 12px;
    scrollbar-width: thin;
}

.admin-list article {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.admin-list article > div {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.admin-list strong {
    color: var(--ink);
    font-weight: 700;
}

.admin-list p {
    margin: 6px 0 0;
    font-size: 11px;
}

.admin-list button {
    flex-shrink: 0;
    padding: 8px 10px;
}

.account {
    grid-column: 1 / -1;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0 20px;
    background: #191c24;
    font-size: 12px;
    scroll-margin-top: 24px;
}

.account summary {
    padding: 20px 0;
    cursor: pointer;
    font-size: 13px;
}

.account summary::marker {
    color: #69e59f;
}

.account summary > span {
    float: right;
    max-width: 65%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
}

.account[open] summary {
    border-bottom: 1px solid var(--line);
}

.account-content {
    padding: 24px 0;
}

.account-management {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 48px;
}

.create-account {
    max-width: 400px;
}

.create-account p {
    margin: 8px 0 20px;
}

.create-account input {
    margin-bottom: 16px;
}

.account-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.account-row span {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 13px;
}

.account-row .quiet {
    color: #ff9aa0;
}

.connection-tools {
    padding: 0 0 22px;
}

.connection-tools pre {
    margin: 16px 0 0;
    padding: 16px;
    background: #191c24;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: var(--ink);
    font:
        12px/1.6 'Lato',
        sans-serif;
}

.notice {
    margin: 18px 0;
    padding: 14px 18px;
    border-left: 3px solid #69e59f;
    background: #172d23;
    color: var(--ink);
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.notice.error {
    color: #ffb0b5;
    border-color: #fc424a;
    background: #fc424a12;
}

#retryConnection {
    margin-bottom: 20px;
}

.moon-gate {
    position: relative;
    padding: 36px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
    box-shadow: 0 24px 70px #0006;
}

.moon-gate::before {
    content: '';
    position: absolute;
    top: -1px;
    right: -1px;
    left: -1px;
    height: 14px;
    border: 4px solid var(--accent);
    border-bottom: 0;
    border-radius: 14px 14px 0 0;
    pointer-events: none;
}

.moon-gate h1 {
    margin: 0 0 30px;
    padding: 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.4px;
}

.login-form input {
    min-height: 50px;
    margin-bottom: 24px;
    font-size: 16px;
}

.login-form .primary {
    width: 100%;
    min-height: 48px;
    margin-top: 8px;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
}

#playback {
    padding: 0 28px 28px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.herb-tabs button {
    position: relative;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 14px;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    border: 1px solid transparent;
    border-radius: 7px;
}

.herb-tabs button:hover {
    color: var(--ink);
    background: #00bd520d;
}

.herb-tabs button[aria-selected='true'] {
    color: var(--accent-text);
    background: #00bd521a;
    border-color: #00bd5266;
    box-shadow: inset 0 1px #00bd5214;
}

.herb-tabs svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    stroke: currentColor;
    stroke-width: 1.6;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.herb-tabs button:focus-visible {
    outline-offset: -5px;
}

[role='tabpanel']:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 7px;
}

.queue-item:hover {
    background: #222632;
    border-color: #4c5368;
}

.settings-panel {
    display: grid;
    gap: 30px;
    min-width: 0;
}

.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
    min-width: 0;
}
.settings-tabs button {
    background: transparent;
    color: var(--muted);
    border: 1px solid transparent;
    padding: 9px 14px;
    border-radius: 6px;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}
.settings-tabs button:hover { color: var(--ink); background: #191d27; }
.settings-tabs button[aria-selected='true'] {
    color: #69e4ac;
    background: #12271e;
    border-color: #245940;
}
.settings-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.settings-page { display: grid; gap: 30px; min-width: 0; }
.settings-page > section, .settings-page > details { min-width: 0; }
[data-site-name] { overflow-wrap: anywhere; }
.settings-page h2 {
    overflow-wrap: anywhere;
}

#adminExtras {
    max-width: 640px;
}

#fallbackVideoFields,
#slideshowEditor {
    margin-top: 24px;
}
.slide-library {
    display: grid;
    gap: 10px;
    margin: 20px 0;
}
.slide-library article {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.slide-library img {
    width: 64px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
}
.slide-library span {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}
.slide-pages {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 16px 0 24px;
}
.slide-pages span {
    min-width: 0;
    overflow-wrap: anywhere;
}
#slideshowEditor input[type='file'] {
    max-width: 100%;
}
#slideFeedback {
    overflow-wrap: anywhere;
}

.scene-panel {
    max-width: 960px;
    margin: 0 auto;
}

.notification-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 36px;
    align-items: start;
}

.notification-panel > .shelf-label {
    grid-column: 1 / -1;
}

#notificationForm {
    grid-column: 1;
    grid-row: 2;
}

#notificationActive {
    grid-column: 1;
    grid-row: 3;
}

#idleNoticeForm {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

#scheduleList {
    grid-column: 2;
    padding-left: 30px;
}

.after-hours .medicine-cabinet {
    max-width: 420px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.after-hours .shopfront {
    min-height: 0;
    justify-content: center;
    padding: 0 0 32px;
    border: 0;
}

.after-hours .maomao-mark {
    font-size: 36px;
}

.after-hours .medicine-cabinet > .notice {
    margin: 0 0 20px;
}

.medicine-cabinet > .notice {
    margin: 20px 28px;
}

.timeline,
.count,
.queue-runtime,
.queue-number,
#seekTime {
    font-variant-numeric: tabular-nums;
}

@media (max-width: 1000px) {
    body {
        padding: 24px 18px;
    }
    .mixing-bench {
        gap: 22px;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
    .queue-thumb {
        width: 64px;
        height: 40px;
        flex-basis: 64px;
    }
    .queue-item {
        gap: 8px;
    }
    .queue-number {
        flex-basis: 15px;
    }
    .transport {
        gap: 6px;
    }
    .transport .quiet {
        padding: 8px 10px;
    }
}

@media (max-width: 900px) {
    .mixing-bench,
    .notification-panel {
        grid-template-columns: minmax(0, 1fr);
    }
    .mixing-bench {
        gap: 30px;
    }
    .notification-panel > * {
        grid-column: 1;
        grid-row: auto;
    }
    #notificationForm,
    #notificationActive {
        grid-column: 1;
        grid-row: auto;
    }
    .schedule-form {
        grid-column: 1;
        grid-row: auto;
        padding: 24px 0 0;
        margin-top: 24px;
        border-left: 0;
        border-top: 1px solid var(--line);
    }
    #scheduleList {
        grid-column: 1;
        padding-left: 0;
    }
    .artwork {
        max-height: 390px;
    }
    .queue-list {
        max-height: none;
    }
    .queue-thumb {
        width: 86px;
        height: 50px;
        flex-basis: 86px;
    }
    .account-management {
        grid-template-columns: minmax(0, 1fr);
        gap: 30px;
    }
    .herb-tabs {
        gap: 4px;
        flex-wrap: wrap;
    }
    .herb-tabs button {
        padding: 0 14px;
    }
}

@media (max-width: 600px) {
    input,
    select {
        font-size: 16px;
    }
    .queue-item {
        display: grid;
        grid-template-columns: 88px minmax(0, 1fr);
        grid-template-areas: 'thumb copy' 'moves remove';
        gap: 10px 12px;
        padding: 12px;
    }
    .queue-number {
        display: none;
    }
    .queue-thumb {
        grid-area: thumb;
        width: 88px;
        height: 50px;
    }
    .queue-copy {
        grid-area: copy;
    }
    .queue-moves {
        grid-area: moves;
        flex-direction: row;
        gap: 0;
    }
    .queue-move {
        width: 44px;
        min-height: 44px;
        border: 1px solid var(--line);
    }
    .remove {
        grid-area: remove;
        justify-self: end;
        padding: 8px 12px;
        border-color: var(--line);
    }
    .herb-tabs button {
        padding: 0 10px;
    }
}

@media (max-width: 440px) {
    body {
        padding: 12px 8px;
    }
    .medicine-cabinet {
        border-radius: 12px;
    }
    .shopfront {
        min-height: 72px;
        padding: 10px 18px;
        gap: 12px;
    }
    .maomao-mark {
        font-size: 28px;
        letter-spacing: -1px;
    }
    #playback {
        padding: 0 14px 20px;
    }
    .chapter {
        margin: 0 -14px 20px;
        padding: 8px;
    }
    .chapter > h1 {
        padding-left: 6px;
    }
    .herb-tabs button {
        grid-column: span 2;
        min-height: 44px;
        padding: 0 6px;
        font-size: 12px;
    }
    .herb-tabs {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
    .herb-tabs button:nth-child(n + 4) {
        grid-column: span 3;
    }
    .herb-tabs svg {
        display: none;
    }
    .now-playing {
        padding: 14px;
    }
    .video-info h3 {
        font-size: 20px;
    }
    .transport {
        gap: 6px;
    }
    .transport .quiet {
        padding: 8px;
    }
    .round {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }
    .now-playing .play-toggle {
        width: 50px;
        height: 50px;
        flex-basis: 50px;
    }
    .queue-thumb {
        width: 88px;
        height: 50px;
    }
    .queue-number {
        display: none;
    }
    .queue-copy strong {
        font-size: 13px;
    }
    .queue-copy a {
        font-size: 11px;
    }
    .queue-moves {
        flex-basis: 32px;
    }
    .queue-move {
        min-height: 44px;
    }
    .remove {
        min-height: 44px;
        padding: 8px 12px;
    }
    .input-row {
        flex-wrap: wrap;
    }
    .input-row input {
        flex-basis: 140px;
    }
    .input-row select {
        flex: 1 1 100%;
    }
    .moon-gate {
        padding: 24px;
    }
    .medicine-cabinet > .notice {
        margin: 16px 14px;
    }
    .account {
        padding: 0 14px;
    }
}

@media (max-width: 360px) {
    .transport {
        display: grid;
        grid-template-columns: 1fr 50px 1fr;
        grid-template-areas: 'back toggle forward' 'start . next';
        justify-items: center;
        row-gap: 10px;
    }
    #startVideo {
        grid-area: start;
    }
    .transport [data-command='seek-back'] {
        grid-area: back;
    }
    #togglePlayback {
        grid-area: toggle;
    }
    .transport [data-command='seek-forward'] {
        grid-area: forward;
    }
    .transport .next {
        grid-area: next;
    }
}

@media (prefers-reduced-motion: reduce) {
    button {
        transition: none;
    }
}

.slide-songs {
    display: grid;
    gap: 12px;
    margin: 16px 0;
}
.slide-songs article {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border, #303644);
    border-radius: 8px;
}
.song-number {
    font-variant-numeric: tabular-nums;
    color: #00bd52;
}
.slide-songs small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    align-self: center;
}
.song-name,
.song-order {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.song-name input {
    flex: 1 1 150px;
    width: 0;
    min-width: 100px;
    margin: 0;
}
.song-order label {
    flex: 1 1 100px;
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 0;
}
.song-order input {
    width: 76px;
    min-width: 0;
    margin: 0;
}
.slide-songs button {
    padding: 10px;
}
.discord-rule {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    margin: 18px 0;
    padding: 18px;
    border: 1px solid var(--line, #343843);
    border-radius: 10px;
    min-width: 0;
}
.discord-rule label {
    display: grid;
    gap: 8px;
    min-width: 0;
}
.discord-rule input,
.discord-rule select,
.discord-rule textarea {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.discord-description-label,
.discord-replies-label {
    grid-column: 1 / -1;
}
.discord-rule textarea {
    resize: vertical;
}
.discord-rule button {
    justify-self: start;
}
@media (max-width: 560px) {
    .discord-rule {
        grid-template-columns: minmax(0, 1fr);
    }
}

.presence-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.presence-fields label { min-width: 0; }
.presence-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 20px 0 12px;
    padding: 16px;
    background: var(--bg, #0d0f15);
    border: 1px solid var(--line, #343843);
    border-radius: 10px;
    overflow-wrap: anywhere;
}
.presence-preview div { min-width: 0; }
.presence-preview p { margin: 5px 0 0; }
.presence-dot { width: 12px; height: 12px; flex: 0 0 12px; border-radius: 50%; }
.presence-online { background: #43b581; }
.presence-idle { background: #faa61a; }
.presence-dnd { background: #f04747; }
.presence-invisible { background: #747f8d; }
@media (max-width: 560px) {
    .presence-fields { grid-template-columns: minmax(0, 1fr); gap: 0; }
}


#songAddForm {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
}
#songAddForm label { margin-top: 14px; }
#songAddForm code { overflow-wrap: anywhere; }
#songAdd { margin-top: 16px; }
#slideshowEditor .check-label { margin-top: 24px; }
