/* Voicelock Styles */

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --success-color: #10b981;
    --error-color: #ef4444;
    --secondary-color: #6b7280;
    --bg-color: #f9fafb;
    --card-bg: #ffffff;
    --text-color: #111827;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 0.5rem 0.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

header {
    text-align: left;
    margin-bottom: 0.5rem;
}

header h1 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.subtitle {
    font-size: 1rem;
    color: var(--text-muted);
}

/* Main app container - expands to accommodate content */
#app {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    flex: 1 1 auto;
    min-height: 0;
}

.card {
    width: 100%;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: .5rem;
    box-sizing: border-box;
    overflow: hidden;
}

.card.error {
    border: 2px solid var(--error-color);
}

/* Screens */
.screen {
    display: none;
    width: 100%;
}

.screen.active {
    display: block;
    width: 100%;
    min-height: 0;
    height: auto;
    animation: fadeIn 0.3s ease-in;
}

/* Recording screen - ensure it expands to accommodate dynamically added content */
#recording-screen {
    width: 100%;
    min-height: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-container {
    width: 100%;
}

.tab-buttons {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 0.5rem;
    width: 100%;
}

.tab-btn {
    padding: 0.375rem 0.25rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: var(--primary-color);
    background: #f9fafb;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.start-user-heading-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.start-user-id-btn {
    padding: 0.375rem 0.75rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    font-family: inherit;
    text-align: left;
}

.start-user-id-btn:hover {
    text-decoration: underline;
}

.start-profile-actions {
    display: none;
    align-items: center;
    flex-wrap: wrap;
}

.start-heading-label {
    font-weight: 600;
    white-space: nowrap;
    color: var(--text-primary);
}

.start-inline-speaker-input {
    flex: 1 1 10rem;
    min-width: 8rem;
    padding: 0.375rem 0.5rem;
    font-size: 0.9375rem;
    border: thin solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
}

.start-profile-actions-inline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.recording-speaker-heading-row {
    margin-bottom: 0.75rem;
}

.start-tab-action-btn {
    padding: 0.375rem 0.75rem;
    background: transparent;
    border: thin solid var(--border-color);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    font-family: inherit;
}

.start-tab-action-btn:hover {
    color: var(--primary-color);
}

.tab-content {
    background: #f0f9ff;
    border-left: 4px solid var(--primary-color);
    margin: 0.5rem;
    padding: 0.75rem;
    border-radius: 8px;
    min-height: 360px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

.tab-pane ol {
    margin-left: 0.75rem;
}

.tab-pane li {
    margin-bottom: 0.25rem;
}

/* Info Row */
.info-row {
    float: left;
}

/* Info Box */
.info-box {
    background: #f0f9ff;
    border-left: 4px solid var(--primary-color);
    padding: 0.75rem;
    margin: 0.75rem 0;
    border-radius: 8px;
}

.info-box h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.info-box ol {
    margin-left: 0.75rem;
}

.info-box li {
    margin-bottom: 0.25rem;
}

/* Privacy Notice */
.privacy-notice {
    background: #f0fdf4;
    border: 1px solid #10b981;
    padding: 0.5rem;
    border-radius: 8px;
    margin: 0.75rem 0;
    text-align: center;
}

/* Forms */
form {
    margin-top: 1rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.wallet-field-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.wallet-mint-status {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: var(--bg-secondary, rgba(0, 0, 0, 0.06));
    border: 1px solid var(--border-color);
}

.wallet-mint-status .wallet-mint-pending-msg {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-color);
}

.wallet-collection-tbody {
    border-bottom: 1px solid var(--border-color);
}

.wallet-collection-header {
    cursor: pointer;
    user-select: none;
    background: var(--bg-secondary, rgba(0, 0, 0, 0.04));
}

.wallet-collection-header:hover {
    background: var(--bg-secondary, rgba(0, 0, 0, 0.08));
}

.wallet-collection-header:focus-visible {
    outline: 2px solid var(--border-color);
    outline-offset: -2px;
}

.wallet-collection-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Microphone Status */

.microphone-status-banner {
    display: none;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.mic-status {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0;
    text-align: center;
    flex: 0 1 auto;
}

.mic-status.hidden {
    display: none;
}

.mic-status.success {
    background: #f0fdf4;
    border: 2px solid var(--success-color);
    color: var(--success-color);
}

.mic-status.error {
    background: #fef2f2;
    border: 2px solid var(--error-color);
    color: var(--error-color);
}

#mic-status-icon {
    font-size: 1.5rem;
}

input[type="text"],
input[type="password"],
input[type="textbox"],
textarea {
    width: 100%;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="textbox"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

textarea {
    resize: vertical;
    font-size: 1.1rem;
    line-height: 1.5;
}

small {
    display: block;
    color: var(--text-muted);
    margin-top: -0.25rem;
    margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
    padding: 0.375rem 0.75rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    transition: background-color 0.1s ease, transform 0.1s ease, box-shadow 0.1s ease;
}

.btn-primary-right {
    float: right;
    background: var(--primary-color);
    color: white;
    transition: background-color 0.1s ease, transform 0.1s ease, box-shadow 0.1s ease;
}

/* Recording state for the button */
.btn-primary.recording {
    background: var(--error-color);
}

/* Immediate feedback on mousedown */
.btn-primary:active:not(:disabled) {
    transform: scale(0.98);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.1);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #4b5563;
}

.btn-danger {
    background: var(--error-color);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #059669;
}

.btn-large {
    padding: 0.5rem 1rem;
    font-size: 1.2rem;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
}

/* Progress */
.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.progress-indicator {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
    width: 0%;
}

/* Sentence Card */
.sentence-card {
    margin: 1rem 0;
    background: transparent;
    position: relative;
    z-index: 2;
    padding: 0.5rem 0;
    width: 100%;
    max-width: none;
}

/* Sentence text wrapper */
.sentence-text-wrapper {
    position: relative;
    margin: 0.5rem 0;
}

/* Transcription wrapper - positions waveform behind transcription */
.transcription-wrapper {
    position: relative;
    margin: 0.5rem 0;
}

/* Sentence input - editable combobox */
#sentence-input {
    width: 100%;
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    padding-right: 3rem;
    /* Make room for dropdown icon */
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-color);
    position: relative;
    z-index: 2;
    min-height: 3rem;
    line-height: 1.5;
    pointer-events: auto;
}

#sentence-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

#sentence-input::placeholder {
    color: var(--text-muted);
}

button{
    margin:0.5rem;
    max-width: 10rem;
}

/* Dropdown icon button */
.sentence-dropdown-icon {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 0.875rem;
    cursor: pointer;
    z-index: 5;
    padding: 0.5rem;
    line-height: 1;
    min-width: 2rem;
    min-height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    margin-top: -0.5rem;
}

.sentence-dropdown-icon:hover {
    color: var(--primary-color);
}

.sentence-dropdown-icon:focus {
    outline: none;
}

/* Dropdown container */
.sentence-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    display: none;
    z-index: 10;
    margin-top: -2px;
    /* Overlap border */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    opacity: 1;
}

.sentence-dropdown.visible {
    display: block;
}

.sentence-dropdown ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sentence-dropdown li {
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-width: 100%;
    background: var(--card-bg);
}

.sentence-dropdown li:hover {
    background: var(--bg-color);
}

.sentence-dropdown li:last-child {
    border-bottom: none;
}

.sentence-dropdown li:hover {
    background: var(--bg-primary);
    color: var(--primary-color);
}

#sentence-text:focus {
    outline: none;
    border-color: var(--primary-color);
}

#sentence-text::placeholder {
    color: var(--text-muted);
}

.transcription-text {
    position: relative;
    z-index: 2;
    margin-left: auto;
    margin-top: 0.5rem;
    padding: 0.375rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 1rem;
    min-height: 2.5rem;
    font-style: italic;
    display: block !important;
    visibility: visible !important;
    /* Prevent container from collapsing when empty */
    box-sizing: border-box;
}

.transcription-text:empty::before {
    content: "detected text will appear here...";
    color: #9ca3af;
    display: inline-block;
}

/* Voiceprint: ASR text is not shown; suppress placeholder on the recording feedback strip */
#transcription-display.transcription-text:empty::before {
    content: none;
}

.transcription-text.match {
    border-color: var(--success-color);
    background: #f0fdf4;
    color: var(--success-color);
    font-weight: 600;
    font-style: normal;
}

.transcription-text.test-match-high {
    border-color: #28a745;
    background: #f0fdf4;
    color: #28a745;
    font-weight: 600;
    font-style: normal;
}

.transcription-text.test-match-medium {
    border-color: #ffc107;
    background: #fffbf0;
    color: #ffc107;
    font-weight: 600;
    font-style: normal;
}

.transcription-text.test-match-low {
    border-color: #dc3545;
    background: #fef2f2;
    color: #dc3545;
    font-weight: 600;
    font-style: normal;
}

.transcription-text.mismatch {
    border-color: var(--error-color);
    background: #fef2f2;
    color: var(--error-color);
    font-weight: 600;
    font-style: normal;
}

/* Waveform */
.waveform-container {
    background: transparent;
    border-radius: 8px;
    padding: 0.5rem;
    display: none;
    /* Hidden by default */
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    opacity: 0.7;
    pointer-events: none;
    /* Allow clicks to pass through to transcription display */
}

/* Show waveform during recording */
body.recording .waveform-container {
    display: flex;
}

#waveform {
    border-radius: 4px;
}

#timer {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    color: var(--primary-color);
}

/* Controls */
.controls {
    display: flex;
    
    justify-content: center;
    flex-wrap: wrap;
    margin: 1rem 0;
}

/* Recordings List */
.recordings-list {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
}

#recordings {
    display: block;
    width: 100%;
    max-height: 280px;
    /* Height for header + 5 rows */
    overflow-y: auto;
    overflow-x: hidden;
}

.recordings-list h3 {
    margin-bottom: 0.5rem;
}

.recordings-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    display: table;
}

.recordings-table thead {
    background: var(--bg-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.recordings-table th {
    padding: 0.5rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}

.recordings-table td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.recordings-table tbody tr:hover {
    background: #f9fafb;
}

.recordings-table tbody tr:last-child td {
    border-bottom: none;
}

/* Spinner */
.spinner {
    width: 64px;
    height: 64px;
    border: 6px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 1rem auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#processing-status {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* Results */

.details-list {
    list-style: none;
}

.details-list li {
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--border-color);
}

.details-list li:last-child {
    border-bottom: none;
}

.actions {
    display: flex;
    
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 1rem 0.5rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}


.recording #record-btn {
    background-color: var(--error-color);
    color: white;
}

.recording #record-btn:hover {
    background-color: #dc2626;
}

/* ============================================================================ */
/* PURCHASE OPTIONS GRID */
/* ============================================================================ */

.purchase-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    
    margin-top: 1rem;
}

.purchase-box {
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    background: var(--card-bg);
    transition: all 0.2s ease;
}

.purchase-box:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.purchase-box h4 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
    font-size: 1.25rem;
}

.purchase-box .price {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0.5rem 0;
}

.purchase-box .credits,
.purchase-box .storage {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--success-color);
    margin: 0.5rem 0;
}

.purchase-box .description {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0.75rem 0 1rem;
    min-height: 2.4em;
}

.purchase-option-btn {
    width: 100%;
    margin-top: 0.5rem;
}

/* ============================================================================ */
/* CREDENTIALS DISPLAY */
/* ============================================================================ */

.credentials-display {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
    border: 1px solid var(--border-color);
}

.credential-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.credential-item:last-child {
    border-bottom: none;
}

.credential-item label {
    font-weight: 600;
    min-width: 150px;
    color: var(--text-color);
}

.credential-value {
    display: flex;
    align-items: center;
   
    flex: 1;
}

.credential-value span {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    word-break: break-all;
    color: var(--text-muted);
}

.btn-copy {
    padding: 0.375rem 0.875rem;
    font-size: 0.85rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.btn-copy:hover {
    background: var(--primary-hover);
}

.btn-copy:active {
    transform: scale(0.95);
}

.credential-actions {
    display: flex;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.credential-actions .btn {
    flex: 1;
    min-width: 200px;
}

/* ============================================================================ */
/* ENTRY LIST AND VIEWER */
/* ============================================================================ */

.entries-list {
    background: var(--bg-color);
    padding: 0.5rem;
    border-radius: 8px;
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.entry-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.entry-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.entry-item:last-child {
    margin-bottom: 0;
}

.entry-info {
    flex: 1;
}

.entry-info h4 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.entry-info p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
    color: var(--text-color);
}

.entry-info p strong {
    color: var(--text-muted);
    font-weight: 600;
}

.entry-info .success {
    color: var(--success-color);
    font-weight: 600;
}

.entry-info .error {
    color: var(--error-color);
    font-weight: 600;
}

.entry-item .btn {
    margin-left: 0.5rem;
}

/* ============================================================================ */
/* ENTRIES TABLE (Date / Entry Name / Status)                                   */
/* ============================================================================ */

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

.entries-table thead th {
    padding: 0.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
}

/* Date column: ISO yyyy-mm-dd only (~10 chars); avoid stealing width from other columns. */
#entries-list .entries-table td:first-child,
#entries-list .entries-table th:first-child,
#nfts-list .entries-table td:first-child,
#nfts-list .entries-table th:first-child,
#wallet-transaction-history .entries-table td:first-child,
#wallet-transaction-history .entries-table th:first-child {
    width: 11ch;
    max-width: 11ch;
    white-space: nowrap;
    box-sizing: border-box;
}

/* Saved Entries + Tokens: same fixed layout as Transaction History so date stays compact. */
#entries-list .entries-table,
#nfts-list .entries-table {
    table-layout: fixed;
    width: 100%;
}

/* Transaction History: keep description phrases (e.g. "Credit Purchase") on one line. */
#wallet-transaction-history .entries-table {
    table-layout: fixed;
    width: 100%;
}

#wallet-transaction-history .entries-table td:nth-child(2),
#wallet-transaction-history .entries-table th:nth-child(2) {
    min-width: 15ch;
    white-space: nowrap;
}

.entries-table-row {
    cursor: pointer;
    transition: background 0.15s;
}

.entries-table-row:hover {
    background: var(--bg-color);
}

#wallet-transaction-history .purchase-receipt-row {
    cursor: pointer;
}

.entries-table-row td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
}

.entry-status-stored {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--bg-color);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.entry-status-published {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    background: #f0fdf4;
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.entry-status-local {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--bg-color);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.entry-status-minting {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #d97706;
}

.entry-status-failed {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #dc2626;
}

.entry-type-voiceprint,
.entry-type-biometric,
.entry-type-medical,
.entry-type-policy,
.entry-type-unknown {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: lowercase;
}

.entry-type-voiceprint {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #93c5fd;
}

.entry-type-biometric {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fcd34d;
}

.entry-type-medical {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #6ee7b7;
}

.entry-type-policy {
    background: #f3e8ff;
    color: #7c3aed;
    border: 1px solid #c4b5fd;
}

.entry-type-unknown {
    background: #f4f4f5;
    color: #52525b;
    border: 1px solid #d4d4d8;
}

.entry-detail-row td {
    padding: 0;
    border-bottom: 1px solid var(--border-color);
}

.entry-detail-panel {
    padding: 0.75rem 1rem;
    background: var(--bg-color);
    font-size: 0.9rem;
    border-left: 3px solid var(--primary-color);
    display: block;
}

.entry-detail-info {
    margin-bottom: 0.75rem;
}

.entry-detail-info span {
    display: block;
    margin-bottom: 0.25rem;
}

.entry-detail-actions {
    display: block;
}

.entry-detail-actions button {
    margin-right: 0.5rem;
    margin-bottom: 0.25rem;
}

.entry-detail-actions button:last-child {
    margin-right: 0;
}

.entry-detail-panel div {
    margin-bottom: 0.4rem;
}

.entry-detail-panel ul {
    margin: 0.25rem 0 0 1.25rem;
    padding: 0;
}

.entry-detail-panel li {
    margin-bottom: 0.15rem;
}

.entry-detail-blockchain code {
    background: var(--card-bg);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
    word-break: break-all;
}

/* ============================================================================ */
/* MODAL DIALOG */
/* ============================================================================ */

.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--card-bg);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    position: relative;
    box-shadow: var(--shadow-lg);
    max-height: 80vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
    line-height: 1;
    font-weight: 300;
}

.modal-close:hover {
    color: var(--error-color);
}

.entry-detail {
    padding: 0.5rem 0;
}

.entry-detail p {
    margin: 0.75rem 0;
    line-height: 1.6;
}

.entry-detail code {
    background: var(--bg-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    word-break: break-all;
    display: inline-block;
    max-width: 100%;
}

.entry-detail h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.entry-detail ul {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
}

.entry-detail li {
    padding: 0.5rem 0.75rem;
    margin: 0.25rem 0;
    background: var(--bg-color);
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
}

/* ============================================================================ */
/* RESPONSIVE ADJUSTMENTS */
/* ============================================================================ */


/* Compact purchase form — matches .policy-form-container sizing */
.purchase-form {
    display: flex;
    flex-direction: column;
    width:100%;
    margin: 0.5rem 0;
}

.purchase-form .field-row {
    display: flex;
    align-items: flex-start;
    
}

.purchase-form .field-row > div:first-child {
    flex: 1;
    display: flex;
    flex-direction: column;
   
}

.purchase-form label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.purchase-form input[type="email"] {
    width: 60%;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.95rem;
    background: var(--bg-color);
    color: var(--text-color);
}

.purchase-form input[type="email"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

#crossmint-checkout-container {
    margin-top: 0.5rem;
}

.purchase-quantity-block {
    width: 100%;
}

.purchase-order-summary {
    margin: 0.75rem 0 0;
    font-weight: 600;
    color: var(--text-primary);
}

.purchase-quantity-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.purchase-quantity-row {
    display: flex;
    flex-wrap: wrap;
    
    align-items: center;
}

.purchase-quantity-row .buy-credits-pack {
    flex: 1 1 auto;
    min-width: 6.5rem;
}

.purchase-quantity-row .buy-credits-pack:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.purchase-actions-row {
    display: flex;
    flex-wrap: wrap;
   
    align-items: center;
}

/* Two-column field: label row + input row */
.two-col-field {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    margin-bottom: 0.75rem;
}
.two-col-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.two-col-input {
    width: 100%;
    font-size: 0.9rem;
}
.expiry-row {
    display: flex;
    align-items: center;
}
.expiry-datetime {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
    margin-left: 1rem;
}

.field-input {
    width: 100%;
    font-size: 0.9rem;
    padding: 0.2rem;
    margin: 0.2rem;
}

/* Expiry Inline Layout */
.expiry-inline {
    display: flex;
    align-items: center;
    
    flex-wrap: wrap;
}

.expiry-number-input {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    height: 35px;
    box-sizing: border-box;
    text-align: center;
    padding: 0.25rem 0.15rem;
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

#upload-expiry-unit {
    margin-top: 0.75rem;
}

select {
    margin-bottom: 0.5rem;
}

.expiry-inline select {
    padding: 0.3rem 0.5rem;
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.expiry-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Policy Form Styling */
.policy-form-container {
    display: flex;
    align-items: start;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

/* Storage option box */
.storage-option {
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}

/* Transaction selector dropdown styling */
.card > form,
.card > form > .policy-form-container {
    max-width: 100%;
}

.control-selector {
    display: flex;
    flex-direction: column;
   
    margin-bottom: 1.5rem;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.control-options {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.control-selector label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
}

.control-dropdown {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.control-dropdown:hover {
    border-color: var(--primary-color);
}

.control-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.control-descriptions {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-color);
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.control-descriptions div {
    display: none;
}

.control-descriptions div.active {
    display: block;
}

/* Policy codelist accordion (WASM-generated control checkboxes) */
.policy-accordion {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
}

.policy-accordion-item {
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    border-radius: 2px;
    overflow: hidden;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.policy-accordion-header {
    width: 100%;
    text-align: left;
    /* Top-level section headers align with surrounding copy; children indent in `.policy-accordion-panel`. */
    padding: 0.5rem 0.75rem 0.5rem 0;
    background: transparent;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-color);
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.policy-accordion-header-toggle-icon {
    display: inline-block;
    flex-shrink: 0;
    font-size: 0.6rem;
    transition: transform 0.2s ease;
}

.policy-accordion-header[aria-expanded="true"] .policy-accordion-header-toggle-icon {
    transform: rotate(90deg);
}

.policy-accordion-header-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Biometric policy form: full-width header, single-line title with ellipsis */
.policy-accordion--bp .policy-accordion-header {
    width: 100%;
    max-width: 100%;
}

.policy-accordion-header:hover {
    background: rgba(0, 0, 0, 0.03);
}

.policy-accordion-panel {
    padding: 0.35rem 0 0.75rem 1.25rem;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.policy-accordion .control-option {
    padding: 0.65rem 0.5rem 0.65rem 0;
    margin-bottom: 0.5rem;
}

.policy-accordion .control-option-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
    box-sizing: border-box;
}

.policy-accordion .control-option-main-line {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.policy-accordion .control-option-text-label {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    cursor: pointer;
    font-weight: 600;
}

.policy-accordion .control-option-label-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.35;
}

.policy-accordion .control-option-checkbox {
    flex-shrink: 0;
    width: 1.125rem;
    height: 1.125rem;
    margin: 0;
    cursor: pointer;
}

.policy-accordion .control-fields-inline {
    width: 100%;
    max-width: 100%;
}

.policy-accordion .control-option-description {
    margin-top: 0.25rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.policy-accordion .control-option-main-line .control-description-toggle {
    flex-shrink: 0;
    margin: 0;
    padding: 0.2rem 0.25rem;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    border-radius: 4px;
}

.policy-accordion .control-option-main-line .control-description-toggle:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-color);
}

.policy-accordion .control-description-toggle-icon {
    display: inline-block;
    font-size: 0.6rem;
    transition: transform 0.2s ease;
}

.policy-accordion .control-description-toggle[aria-expanded="true"] .control-description-toggle-icon {
    transform: rotate(90deg);
}

.policy-accordion .control-option-description .control-description {
    margin-top: 0;
    min-width: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.policy-accordion .control-option-description .control-description.is-collapsed {
    display: none;
}

.policy-accordion .control-option-description .control-description.is-expanded {
    display: block;
}

.policy-accordion .control-fields.is-collapsed {
    display: none !important;
}

.policy-accordion .control-option:last-child {
    margin-bottom: 0;
}

.control-option {
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    border-radius: 6px;
    padding: 0.9rem;
    margin-bottom: 0.75rem;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.control-option label.control-option-text-label {
    display: block;
    cursor: pointer;
    font-weight: 600;
}

.control-option-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
    box-sizing: border-box;
}

.control-option-main-line {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.control-fields-inline {
    display: none;
    flex-direction: row;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    flex: 1;
    min-width: 0;
}

.control-fields-inline input,
.control-fields-inline select {
    width: auto;
    margin: 0;
    flex: 1;
    min-width: 100px;
    max-width: 200px;
}

.control-fields-inline:has([data-field="nickname"]),
.control-fields-inline:has([data-field="authkey-display"]) {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    width: 100%;
}

.control-fields-inline:has([data-field="nickname"]) input[data-field="nickname"],
.control-fields-inline:has([data-field="authkey-display"]) input[data-field="authkey-display"] {
    flex: none;
    width: 100%;
    max-width: 200px;
}

.control-fields-inline > div:has(select[id^="txn-permission-"]) {
    flex-basis: 100%;
    width: fit-content;
}

.control-fields-inline select[id^="txn-permission-"],
.control-fields-inline select[data-field^="permission-"] {
    flex: none;
    width: fit-content;
    field-sizing: content;
}

.control-fields-inline select[data-field="identity-type"] {
    flex: none;
    width: fit-content;
    field-sizing: content;
}

.control-option:last-child {
    margin-bottom: 0;
}

.control-description {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.control-fields {
    margin-top: 0.5rem;
    padding-left: 0.75rem;
    box-sizing: border-box;
    overflow: hidden;
}

.control-fields input,
.control-fields select {
    width: 100%;
    margin-top: 0.25rem;
    box-sizing: border-box;
}

/* Transaction cart styling */
.control-cart {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    width: 100%;
    box-sizing: border-box;
}

.control-cart h3 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.cart-items {
    display: block;
}

.cart-empty {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: start;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    
}

.cart-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    
}

.cart-item-title {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1rem;
}

.cart-item-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

.cart-item-cost {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: var(--primary-color);
    white-space: nowrap;
}

.cart-item-cost input {
    width: 80px;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: right;
}

.cart-item-remove {
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.cart-item-remove:hover {
    background: #dc2626;
}

/* Cart table (2-column Name | Credits) */
.cart-table {
    width: 100%;
    border-collapse: collapse;
}

.cart-table thead th {
    padding: 0.5rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.cart-table-scroll {
    display: block;
    max-height: 7.5rem;
    overflow-y: auto;
    padding-right: 6rem;
}

.cart-table thead,
.cart-table tfoot,
.cart-table-scroll tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.cart-table tbody td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.cart-table tfoot td {
    padding: 0.5rem;
    border-top: 2px solid var(--border-color);
    font-size: 1rem;
}

.cart-credits-col {
    width: 80px;
    text-align: right;
}

.cart-total-row td {
    color: var(--primary-color);
}

.cart-summary {
    display: none;
}

.cart-total {
    text-align: right;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.cart-total span {
    color: var(--primary-color);
}

/* Text fields group - uniform wide fields */
.text-fields-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
}

.text-fields-group label {
    display: flex;
    flex-direction: column;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 0;
}

.text-fields-group input {
    margin-top: 0.25rem;
    width: 100%;
}

/* Form actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.form-actions .btn {
    min-width: 150px;
}

/* Field row layout (horizontal label + input) */
.field-row {
    display: block;
    align-items: start;
    margin:0.5rem;
}

.field-row label {
    min-width: 150px;
    font-weight: 600;
    margin-bottom: 0;
    text-align: left;
}

.field-row input {
    flex: 1;
}

/* Keep Entry Name label + input on one line across forms */
.entry-name-row,
.entry-name-row > span {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.5rem;
}

.entry-name-row b {
    white-space: nowrap;
}

#perm-entry-name,
#upload-entry-name,
#policy-entry-name {
    width: 300px;
    max-width: 300px;
}

.inline-selector-row,
.inline-selector-row > span {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.5rem;
}

.inline-selector-row b {
    white-space: nowrap;
}

#policy-biometric-data-selector {
    width: 200px;
    max-width: 200px;
}

.expiry-inline-row {
    display: flex;
    gap: 0.5rem;
    grid-template-columns: none;
}

.expiry-inline-row .two-col-span {
    margin-top: 0.5rem;
    white-space: nowrap;
}

/* Account Summary Styling */
.account-summary {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
    border: 1px solid var(--border-color);
}

.account-summary h3 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item strong {
    color: var(--text-muted);
    min-width: 150px;
}

.summary-item span {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    word-break: break-all;
    color: var(--text-color);
}

/* Welcome Buttons Styling */
.start-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.start-buttons .btn {
    min-width: 200px;
}

/* Purchase Actions Styling */
.purchase-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    
    margin: 1rem 0;
}

/* Credits indicator in tab bar */
.credits-indicator {
    margin-left: auto;
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    color: var(--accent-primary);
    cursor: pointer;
    white-space: nowrap;
    font-weight: 600;
    border: 1px solid var(--accent-primary);
    border-radius: 1rem;
    transition: background 0.2s, color 0.2s;
}
.credits-indicator:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

/* Entry detail action buttons */
.entry-detail-actions {
    display: flex;
   
    flex-shrink: 0;
    align-items: center;
}

/* Entry summary box for control/NFT screens */
.entry-summary-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
}
.entry-summary-box div {
    margin-bottom: 0.4rem;
}

/* Status area for publish screens */
.status-area {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
}
.status-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 0.5rem;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Purchase screen */
.purchase-balance-display {
    background: var(--bg-secondary);
    border: 1px solid var(--accent-primary);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Voiceprint Summary Section */
.voiceprint-summary {
    margin: 0.5rem 0;
}

.voiceprint-summary h4 {
    color: var(--primary-color);
    font-size: 1rem;
}

.detected-sentences {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem;
    margin-bottom: 1rem;
    max-height: 180px;
    overflow-y: auto;
}

.detected-sentences ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.detected-sentences li {
    padding: 0.2rem 0.25rem;
    margin: 0;
    font-size: 0.9rem;
}

.file-info {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.75rem;
    min-height: 60px;
}

.file-info p {
    margin: 0.25rem 0;
}

.file-info .file-name {
    font-weight: 600;
    color: var(--text-color);
    font-family: 'Courier New', monospace;
}

.file-info .file-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* User action buttons  */
.user-action-buttons {
    width: 100%;
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.user-action-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    text-align: left;
    max-width: none;
    margin: 0;
    transition: background 0.15s, color 0.15s;
    box-sizing: border-box;
}

.user-action-btn:hover {
    background: #f0f4ff;
    color: var(--primary-color);
}

.user-action-chevron {
    font-size: 0.7rem;
    flex-shrink: 0;
    margin-left: 0.5rem;
    color: var(--text-muted);
}

/* Credits button in profile toolbar (replaces tab-bar indicator) */
.credits-toolbar-btn {
    border: none;
    margin-left: auto;
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    background: transparent;
    cursor: pointer;
    white-space: nowrap;
    max-width: none;
    transition: background 0.2s, color 0.2s;
}

.credits-toolbar-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Start Now button container */
#start-now-container {
    text-align: center;
}

#start-now-btn {
    min-width: 160px;
    max-width: none;
    padding: 0.6rem 2rem;
    font-size: 1.05rem;
}