.staff-edit-page {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
    background: var(--bg-color);
}

.staff-edit-form {
    width: 100%;
}

.staff-edit-summary {
    display: flex;
    min-height: 64px;
    padding: 12px 15px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    background: #fff;
}

.staff-verified-state {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
}

.staff-verified-state > i {
    color: #35a66f;
    font-size: 22px;
}

.staff-verified-state span {
    display: flex;
    flex-direction: column;
    color: var(--text-sub);
    font-size: 11px;
}

.staff-verified-state strong {
    margin-top: 2px;
    color: var(--text-main);
    font-size: 13px;
}

.staff-edit-summary > a {
    flex: 0 0 auto;
    color: var(--primary-color);
    font-size: 12px;
}

.staff-edit-summary > a i {
    margin-left: 4px;
    font-size: 9px;
}

.staff-edit-tabs {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    height: 46px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-bottom: 1px solid var(--border-color);
    background: #fff;
}

.staff-edit-tab {
    position: relative;
    min-width: 0;
    padding: 0 5px;
    color: var(--text-sub);
    font-size: 13px;
}

.staff-edit-tab::after {
    position: absolute;
    right: 32%;
    bottom: -1px;
    left: 32%;
    height: 2px;
    background: transparent;
    content: "";
}

.staff-edit-tab.active {
    color: var(--primary-color);
    font-weight: bold;
}

.staff-edit-tab.active::after {
    background: var(--primary-color);
}

.staff-edit-section {
    margin-bottom: 10px;
    padding: 15px;
    background: #fff;
}

.staff-edit-section h2 {
    margin-bottom: 6px;
    color: var(--text-main);
    font-size: 14px;
    font-weight: bold;
}

.staff-edit-field {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 13px;
}

.staff-edit-field > span:first-child {
    flex: 0 0 auto;
}

.staff-edit-field > input {
    width: 66%;
    min-width: 0;
    min-height: 38px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-main);
    font-size: 13px;
    text-align: right;
}

.staff-edit-textarea-field {
    display: block;
    padding-top: 14px;
    border-bottom: 0;
}

.staff-edit-field-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.staff-edit-field-heading b,
.staff-edit-field-heading i {
    font-style: normal;
    font-weight: normal;
}

.staff-edit-field-heading small {
    color: var(--text-sub);
    font-size: 10px;
}

.staff-edit-textarea-field textarea {
    display: block;
    width: 100%;
    min-height: 88px;
    margin-top: 10px;
    padding: 10px;
    resize: vertical;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    outline: 0;
    background: #fafafa;
    color: var(--text-main);
    font-size: 13px;
    line-height: 1.5;
}

.required-mark {
    margin-left: 2px;
    color: #e14b5b;
    font-style: normal;
    font-weight: bold;
}

.staff-edit-chip-grid,
.staff-weekday-grid {
    display: grid;
    margin-top: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.staff-weekday-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.staff-edit-chip {
    position: relative;
    display: block;
    margin: 0;
    font-weight: normal;
}

.staff-edit-chip input,
.staff-voice-upload input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.staff-edit-chip span {
    display: flex;
    min-height: 36px;
    padding: 6px 4px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 4px;
    background: #f5f5f5;
    color: #666;
    font-size: 12px;
}

.staff-edit-chip input:checked + span {
    border-color: #ffb3c5;
    background: #fff0f4;
    color: var(--primary-color);
    font-weight: bold;
}

.staff-edit-chip input:focus-visible + span,
.staff-voice-upload input:focus-visible + span,
.staff-switch input:focus-visible + span {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

.staff-edit-voice-row {
    display: flex;
    margin-top: 12px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.staff-edit-audio {
    display: flex;
    width: 138px;
    height: 34px;
    padding: 0 11px;
    align-items: center;
    gap: 8px;
    border-radius: 17px;
    background: #fff0f4;
    color: var(--primary-color);
}

.staff-edit-audio > i {
    width: 10px;
    flex: 0 0 10px;
    font-size: 11px;
}

.staff-edit-audio > span {
    display: flex;
    height: 14px;
    flex: 1;
    align-items: center;
    justify-content: space-between;
}

.staff-edit-audio > span i {
    width: 2px;
    height: 6px;
    border-radius: 1px;
    background: currentColor;
}

.staff-edit-audio > span i:nth-child(2n) {
    height: 12px;
}

.staff-edit-audio > span i:nth-child(3n) {
    height: 9px;
}

.staff-edit-audio small {
    flex: 0 0 auto;
    font-size: 10px;
}

.staff-edit-audio.unavailable {
    background: #f3f3f3;
    color: #aaa;
}

.staff-voice-upload {
    position: relative;
    margin: 0;
    font-weight: normal;
}

.staff-voice-upload > span {
    display: flex;
    min-height: 34px;
    padding: 0 12px;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border-color);
    border-radius: 17px;
    color: var(--text-main);
    font-size: 12px;
}

.staff-voice-file {
    max-width: 100%;
    margin-top: 9px;
    overflow: hidden;
    color: var(--text-sub);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.staff-services-section {
    padding-bottom: 5px;
}

.staff-service-editor-list {
    margin-top: 12px;
}

.staff-service-editor {
    margin-bottom: 10px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #fff;
}

.staff-service-editor.is-offline {
    background: #fafafa;
}

.staff-service-editor header {
    display: flex;
    min-height: 38px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.staff-service-editor header > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.staff-service-editor header strong {
    color: var(--text-main);
    font-size: 13px;
}

.staff-service-editor header small {
    margin-top: 3px;
    overflow: hidden;
    color: var(--text-sub);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.staff-switch {
    position: relative;
    display: block;
    width: 42px;
    height: 24px;
    flex: 0 0 42px;
    margin: 0;
}

.staff-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.staff-switch span {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: #d8d8d8;
    transition: background-color 0.18s ease;
}

.staff-switch span::after {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    content: "";
    transition: transform 0.18s ease;
}

.staff-switch input:checked + span {
    background: var(--primary-color);
}

.staff-switch input:checked + span::after {
    transform: translateX(18px);
}

.staff-switch-large {
    width: 48px;
    height: 28px;
    flex-basis: 48px;
}

.staff-switch-large span {
    border-radius: 14px;
}

.staff-switch-large span::after {
    width: 24px;
    height: 24px;
}

.staff-switch-large input:checked + span::after {
    transform: translateX(20px);
}

.staff-service-fields {
    display: grid;
    margin-top: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.staff-service-fields label,
.staff-time-range label {
    display: flex;
    min-width: 0;
    margin: 0;
    flex-direction: column;
    color: var(--text-sub);
    font-size: 10px;
    font-weight: normal;
}

.staff-service-fields input,
.staff-service-fields select,
.staff-time-range input {
    width: 100%;
    min-width: 0;
    height: 36px;
    margin-top: 5px;
    padding: 0 7px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    outline: 0;
    background: #fff;
    color: var(--text-main);
    font-size: 12px;
}

.staff-accept-row {
    display: flex;
    min-height: 40px;
    align-items: center;
    justify-content: space-between;
}

.staff-accept-row h2 {
    margin-bottom: 3px;
}

.staff-accept-row > div > span {
    color: #35a66f;
    font-size: 11px;
}

.staff-accept-row > div > span.is-paused {
    color: var(--text-sub);
}

.staff-time-range {
    display: grid;
    margin-top: 16px;
    align-items: end;
    grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
    gap: 8px;
}

.staff-time-range > i {
    height: 36px;
    color: var(--text-sub);
    font-size: 11px;
    line-height: 36px;
    text-align: center;
}

.staff-edit-error {
    position: fixed;
    right: 15px;
    bottom: calc(68px + env(safe-area-inset-bottom));
    left: 15px;
    z-index: 90;
    width: calc(100% - 30px);
    max-width: 720px;
    margin: 0 auto;
    padding: 8px 11px;
    border: 1px solid #f2c5cb;
    border-radius: 4px;
    background: #fff4f5;
    color: #c74355;
    font-size: 11px;
}

.staff-edit-actions {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 80;
    display: flex;
    width: 100%;
    max-width: 750px;
    margin: 0 auto;
    padding: 10px 15px calc(10px + env(safe-area-inset-bottom));
    gap: 10px;
    border-top: 1px solid var(--border-color);
    background: #fff;
}

.staff-edit-actions a,
.staff-edit-actions button {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 21px;
    font-size: 14px;
    font-weight: bold;
}

.staff-edit-actions a {
    width: 32%;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.staff-edit-actions button {
    flex: 1;
    background: var(--primary-color) !important;
    color: #fff;
}

.staff-edit-message {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 100;
    padding: 10px 16px;
    transform: translate(-50%, -50%);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    font-size: 12px;
}

@media (max-width: 359px) {
    .staff-edit-summary,
    .staff-edit-section {
        padding-right: 12px;
        padding-left: 12px;
    }

    .staff-edit-actions {
        padding-right: 12px;
        padding-left: 12px;
    }

    .staff-service-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
