.erabisheet-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 28px 12px 48px;
    box-sizing: border-box;
    color: var(--ios-text, #1f2937);
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    font-weight: 400;
}

.erabisheet-page * {
    box-sizing: border-box;
}

.erabisheet-page button,
.erabisheet-page input,
.erabisheet-page textarea,
.erabisheet-page select {
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

.erabisheet-page-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}

.erabisheet-page-header > div:last-child {
    display: grid;
    justify-items: start;
    min-width: 0;
    text-align: left;
}

.erabisheet-title-mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border: 1px solid color-mix(in srgb, var(--theme-primary, #6366f1) 28%, var(--ios-line, #d8dce6));
    border-radius: 15px;
    color: var(--theme-primary, #6366f1);
    background: color-mix(in srgb, var(--theme-primary, #6366f1) 10%, var(--ios-card, #ffffff));
}

.erabisheet-title-mark svg {
    width: 23px;
    height: 23px;
}

.erabisheet-kicker {
    margin: 0 0 3px;
    color: var(--theme-primary, #6366f1);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.erabisheet-page-header h1 {
    margin: 0;
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 700;
    line-height: 1.12;
    text-align: left !important;
}

.erabisheet-page-header p:last-child {
    margin: 5px 0 0;
    color: var(--ios-muted, #64748b);
    font-size: 14px;
}

.erabisheet-saved-bar,
.erabisheet-card {
    border: 1px solid var(--ios-line, rgba(15, 23, 42, 0.12));
    border-radius: 17px;
    background:
        linear-gradient(
            145deg,
            color-mix(in srgb, var(--theme-primary, #6366f1) 5%, var(--ios-card, #ffffff)),
            color-mix(in srgb, var(--theme-secondary, #a5b4fc) 7%, var(--ios-card, #ffffff))
        );
    box-shadow: 0 7px 22px rgba(15, 23, 42, 0.055);
}

.erabisheet-saved-bar {
    position: relative;
    z-index: 8;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 15px 17px;
}

.erabisheet-saved-bar label {
    display: grid;
    flex: 1 1 360px;
    gap: 7px;
    max-width: 720px;
    color: var(--ios-muted, #64748b);
    font-size: 12px;
    font-weight: 400;
}

.erabisheet-saved-bar .fumi-select {
    width: 100%;
}

.erabisheet-saved-bar .fumi-select-trigger {
    min-height: 42px;
    background:
        linear-gradient(
            145deg,
            color-mix(in srgb, var(--theme-primary, #6366f1) 4%, var(--ios-card, #ffffff)),
            color-mix(in srgb, var(--theme-secondary, #a5b4fc) 6%, var(--ios-card, #ffffff))
        );
}

.erabisheet-saved-bar .fumi-select-menu {
    z-index: 40;
}

.erabisheet-saved-select,
.erabisheet-page input[type="text"],
.erabisheet-page textarea {
    width: 100%;
    border: 1px solid var(--ios-line, rgba(15, 23, 42, 0.13));
    border-radius: 11px;
    outline: none;
    color: var(--ios-text, #1f2937);
    background:
        linear-gradient(
            145deg,
            color-mix(in srgb, var(--theme-primary, #6366f1) 6%, var(--ios-card, #ffffff)),
            color-mix(in srgb, var(--theme-secondary, #a5b4fc) 8%, var(--ios-card, #ffffff))
        );
    font: inherit;
    font-weight: 400;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.erabisheet-saved-select,
.erabisheet-page input[type="text"] {
    min-height: 42px;
    padding: 9px 12px;
}

.erabisheet-page textarea {
    min-height: 84px;
    padding: 11px 12px;
    resize: vertical;
    line-height: 1.45;
}

.erabisheet-page input[type="text"]:focus,
.erabisheet-page textarea:focus,
.erabisheet-saved-select:focus {
    border-color: color-mix(in srgb, var(--theme-primary, #6366f1) 62%, var(--ios-line, #d8dce6));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-primary, #6366f1) 12%, transparent);
}

.erabisheet-saved-actions,
.erabisheet-selection-actions,
.erabisheet-copy-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.erabisheet-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 18px;
}

.erabisheet-builder {
    display: grid;
    gap: 18px;
}

.erabisheet-card {
    padding: 20px;
}

.erabisheet-extract-card {
    position: sticky;
    top: 18px;
}

.erabisheet-card-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.erabisheet-float-button {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 7px 10px;
    white-space: nowrap;
}

.erabisheet-float-control {
    position: relative;
    z-index: 5;
    flex: 0 0 auto;
}

.erabisheet-float-button svg:last-child {
    width: 14px;
    height: 14px;
}

.erabisheet-float-menu {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    z-index: 20;
    display: grid;
    width: 270px;
    padding: 7px;
    border: 1px solid var(--ios-line, rgba(15, 23, 42, 0.13));
    border-radius: 12px;
    background: var(--ios-card, #ffffff);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
}

.erabisheet-float-menu[hidden] {
    display: none;
}

.erabisheet-float-option {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: start;
    gap: 9px;
    width: 100%;
    padding: 10px;
    border: 0;
    border-radius: 9px;
    color: var(--ios-text, #1f2937);
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.erabisheet-float-option:hover,
.erabisheet-float-option:focus-visible {
    outline: none;
    background: color-mix(in srgb, var(--theme-primary, #6366f1) 9%, transparent);
}

.erabisheet-float-option svg {
    width: 17px;
    height: 17px;
    margin-top: 2px;
    color: var(--theme-primary, #6366f1);
}

.erabisheet-float-option span {
    display: grid;
    gap: 2px;
}

.erabisheet-float-option strong {
    font-size: 12px;
    font-weight: 600;
}

.erabisheet-float-option small {
    color: var(--ios-muted, #64748b);
    font-size: 10px;
    font-weight: 400;
    line-height: 1.35;
}

.erabisheet-step-heading {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.erabisheet-step-number {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 9px;
    color: #ffffff;
    background: var(--theme-primary, #6366f1);
    font-size: 12px;
    font-weight: 600;
}

.erabisheet-step-heading h2 {
    margin: 2px 0 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
}

.erabisheet-step-heading p {
    margin: 5px 0 0;
    color: var(--ios-muted, #64748b);
    font-size: 12px;
    line-height: 1.45;
}

.erabisheet-field {
    display: grid;
    gap: 7px;
    margin-bottom: 14px;
    color: var(--ios-text, #1f2937);
    font-size: 12px;
    font-weight: 400;
}

.erabisheet-button,
.erabisheet-text-button,
.erabisheet-copy-one {
    appearance: none;
    border: 0;
    cursor: pointer;
    font: inherit;
}

.erabisheet-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 13px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 400;
    transition: transform 120ms ease, opacity 120ms ease, background 120ms ease;
}

.erabisheet-button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.erabisheet-button svg,
.erabisheet-copy-one svg {
    width: 16px;
    height: 16px;
}

.erabisheet-button-primary {
    color: #ffffff;
    background: var(--theme-primary, #6366f1);
    box-shadow: 0 5px 13px color-mix(in srgb, var(--theme-primary, #6366f1) 23%, transparent);
}

.erabisheet-button-secondary {
    border: 1px solid var(--ios-line, rgba(15, 23, 42, 0.13));
    color: var(--ios-text, #1f2937);
    background: color-mix(in srgb, var(--ios-card, #ffffff) 86%, transparent);
}

.erabisheet-extract-button,
.erabisheet-floating-extract {
    border-color: color-mix(in srgb, var(--theme-primary, #6366f1) 24%, var(--ios-line, #d8dce6));
    color: var(--ios-text, #1f2937);
    background:
        linear-gradient(
            145deg,
            color-mix(in srgb, var(--theme-primary, #6366f1) 7%, var(--ios-card, #ffffff)),
            color-mix(in srgb, var(--theme-secondary, #a5b4fc) 9%, var(--ios-card, #ffffff))
        );
    box-shadow: 0 5px 13px color-mix(in srgb, var(--theme-primary, #6366f1) 10%, transparent);
}

.erabisheet-extract-button {
    display: flex;
    width: max-content;
    margin-left: auto;
}

.erabisheet-button-danger {
    border: 1px solid color-mix(in srgb, #ef4444 28%, var(--ios-line, #d8dce6));
    color: #dc2626;
    background: color-mix(in srgb, #ef4444 7%, var(--ios-card, #ffffff));
}

.erabisheet-button:disabled,
.erabisheet-text-button:disabled {
    cursor: not-allowed;
    opacity: 0.43;
}

.erabisheet-read-button,
.erabisheet-save-button {
    display: flex;
    width: max-content;
    margin-left: auto;
}

.erabisheet-selection-actions {
    justify-content: flex-end;
    margin: -7px 0 9px;
}

.erabisheet-text-button {
    padding: 3px 0;
    color: var(--theme-primary, #6366f1);
    background: transparent;
    font-size: 11px;
    font-weight: 400;
}

.erabisheet-page .erabisheet-text-button {
    min-height: 0 !important;
    padding: 3px 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    color: var(--theme-primary, #6366f1) !important;
    background: transparent !important;
    box-shadow: none !important;
}

.erabisheet-page .erabisheet-text-button:hover:not(:disabled) {
    color: var(--theme-primary-dark, var(--theme-primary, #6366f1)) !important;
    text-decoration: underline;
    text-underline-offset: 3px;
    transform: none;
}

.erabisheet-fields-list {
    display: grid;
    max-height: 300px;
    margin-bottom: 14px;
    overflow: auto;
    border: 1px solid var(--ios-line, rgba(15, 23, 42, 0.12));
    border-radius: 12px;
    background:
        linear-gradient(
            145deg,
            color-mix(in srgb, var(--theme-primary, #6366f1) 6%, var(--ios-card, #ffffff)),
            color-mix(in srgb, var(--theme-secondary, #a5b4fc) 8%, var(--ios-card, #ffffff))
        );
    scrollbar-color: color-mix(in srgb, var(--theme-primary, #6366f1) 72%, var(--ios-muted, #64748b)) color-mix(in srgb, var(--ios-card, #ffffff) 72%, transparent);
    scrollbar-width: thin;
}

.erabisheet-fields-list::-webkit-scrollbar {
    width: 9px;
}

.erabisheet-fields-list::-webkit-scrollbar-track {
    border-radius: 12px;
    background: color-mix(in srgb, var(--ios-card, #ffffff) 72%, transparent);
}

.erabisheet-fields-list::-webkit-scrollbar-thumb {
    border: 2px solid color-mix(in srgb, var(--ios-card, #ffffff) 72%, transparent);
    border-radius: 12px;
    background: color-mix(in srgb, var(--theme-primary, #6366f1) 76%, var(--ios-muted, #64748b));
}

.erabisheet-fields-list::-webkit-scrollbar-thumb:hover {
    background: var(--theme-primary, #6366f1);
}

.erabisheet-field-choice {
    display: grid;
    grid-template-columns: 18px 28px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    min-height: 43px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--ios-line, rgba(15, 23, 42, 0.08));
    cursor: pointer;
}

.erabisheet-field-choice:last-child {
    border-bottom: 0;
}

.erabisheet-field-choice:hover {
    background: color-mix(in srgb, var(--theme-primary, #6366f1) 5%, transparent);
}

.erabisheet-field-choice input {
    display: grid;
    place-content: center;
    width: 16px;
    height: 16px;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid color-mix(in srgb, var(--theme-primary, #6366f1) 45%, var(--ios-line, #d8dce6));
    border-radius: 4px;
    outline: none;
    background: color-mix(in srgb, var(--ios-card, #ffffff) 84%, transparent);
    cursor: pointer;
}

.erabisheet-field-choice input::before {
    width: 9px;
    height: 9px;
    content: "";
    clip-path: polygon(14% 44%, 0 59%, 40% 100%, 100% 18%, 84% 0, 38% 62%);
    background: #ffffff;
    transform: scale(0);
    transition: transform 100ms ease;
}

.erabisheet-field-choice input:checked {
    border-color: var(--theme-primary, #6366f1);
    background: var(--theme-primary, #6366f1);
}

.erabisheet-field-choice input:checked::before {
    transform: scale(1);
}

.erabisheet-field-choice input:focus-visible {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-primary, #6366f1) 22%, transparent);
}

.erabisheet-field-position {
    color: var(--ios-muted, #64748b);
    font-size: 10px;
    font-weight: 400;
    text-align: center;
}

.erabisheet-field-name {
    overflow: hidden;
    font-size: 12px;
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.erabisheet-empty-state {
    display: grid;
    justify-items: center;
    gap: 8px;
    min-height: 116px;
    padding: 24px;
    place-content: center;
    color: var(--ios-muted, #64748b);
    text-align: center;
}

.erabisheet-empty-state svg {
    width: 23px;
    height: 23px;
    opacity: 0.68;
}

.erabisheet-empty-state p {
    margin: 0;
    font-size: 12px;
}

.erabisheet-row-warning {
    margin: 13px 0 0;
    padding: 10px 12px;
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 10px;
    color: #92400e;
    background: rgba(245, 158, 11, 0.09);
    font-size: 11px;
    line-height: 1.45;
}

html[data-theme="dark"] .erabisheet-row-warning {
    color: #fcd34d;
}

.erabisheet-results {
    display: grid;
    gap: 8px;
    margin-top: 15px;
}

.erabisheet-result-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 28px;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 9px 9px 9px 12px;
    border: 1px solid var(--ios-line, rgba(15, 23, 42, 0.11));
    border-radius: 11px;
    background: color-mix(in srgb, var(--theme-primary, #6366f1) 4%, var(--ios-card, #ffffff));
}

.erabisheet-result-row > div {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.erabisheet-result-label {
    color: var(--ios-muted, #64748b);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.erabisheet-result-value {
    overflow: hidden;
    color: var(--ios-text, #1f2937);
    font-size: 13px;
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.erabisheet-copy-one {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 4px;
    border: 0;
    border-radius: 0;
    color: var(--theme-primary, #6366f1);
    background: transparent;
    opacity: 0.82;
}

.erabisheet-copy-one:hover {
    color: var(--theme-primary-dark, var(--theme-primary, #6366f1));
    background: transparent;
    opacity: 1;
    transform: scale(1.08);
}

.erabisheet-copy-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 14px;
}

.erabisheet-copy-actions[hidden],
.erabisheet-row-warning[hidden] {
    display: none;
}

.erabisheet-status {
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

body.erabisheet-floating-body {
    min-height: 100vh;
    margin: 0;
    color: var(--ios-text, #1f2937);
    background: color-mix(in srgb, var(--theme-primary, #6366f1) 7%, var(--ios-card, #ffffff));
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    font-weight: 400;
}

.erabisheet-floating-body * {
    box-sizing: border-box;
}

.erabisheet-floating-shell {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

.erabisheet-floating-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 17px 14px;
    border-bottom: 1px solid var(--ios-line, rgba(15, 23, 42, 0.12));
    background: color-mix(in srgb, var(--ios-card, #ffffff) 92%, transparent);
}

.erabisheet-floating-header p {
    margin: 0 0 2px;
    color: var(--theme-primary, #6366f1);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.erabisheet-floating-header h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.15;
}

.erabisheet-floating-extractor-name {
    display: block;
    margin-top: 4px;
    color: var(--ios-muted, #64748b);
    font-size: 11px;
    font-weight: 400;
}

.erabisheet-floating-close,
.erabisheet-floating-copy-one {
    display: grid;
    place-items: center;
    appearance: none;
    border: 0;
    color: var(--ios-muted, #64748b);
    background: transparent;
    cursor: pointer;
}

.erabisheet-floating-close {
    width: 30px;
    height: 30px;
    padding: 6px;
}

.erabisheet-floating-close svg,
.erabisheet-floating-copy-one svg {
    width: 17px;
    height: 17px;
}

.erabisheet-floating-close:hover,
.erabisheet-floating-copy-one:hover {
    color: var(--theme-primary, #6366f1);
}

.erabisheet-floating-main {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    padding: 16px;
}

.erabisheet-floating-field {
    display: grid;
    gap: 7px;
    margin-bottom: 11px;
    color: var(--ios-text, #1f2937);
    font-size: 11px;
    font-weight: 400;
}

.erabisheet-floating-field textarea {
    width: 100%;
    min-height: 104px;
    padding: 10px 11px;
    resize: vertical;
    border: 1px solid var(--ios-line, rgba(15, 23, 42, 0.13));
    border-radius: 11px;
    outline: none;
    color: var(--ios-text, #1f2937);
    background:
        linear-gradient(
            145deg,
            color-mix(in srgb, var(--theme-primary, #6366f1) 9%, var(--ios-card, #ffffff)),
            color-mix(in srgb, var(--theme-secondary, #a5b4fc) 10%, var(--ios-card, #ffffff))
        );
    font: inherit;
    line-height: 1.45;
}

.erabisheet-floating-field textarea:focus {
    border-color: color-mix(in srgb, var(--theme-primary, #6366f1) 62%, var(--ios-line, #d8dce6));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-primary, #6366f1) 12%, transparent);
}

.erabisheet-floating-extract {
    align-self: flex-end;
}

.erabisheet-floating-warning {
    margin-top: 11px;
    padding: 9px 10px;
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 9px;
    color: #92400e;
    background: rgba(245, 158, 11, 0.09);
    font-size: 10px;
    line-height: 1.4;
}

html[data-theme="dark"] .erabisheet-floating-warning {
    color: #fcd34d;
}

.erabisheet-floating-warning[hidden],
.erabisheet-floating-copy-actions[hidden] {
    display: none;
}

.erabisheet-floating-results {
    display: grid;
    gap: 7px;
    margin-top: 13px;
}

.erabisheet-floating-empty {
    display: grid;
    min-height: 120px;
    place-items: center;
    color: var(--ios-muted, #64748b);
    font-size: 11px;
    text-align: center;
}

.erabisheet-floating-result-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 28px;
    align-items: center;
    gap: 8px;
    min-height: 53px;
    padding: 8px 8px 8px 11px;
    border: 1px solid var(--ios-line, rgba(15, 23, 42, 0.11));
    border-radius: 10px;
    background: color-mix(in srgb, var(--theme-primary, #6366f1) 4%, var(--ios-card, #ffffff));
}

.erabisheet-floating-result-row > div {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.erabisheet-floating-result-row span {
    color: var(--ios-muted, #64748b);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.erabisheet-floating-result-row strong {
    overflow: hidden;
    color: var(--ios-text, #1f2937);
    font-size: 12px;
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.erabisheet-floating-copy-one {
    width: 28px;
    height: 28px;
    padding: 4px;
}

.erabisheet-floating-copy-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 13px;
}

.erabisheet-floating-status {
    min-height: 16px;
    margin: 9px 0 0;
    color: var(--ios-muted, #64748b);
    font-size: 10px;
    text-align: right;
}

.erabisheet-floating-panel-host,
.erabisheet-templates-tab-panel {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    font-weight: 400;
    background:
        linear-gradient(
            145deg,
            color-mix(in srgb, var(--theme-primary, #6366f1) 5%, var(--ios-card, #ffffff)),
            color-mix(in srgb, var(--theme-secondary, #a5b4fc) 6%, var(--ios-card, #ffffff))
        );
}

.erabisheet-floating-panel-heading {
    padding: 12px 16px 0;
}

.erabisheet-floating-panel-heading p {
    margin: 0;
    color: var(--ios-text, #1f2937);
    font-size: 14px;
    font-weight: 700;
}

.erabisheet-floating-panel-heading span {
    display: block;
    margin-top: 3px;
    color: var(--ios-muted, #64748b);
    font-size: 10px;
    font-weight: 400;
}

.erabisheet-companion-tabs {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 5px;
    margin-top: 12px;
    margin-bottom: 10px;
    padding: 4px;
    border: 1px solid var(--ios-line, rgba(15, 23, 42, 0.12));
    border-radius: 10px;
    background:
        linear-gradient(
            145deg,
            color-mix(in srgb, var(--theme-primary, #6366f1) 8%, var(--ios-card, #ffffff)),
            color-mix(in srgb, var(--theme-secondary, #a5b4fc) 11%, var(--ios-card, #ffffff))
        );
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

.erabisheet-companion-tabs[hidden] {
    display: none;
}

.erabisheet-companion-tabs button {
    min-height: 32px;
    padding: 6px 9px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--ios-muted, #64748b);
    background: transparent;
    font: inherit;
    font-size: 11px;
    font-weight: 400;
    cursor: pointer;
}

.erabisheet-companion-tabs button:hover {
    color: var(--theme-primary, #6366f1);
    background: color-mix(in srgb, var(--theme-primary, #6366f1) 7%, transparent);
}

.erabisheet-companion-tabs button:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--theme-primary, #6366f1) 48%, transparent);
    outline-offset: 1px;
}

.erabisheet-companion-tabs button.active {
    color: var(--theme-primary, #6366f1);
    border-color: color-mix(in srgb, var(--theme-primary, #6366f1) 26%, var(--ios-line, #d8dce6));
    background: color-mix(in srgb, var(--theme-primary, #6366f1) 15%, var(--ios-glass-strong, #ffffff));
}

.erabisheet-companion-hidden {
    display: none !important;
}

/* Extracted row clipboard queue inside Fumi Companion */

.erabisheet-companion-queue {
    display: grid;
    gap: 10px;
    margin-top: 14px;
    padding-top: 13px;
    border-top: 1px solid var(--ios-line, rgba(15, 23, 42, 0.12));
}

.erabisheet-companion-queue-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.erabisheet-companion-queue-heading > div {
    display: grid;
    gap: 2px;
}

.erabisheet-companion-queue-heading strong {
    color: var(--ios-text, #1f2937);
    font-size: 12px;
    font-weight: 600;
}

.erabisheet-companion-queue-heading span {
    color: var(--ios-muted, #64748b);
    font-size: 9px;
}

.erabisheet-companion-clear-queue {
    padding: 4px 0;
    border: 0;
    color: var(--theme-primary, #6366f1);
    background: transparent;
    font: inherit;
    font-size: 10px;
    cursor: pointer;
}

.erabisheet-companion-queue-heading >
.erabisheet-companion-queue-history-actions {
    display: inline-flex;
    flex: 0 0 auto;
    grid-auto-flow: column;
    align-items: center;
    gap: 4px;
}

.erabisheet-companion-undo,
.erabisheet-companion-redo {
    display: inline-grid;
    place-items: center;
    width: 27px;
    min-width: 27px;
    height: 27px;
    min-height: 27px;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--theme-primary, #6366f1) 18%, var(--ios-line, #d8dce6));
    border-radius: 8px;
    color: var(--theme-primary, #6366f1);
    background: color-mix(in srgb, var(--theme-primary, #6366f1) 7%, var(--ios-card, #ffffff));
    cursor: pointer;
}

.erabisheet-companion-undo:hover:not(:disabled),
.erabisheet-companion-redo:hover:not(:disabled) {
    border-color: color-mix(in srgb, var(--theme-primary, #6366f1) 42%, var(--ios-line, #d8dce6));
    background: color-mix(in srgb, var(--theme-primary, #6366f1) 14%, var(--ios-card, #ffffff));
}

.erabisheet-companion-undo:focus-visible,
.erabisheet-companion-redo:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--theme-primary, #6366f1) 42%, transparent);
    outline-offset: 1px;
}

.erabisheet-companion-undo:disabled,
.erabisheet-companion-redo:disabled {
    cursor: default;
    opacity: 0.38;
}

.erabisheet-companion-undo svg,
.erabisheet-companion-redo svg {
    width: 13px;
    height: 13px;
}

.erabisheet-companion-clear-queue[hidden] {
    display: none;
}

.erabisheet-companion-queue-list {
    display: grid;
    gap: 9px;
}

.erabisheet-companion-queue-empty {
    padding: 18px 12px;
    border: 1px dashed color-mix(in srgb, var(--theme-primary, #6366f1) 24%, var(--ios-line, #d8dce6));
    border-radius: 10px;
    color: var(--ios-muted, #64748b);
    background: color-mix(in srgb, var(--theme-primary, #6366f1) 3%, transparent);
    font-size: 10px;
    line-height: 1.45;
    text-align: center;
}

.erabisheet-companion-queue-card {
    display: grid;
    gap: 9px;
    padding: 10px;
    border: 1px solid color-mix(in srgb, var(--theme-primary, #6366f1) 18%, var(--ios-line, #d8dce6));
    border-radius: 11px;
    background: color-mix(in srgb, var(--theme-primary, #6366f1) 5%, var(--ios-card, #ffffff));
    box-shadow: 0 7px 18px rgba(15, 23, 42, 0.06);
}

.erabisheet-companion-queue-card > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.erabisheet-companion-queue-card > header > strong {
    color: var(--ios-text, #1f2937);
    font-size: 10px;
    font-weight: 600;
}

.erabisheet-companion-queue-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.erabisheet-companion-copy-row,
.erabisheet-companion-remove-row,
.erabisheet-companion-copy-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 28px;
    min-height: 28px;
    padding: 5px 7px;
    border: 1px solid var(--ios-line, rgba(15, 23, 42, 0.12));
    border-radius: 8px;
    color: var(--ios-muted, #64748b);
    background: color-mix(in srgb, var(--ios-card, #ffffff) 86%, transparent);
    font: inherit;
    font-size: 9px;
    cursor: pointer;
}

.erabisheet-companion-copy-row {
    border-color: color-mix(in srgb, var(--theme-primary, #6366f1) 28%, var(--ios-line, #d8dce6));
    color: var(--theme-primary, #6366f1);
    background: color-mix(in srgb, var(--theme-primary, #6366f1) 10%, var(--ios-card, #ffffff));
}

.erabisheet-companion-remove-row {
    border-color: color-mix(in srgb, var(--theme-primary, #6366f1) 22%, var(--ios-line, #d8dce6));
    color: var(--theme-primary, #6366f1);
    background:
        linear-gradient(
            145deg,
            color-mix(in srgb, var(--theme-primary, #6366f1) 9%, var(--ios-card, #ffffff)),
            color-mix(in srgb, var(--theme-secondary, #a5b4fc) 12%, var(--ios-card, #ffffff))
        );
}

.erabisheet-companion-copy-row:hover,
.erabisheet-companion-remove-row:hover,
.erabisheet-companion-copy-cell:hover {
    color: var(--theme-primary, #6366f1);
    border-color: color-mix(in srgb, var(--theme-primary, #6366f1) 42%, var(--ios-line, #d8dce6));
}

.erabisheet-companion-remove-row:hover {
    background: color-mix(in srgb, var(--theme-primary, #6366f1) 16%, var(--ios-card, #ffffff));
}

.erabisheet-companion-copy-row svg,
.erabisheet-companion-remove-row svg,
.erabisheet-companion-copy-cell svg {
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
}

.erabisheet-companion-queue-cells {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
    gap: 6px;
}

.erabisheet-companion-queue-cell {
    display: grid;
    min-width: 0;
    gap: 3px;
    padding: 7px 8px;
    border: 1px solid color-mix(in srgb, var(--theme-primary, #6366f1) 18%, var(--ios-line, #d8dce6));
    border-radius: 8px;
    background:
        linear-gradient(
            145deg,
            color-mix(in srgb, var(--theme-primary, #6366f1) 9%, var(--ios-card, #ffffff)),
            color-mix(in srgb, var(--theme-secondary, #a5b4fc) 12%, var(--ios-card, #ffffff))
        );
}

.erabisheet-companion-queue-cell > span {
    overflow: hidden;
    color: var(--ios-muted, #64748b);
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.erabisheet-companion-queue-cell > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 25px;
    align-items: center;
    gap: 5px;
}

.erabisheet-companion-queue-cell strong {
    overflow: hidden;
    color: var(--ios-text, #1f2937);
    font-size: 10px;
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.erabisheet-companion-copy-cell {
    min-width: 25px;
    min-height: 25px;
    padding: 4px;
    border: 0;
    background: transparent;
}

/* Settings page displayed inside the floating Companion */

.fumi-companion-settings-open .erabisheet-companion-tabs,
.fumi-companion-settings-open .ft-search,
.fumi-companion-settings-open .ft-filter-row,
.fumi-companion-settings-open .ft-meta-row,
.fumi-companion-settings-open .erabisheet-templates-tab-panel,
.fumi-companion-settings-open .fumi-notes-companion-panel,
.fumi-companion-settings-open #ft-template-list {
    display: none !important;
}

.fumi-companion-settings-panel {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 14px;
    padding: 14px;
    overflow: auto;
    color: var(--ios-text, #1f2937);
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

.fumi-companion-settings-heading {
    display: flex;
    align-items: center;
    gap: 11px;
}

.fumi-companion-settings-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 32px;
    padding: 6px 9px;
    border: 1px solid color-mix(in srgb, var(--theme-primary, #6366f1) 22%, var(--ios-line, #d8dce6));
    border-radius: 9px;
    color: var(--theme-primary, #6366f1);
    background: color-mix(in srgb, var(--theme-primary, #6366f1) 7%, var(--ios-card, #ffffff));
    font: inherit;
    font-size: 10px;
    cursor: pointer;
}

.fumi-companion-settings-back svg {
    width: 14px;
    height: 14px;
}

.fumi-companion-settings-back:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--theme-primary, #6366f1) 48%, transparent);
    outline-offset: 1px;
}

.fumi-companion-settings-heading > div {
    display: grid;
    gap: 1px;
}

.fumi-companion-settings-heading p,
.fumi-companion-settings-heading h2 {
    margin: 0;
}

.fumi-companion-settings-heading p {
    color: var(--theme-primary, #6366f1);
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.fumi-companion-settings-heading h2 {
    font-size: 17px;
    line-height: 1.2;
    text-align: left;
}

.fumi-companion-settings-list {
    display: grid;
    gap: 9px;
}

.fumi-companion-settings-card {
    display: grid;
    gap: 9px;
    padding: 11px;
    border: 1px solid color-mix(in srgb, var(--theme-primary, #6366f1) 16%, var(--ios-line, #d8dce6));
    border-radius: 11px;
    background: color-mix(in srgb, var(--theme-primary, #6366f1) 4%, var(--ios-card, #ffffff));
}

.fumi-companion-settings-card[hidden] {
    display: none !important;
}

.fumi-companion-settings-card > span {
    display: grid;
    gap: 2px;
}

.fumi-companion-settings-card strong {
    color: var(--ios-text, #1f2937);
    font-size: 11px;
    font-weight: 600;
}

.fumi-companion-settings-card small {
    color: var(--ios-muted, #64748b);
    font-size: 9px;
    line-height: 1.35;
}

.fumi-companion-settings-card select {
    width: 100%;
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid var(--ios-line, rgba(15, 23, 42, 0.13));
    border-radius: 9px;
    color: var(--ios-text, #1f2937);
    background: var(--ios-card, #ffffff);
    font: inherit;
    font-size: 10px;
}

.erabisheet-templates-tab-panel {
    overflow: auto;
}

@media (max-width: 980px) {
    .erabisheet-layout {
        grid-template-columns: 1fr;
    }

    .erabisheet-extract-card {
        position: static;
    }
}

/* =========================================================
   ERABISHEET — UNIFIED THEME-AWARE SCROLLBARS
========================================================= */

html:has(body .erabisheet-page),
body:has(.erabisheet-page),
.erabisheet-page textarea,
.erabisheet-fields-list,
.erabisheet-floating-body,
.erabisheet-floating-field textarea,
.erabisheet-templates-tab-panel {
    scrollbar-width: thin !important;
    scrollbar-color:
        color-mix(
            in srgb,
            var(--theme-primary, #6366f1) 78%,
            var(--ios-muted, #64748b)
        )
        transparent !important;
}

/*
 * Chromium's standards-based thin scrollbar can keep platform
 * arrow indicators visible. Let Chromium use the fully custom
 * WebKit track below; Firefox keeps the thin/color rules above.
 */
@supports selector(::-webkit-scrollbar) {
    html:has(body .erabisheet-page),
    body:has(.erabisheet-page),
    .erabisheet-page textarea,
    .erabisheet-fields-list,
    .erabisheet-floating-body,
    .erabisheet-floating-field textarea,
    .erabisheet-templates-tab-panel {
        scrollbar-width: auto !important;
        scrollbar-color: auto !important;
    }
}

html:has(body .erabisheet-page)::-webkit-scrollbar,
body:has(.erabisheet-page)::-webkit-scrollbar,
.erabisheet-page textarea::-webkit-scrollbar,
.erabisheet-fields-list::-webkit-scrollbar,
.erabisheet-floating-body::-webkit-scrollbar,
.erabisheet-floating-field textarea::-webkit-scrollbar,
.erabisheet-templates-tab-panel::-webkit-scrollbar {
    width: 9px !important;
    height: 9px !important;
}

html:has(body .erabisheet-page)::-webkit-scrollbar-track,
body:has(.erabisheet-page)::-webkit-scrollbar-track,
.erabisheet-page textarea::-webkit-scrollbar-track,
.erabisheet-fields-list::-webkit-scrollbar-track,
.erabisheet-floating-body::-webkit-scrollbar-track,
.erabisheet-floating-field textarea::-webkit-scrollbar-track,
.erabisheet-templates-tab-panel::-webkit-scrollbar-track {
    margin: 4px 0 !important;
    border-radius: 999px !important;
    background: transparent !important;
}

html:has(body .erabisheet-page)::-webkit-scrollbar-thumb,
body:has(.erabisheet-page)::-webkit-scrollbar-thumb,
.erabisheet-page textarea::-webkit-scrollbar-thumb,
.erabisheet-fields-list::-webkit-scrollbar-thumb,
.erabisheet-floating-body::-webkit-scrollbar-thumb,
.erabisheet-floating-field textarea::-webkit-scrollbar-thumb,
.erabisheet-templates-tab-panel::-webkit-scrollbar-thumb {
    min-height: 34px !important;
    border: 2px solid transparent !important;
    border-radius: 999px !important;
    background:
        color-mix(
            in srgb,
            var(--theme-primary, #6366f1) 74%,
            var(--ios-muted, #64748b)
        ) !important;
    background-clip: padding-box !important;
}

html:has(body .erabisheet-page)::-webkit-scrollbar-thumb:hover,
body:has(.erabisheet-page)::-webkit-scrollbar-thumb:hover,
.erabisheet-page textarea::-webkit-scrollbar-thumb:hover,
.erabisheet-fields-list::-webkit-scrollbar-thumb:hover,
.erabisheet-floating-body::-webkit-scrollbar-thumb:hover,
.erabisheet-floating-field textarea::-webkit-scrollbar-thumb:hover,
.erabisheet-templates-tab-panel::-webkit-scrollbar-thumb:hover {
    background:
        var(--theme-primary, #6366f1) !important;
    background-clip: padding-box !important;
}

html:has(body .erabisheet-page)::-webkit-scrollbar-button,
body:has(.erabisheet-page)::-webkit-scrollbar-button,
.erabisheet-page textarea::-webkit-scrollbar-button,
.erabisheet-fields-list::-webkit-scrollbar-button,
.erabisheet-floating-body::-webkit-scrollbar-button,
.erabisheet-floating-field textarea::-webkit-scrollbar-button,
.erabisheet-templates-tab-panel::-webkit-scrollbar-button {
    -webkit-appearance: none !important;
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

html:has(body .erabisheet-page)::-webkit-scrollbar-corner,
body:has(.erabisheet-page)::-webkit-scrollbar-corner,
.erabisheet-page textarea::-webkit-scrollbar-corner,
.erabisheet-fields-list::-webkit-scrollbar-corner,
.erabisheet-floating-body::-webkit-scrollbar-corner,
.erabisheet-floating-field textarea::-webkit-scrollbar-corner,
.erabisheet-templates-tab-panel::-webkit-scrollbar-corner {
    background: transparent !important;
}

@media (max-width: 640px) {
    .erabisheet-page {
        padding: 24px 15px 38px;
    }

    .erabisheet-saved-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .erabisheet-saved-bar label {
        flex-basis: auto;
        max-width: none;
    }

    .erabisheet-saved-actions,
    .erabisheet-copy-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .erabisheet-card {
        padding: 16px;
    }

    .erabisheet-card-heading-row {
        align-items: stretch;
        flex-direction: column;
    }

    .erabisheet-float-button {
        align-self: flex-end;
        margin-top: -8px;
    }
}
