.appi-app {
    --appi-bg: #f6f7f9;
    --appi-surface: #ffffff;
    --appi-ink: #17202a;
    --appi-muted: #5c6670;
    --appi-line: #d8dee4;
    --appi-accent: #0f766e;
    --appi-accent-strong: #115e59;
    --appi-warn: #8a4b00;
    color: var(--appi-ink);
    font-family: inherit;
}

.appi-shell {
    display: grid;
    gap: 16px;
    width: min(1180px, 100%);
    margin: 0 auto;
}

.appi-workspace {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.appi-panel,
.appi-editor,
.appi-history {
    background: var(--appi-surface);
    border: 1px solid var(--appi-line);
    border-radius: 8px;
    padding: 16px;
}

.appi-panel__header,
.appi-editor__header,
.appi-history__header,
.appi-toolbar,
.appi-exportbar,
.appi-recorder {
    display: flex;
    align-items: center;
    gap: 10px;
}

.appi-panel__header,
.appi-editor__header,
.appi-history__header {
    justify-content: space-between;
    margin-bottom: 14px;
}

.appi-panel h2,
.appi-editor h3,
.appi-history h3 {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.25;
}

.appi-status {
    min-width: 92px;
    border: 1px solid var(--appi-line);
    border-radius: 999px;
    padding: 4px 9px;
    color: var(--appi-muted);
    font-size: 0.82rem;
    text-align: center;
    white-space: nowrap;
}

.appi-field {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
}

.appi-field label,
.appi-check {
    color: var(--appi-muted);
    font-size: 0.88rem;
}

.appi-field input,
.appi-field select {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--appi-line);
    border-radius: 6px;
    padding: 7px 9px;
    color: var(--appi-ink);
    background: #fff;
}

.appi-grid {
    display: grid;
    gap: 10px;
}

.appi-grid--controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 12px;
}

.appi-upload input {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    opacity: 0;
}

.appi-upload label {
    display: grid;
    place-items: center;
    min-height: 118px;
    border: 1px dashed #9aa7b2;
    border-radius: 8px;
    background: #fbfcfd;
    cursor: pointer;
    text-align: center;
}

.appi-upload strong {
    font-size: 1rem;
}

.appi-upload span {
    color: var(--appi-muted);
    font-size: 0.88rem;
}

.appi-progress {
    overflow: hidden;
    height: 6px;
    margin: 10px 0;
    background: #e9edf1;
    border-radius: 999px;
}

.appi-progress span {
    display: block;
    width: 0%;
    height: 100%;
    background: var(--appi-accent);
    transition: width 160ms ease;
}

.appi-recorder {
    justify-content: space-between;
    margin-bottom: 12px;
}

.appi-recorder span {
    color: var(--appi-muted);
    font-variant-numeric: tabular-nums;
}

.appi-app audio {
    width: 100%;
}

.appi-button,
.appi-exportbar button,
.appi-icon-button {
    min-height: 38px;
    border: 1px solid var(--appi-line);
    border-radius: 6px;
    padding: 7px 12px;
    background: #fff;
    color: var(--appi-ink);
    cursor: pointer;
    font: inherit;
    line-height: 1.2;
}

.appi-button:disabled,
.appi-exportbar button:disabled,
.appi-icon-button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.appi-button--primary {
    width: 100%;
    border-color: var(--appi-accent);
    background: var(--appi-accent);
    color: #fff;
}

.appi-button--primary:not(:disabled):hover {
    background: var(--appi-accent-strong);
}

.appi-button--ghost {
    background: #f9fafb;
}

.appi-icon-button {
    display: inline-grid;
    place-items: center;
    width: 38px;
    padding: 0;
    font-weight: 700;
}

.appi-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 12px;
}

.appi-note {
    margin: 12px 0 0;
    color: var(--appi-warn);
    font-size: 0.88rem;
    line-height: 1.45;
}

.appi-panel--score {
    min-height: 520px;
}

.appi-toolbar {
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.appi-score-meta {
    min-height: 24px;
    margin-bottom: 10px;
    color: var(--appi-muted);
    font-size: 0.9rem;
}

.appi-score-stage {
    overflow: auto;
    min-height: 420px;
    border: 1px solid var(--appi-line);
    border-radius: 8px;
    background: #fff;
}

.appi-empty {
    display: grid;
    min-height: 420px;
    place-items: center;
    color: var(--appi-muted);
    text-align: center;
    padding: 20px;
}

.appi-exportbar {
    flex-wrap: wrap;
    margin-top: 12px;
}

.appi-editor__header {
    flex-wrap: wrap;
}

.appi-editor__header > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.appi-table-wrap {
    overflow-x: auto;
}

.appi-note-table {
    width: 100%;
    border-collapse: collapse;
}

.appi-note-table th,
.appi-note-table td {
    border-bottom: 1px solid var(--appi-line);
    padding: 9px;
    text-align: left;
    vertical-align: middle;
}

.appi-note-table th {
    color: var(--appi-muted);
    font-size: 0.84rem;
    font-weight: 600;
}

.appi-note-table input,
.appi-note-table select {
    min-height: 34px;
    border: 1px solid var(--appi-line);
    border-radius: 6px;
    padding: 5px 7px;
}

.appi-note-table tr.is-active {
    background: #eef8f6;
}

.appi-project-list {
    display: grid;
    gap: 8px;
}

.appi-project {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid var(--appi-line);
    border-radius: 8px;
    padding: 10px;
}

.appi-project strong {
    display: block;
}

.appi-project span {
    color: var(--appi-muted);
    font-size: 0.82rem;
}

.appi-project div:last-child {
    display: flex;
    gap: 8px;
}

@media (max-width: 900px) {
    .appi-workspace {
        grid-template-columns: 1fr;
    }

    .appi-grid--controls {
        grid-template-columns: 1fr;
    }

    .appi-panel--score {
        min-height: auto;
    }
}

@media (max-width: 560px) {
    .appi-panel,
    .appi-editor,
    .appi-history {
        padding: 12px;
    }

    .appi-panel__header,
    .appi-project {
        align-items: flex-start;
        flex-direction: column;
    }

    .appi-exportbar button,
    .appi-button {
        width: 100%;
    }
}
