:root {
    color-scheme: light;
    --canvas-bg: #f6f7f9;
    --panel-bg: #ffffff;
    --elevated-bg: #fbfcfe;
    --border-color: #e4e7ee;
    --border-strong: #d3d9e5;
    --text-primary: #1f2933;
    --text-secondary: #657083;
    --text-tertiary: #8a95a6;
    --accent: #0d99ff;
    --accent-strong: #1a56db;
    --accent-soft: rgba(13, 153, 255, 0.1);
    --success: #14945f;
    --success-soft: rgba(20, 148, 95, 0.1);
    --warning: #b7791f;
    --error: #d92d20;
    --error-soft: rgba(217, 45, 32, 0.08);
    --shadow-soft: 0 14px 34px rgba(15, 23, 42, 0.08);
    --radius-card: 8px;
    --radius-input: 7px;
    --transition: 150ms ease;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--canvas-bg);
}

body {
    margin: 0;
    min-height: 100dvh;
    background:
        linear-gradient(180deg, rgba(13, 153, 255, 0.08), transparent 180px),
        var(--canvas-bg);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    letter-spacing: 0;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

.h5-app {
    width: min(100%, 520px);
    margin: 0 auto;
    padding: 14px 12px 108px;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 2px 12px;
}

.brand-lockup {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
}

.brand-mark {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
}

.brand-lockup h1 {
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
    line-height: 1.2;
    font-weight: 750;
}

.brand-lockup p {
    margin: 2px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.3;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    gap: 6px;
}

.header-action-btn,
.header-action-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-input);
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    cursor: pointer;
}

.auth-action-btn.is-logged-in {
    min-width: 34px;
    width: 34px;
    padding: 0;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
}

.header-action-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: var(--error);
    color: #fff;
    font-size: 10px;
    line-height: 1;
}

.step-tabs {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin: 0 0 10px;
    padding: 8px;
    border: 1px solid rgba(211, 217, 229, 0.86);
    border-radius: var(--radius-card);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(16px);
}

.step-tab {
    display: grid;
    justify-items: center;
    gap: 4px;
    min-width: 0;
    min-height: 52px;
    padding: 6px 2px;
    border: 1px solid transparent;
    border-radius: var(--radius-input);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color var(--transition), background var(--transition), border-color var(--transition);
}

.step-tab span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--elevated-bg);
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 750;
}

.step-tab strong {
    max-width: 100%;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.step-tab.is-active {
    color: #fff;
    border-color: transparent;
    background: var(--accent);
}

.step-tab.is-active span {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.step-tab.is-complete:not(.is-active) {
    color: var(--accent-strong);
    background: var(--accent-soft);
}

.step-tab.is-complete:not(.is-active) span {
    background: #fff;
    color: var(--accent-strong);
}

.step-panel {
    display: none;
}

.step-panel.is-active {
    display: grid;
    gap: 10px;
}

.preview-panel,
.form-section,
.task-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
}

.preview-panel {
    overflow: hidden;
    margin-top: 10px;
}

.preview-resolution-section {
    margin-top: 10px;
}

.panel-head,
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.panel-head {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.panel-head h2,
.section-title h2 {
    margin: 0;
    font-size: 13px;
    line-height: 1.25;
    font-weight: 700;
    color: var(--text-primary);
}

.panel-head p {
    margin: 3px 0 0;
    color: var(--text-tertiary);
    font-size: 11px;
    line-height: 1.35;
}

.segmented-control {
    display: grid;
    grid-template-columns: repeat(2, minmax(58px, 1fr));
    min-width: 124px;
    padding: 3px;
    gap: 3px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-input);
    background: var(--elevated-bg);
}

.segment-button {
    min-height: 32px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
    transition: color var(--transition), background var(--transition), box-shadow var(--transition);
}

.segment-button.is-active {
    color: #fff;
    background: var(--accent);
    box-shadow: 0 8px 18px rgba(13, 153, 255, 0.22);
}

.preview-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 318px;
    padding: 14px;
    background: var(--canvas-bg);
}

.preview-canvas {
    position: relative;
    width: 100%;
    max-width: 440px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-card);
    background: #151923;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.18);
}

.preview-canvas.portrait {
    width: min(100%, 238px);
    aspect-ratio: 9 / 16;
}

.preview-bg,
.preview-bg-media,
.preview-overlay {
    position: absolute;
    inset: 0;
}

.preview-bg {
    background-image: var(--preview-default);
    background-size: cover;
    background-position: center;
}

.preview-bg-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-overlay {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), transparent 34%, transparent 58%, rgba(0, 0, 0, 0.42));
    pointer-events: none;
}

.preview-text {
    position: absolute;
    left: 50%;
    z-index: 2;
    max-width: 88%;
    transform: translate(-50%, -50%);
    overflow-wrap: anywhere;
    text-align: center;
    color: #f8fafc;
    line-height: 1.28;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.62);
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.preview-title {
    top: 10%;
    font-size: 18px;
    font-weight: 750;
}

.preview-lyric {
    top: 86%;
    font-size: 15px;
    font-weight: 650;
}

.preview-text.dragging {
    cursor: grabbing;
}

.h5-form {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.form-section {
    display: grid;
    gap: 12px;
    padding: 12px;
}

.section-title {
    margin-bottom: 1px;
}

.field,
.range-field {
    display: grid;
    gap: 7px;
}

.field-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.3;
    font-weight: 600;
}

.field-label b {
    color: var(--accent-strong);
    font-size: 12px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="color"],
select,
textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-input);
    outline: none;
    background: var(--elevated-bg);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
    padding: 9px 10px;
}

textarea {
    min-height: 174px;
    resize: vertical;
    line-height: 1.55;
}

input[type="color"] {
    padding: 4px;
}

select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 30px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%238a95a6' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="color"]:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(13, 153, 255, 0.15);
    background: #fff;
}

input[type="range"] {
    width: 100%;
    height: 4px;
    margin: 8px 0;
    border-radius: 999px;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    background: var(--border-strong);
}

input[type="range"]::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    border: 3px solid #fff;
    border-radius: 50%;
    appearance: none;
    -webkit-appearance: none;
    background: var(--accent);
    box-shadow: 0 2px 8px rgba(13, 153, 255, 0.3);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 2px 8px rgba(13, 153, 255, 0.3);
}

.field-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 82px;
    gap: 10px;
    align-items: end;
}

.upload-list {
    display: grid;
    gap: 9px;
}

.upload-target {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 72px;
    gap: 12px;
    padding: 12px;
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius-card);
    background: var(--elevated-bg);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}

.upload-target input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.upload-target:active {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.upload-target.has-file {
    border-style: solid;
    border-color: rgba(20, 148, 95, 0.38);
    background: var(--success-soft);
}

.upload-target.optional {
    min-height: 62px;
}

.upload-target-large {
    min-height: 132px;
    align-items: center;
}

.upload-target-large .upload-icon {
    width: 52px;
    height: 52px;
    font-size: 18px;
}

.upload-target-large .upload-copy strong {
    font-size: 16px;
}

.upload-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #fff;
    color: var(--accent-strong);
    border: 1px solid var(--border-color);
    font-size: 14px;
    font-weight: 750;
}

.upload-copy {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.upload-copy strong {
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.2;
}

.upload-copy small {
    display: block;
    max-width: 100%;
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.media-thumb {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-input);
    background: var(--canvas-bg);
}

.media-thumb img,
.media-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-thumb-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 6px;
    color: var(--text-secondary);
    font-size: 11px;
    text-align: center;
}

.media-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-size: 15px;
    line-height: 1;
}

.details-section {
    padding: 0;
}

.details-section summary {
    min-height: 46px;
    padding: 13px 12px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
    list-style: none;
    cursor: pointer;
}

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

.details-section summary::after {
    content: "";
    float: right;
    width: 8px;
    height: 8px;
    margin-top: 4px;
    border-right: 2px solid var(--text-tertiary);
    border-bottom: 2px solid var(--text-tertiary);
    transform: rotate(45deg);
    transition: transform var(--transition);
}

.details-section[open] summary::after {
    transform: rotate(225deg);
}

.details-body {
    display: grid;
    gap: 12px;
    padding: 0 12px 12px;
    border-top: 1px solid var(--border-color);
}

.task-card {
    display: grid;
    gap: 12px;
    margin-top: 10px;
    padding: 12px;
}

.task-card.is-error {
    border-color: rgba(217, 45, 32, 0.32);
    background: linear-gradient(0deg, var(--error-soft), var(--panel-bg));
}

.task-card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.task-card-row strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 14px;
    line-height: 1.35;
}

#task-progress {
    color: var(--accent-strong);
    font-size: 13px;
    font-weight: 750;
}

.progress-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8edf5;
}

#progress-bar {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width 220ms ease;
}

#task-message {
    min-height: 18px;
    margin: 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
}

.result-video {
    width: 100%;
    max-height: 360px;
    border-radius: var(--radius-card);
    background: #000;
}

#download-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border-radius: var(--radius-input);
    background: var(--accent-strong);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.sticky-submit {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: min(calc(100% - 24px), 496px);
    margin: 0 auto;
    padding: 10px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    border: 1px solid rgba(211, 217, 229, 0.86);
    border-radius: var(--radius-card);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.2);
    backdrop-filter: blur(16px);
}

.sticky-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.sticky-copy strong {
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.25;
}

.sticky-copy span {
    max-width: 100%;
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#submit-button {
    min-width: 104px;
    min-height: 44px;
    flex: 0 0 auto;
    border: 0;
    border-radius: var(--radius-input);
    background: var(--accent-strong);
    color: #fff;
    font-size: 14px;
    font-weight: 750;
    cursor: pointer;
    transition: opacity var(--transition), background var(--transition), transform var(--transition);
}

.secondary-action {
    min-width: 74px;
    min-height: 44px;
    flex: 0 0 auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-input);
    background: var(--elevated-bg);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.secondary-action:disabled {
    opacity: 0.44;
    cursor: not-allowed;
}

#submit-button:active {
    transform: translateY(1px);
    background: #2045a8;
}

#submit-button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
    transform: none;
}

.modal-layer,
.task-list-layer {
    position: fixed;
    inset: 0;
    z-index: 60;
}

.modal-backdrop,
.task-list-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(8px);
}

.auth-modal-card,
.task-list-sheet {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: min(calc(100% - 24px), 496px);
    max-height: min(86dvh, 720px);
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--panel-bg);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.auth-modal-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.modal-head h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.25;
}

.modal-head p {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
}

.icon-close-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--elevated-bg);
    color: var(--text-secondary);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.auth-mode-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
}

.auth-mode-switch button {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.auth-mode-switch button.is-active {
    color: var(--accent-strong);
}

.auth-form {
    display: grid;
    gap: 12px;
}

.primary-form-button {
    min-height: 44px;
    border: 0;
    border-radius: var(--radius-input);
    background: var(--accent-strong);
    color: #fff;
    font-size: 14px;
    font-weight: 750;
    cursor: pointer;
}

.primary-form-button:disabled {
    opacity: 0.56;
    cursor: not-allowed;
}

.auth-message {
    margin: 0;
    padding: 9px 10px;
    border: 1px solid rgba(13, 153, 255, 0.18);
    border-radius: var(--radius-input);
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 12px;
    line-height: 1.45;
}

.auth-message.is-error {
    border-color: rgba(217, 45, 32, 0.24);
    background: var(--error-soft);
    color: var(--error);
}

.account-summary {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    background: var(--elevated-bg);
}

.account-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
}

.account-summary strong,
.account-summary span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-summary strong {
    color: var(--text-primary);
    font-size: 14px;
}

.account-summary span {
    margin-top: 2px;
    color: var(--text-secondary);
    font-size: 12px;
}

.account-logout {
    min-width: 58px;
}

.task-page {
    padding-bottom: 24px;
}

.page-back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-secondary);
    font-size: 20px;
    line-height: 1;
    text-decoration: none;
}

.task-page-panel {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    background: var(--panel-bg);
    box-shadow: var(--shadow-soft);
}

.task-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.task-page-head h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.25;
}

.task-page-head p {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
}

.task-page-content {
    margin-top: 0;
    padding-right: 0;
    overflow: visible;
}

.task-list-sheet {
    display: flex;
    flex-direction: column;
    min-height: min(420px, 86dvh);
    padding: 14px;
}

.task-list-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.task-list-status {
    margin-top: 10px;
    padding: 9px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-input);
    background: var(--elevated-bg);
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
}

.task-list-status.is-error {
    border-color: rgba(217, 45, 32, 0.24);
    background: var(--error-soft);
    color: var(--error);
}

.task-list-content {
    display: grid;
    flex: 1 1 auto;
    gap: 10px;
    min-height: 0;
    margin-top: 12px;
    padding-right: 2px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.h5-task-card {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    background: var(--elevated-bg);
}

.h5-task-card .progress-track > div {
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width 220ms ease;
}

.h5-task-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.h5-task-title {
    min-width: 0;
    overflow: hidden;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 750;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.h5-task-meta,
.h5-task-message {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
}

.task-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 11px;
    font-weight: 750;
    white-space: nowrap;
}

.task-status-pill.is-completed {
    background: var(--success-soft);
    color: var(--success);
}

.task-status-pill.is-failed {
    background: var(--error-soft);
    color: var(--error);
}

.h5-task-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.h5-task-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-input);
    background: #fff;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.h5-task-action.is-primary {
    border-color: transparent;
    background: var(--accent-strong);
    color: #fff;
}

.hidden {
    display: none !important;
}

@media (min-width: 480px) {
    .h5-app {
        padding-top: 18px;
    }

    .preview-stage {
        min-height: 360px;
    }
}

@media (max-width: 360px) {
    .panel-head {
        align-items: stretch;
        flex-direction: column;
    }

    .segmented-control {
        width: 100%;
    }

    .field-grid {
        grid-template-columns: 1fr;
    }

    .media-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .sticky-submit {
        gap: 8px;
    }

    #submit-button {
        min-width: 92px;
    }

    .secondary-action {
        min-width: 64px;
    }

    .header-actions {
        gap: 4px;
    }

    .header-action-btn,
    .header-action-link {
        min-width: 38px;
        padding: 0 8px;
    }
}
