/* ============================================================
   CIPHERBLOCK PWA — Mobile App Shell Stylesheet
   ============================================================ */

/* --- Design Tokens --- */
:root {
    --cb-bg: #f5f5f5;
    --cb-card: #ffffff;
    --cb-primary: #333333;
    --cb-accent-start: #667eea;
    --cb-accent-end: #764ba2;
    --cb-accent-hover-start: #7788ee;
    --cb-accent-hover-end: #8555b2;
    --cb-text: #333333;
    --cb-text-secondary: #666666;
    --cb-text-tertiary: #999999;
    --cb-border: #e0e0e0;
    --cb-border-light: #f0f0f0;
    --cb-success: #6cdb56;
    --cb-pending: #3fd2ea;
    --cb-error: #e36767;
    --cb-radius-sm: 8px;
    --cb-radius-md: 12px;
    --cb-radius-lg: 16px;
    --cb-radius-pill: 20px;
    --cb-shadow-card: 0 2px 4px rgba(0,0,0,0.05);
    --cb-shadow-elevated: 0 4px 12px rgba(0,0,0,0.10);
    --cb-shadow-sheet: 0 -4px 20px rgba(0,0,0,0.15);
    --cb-edge: 16px;
    --cb-tab-height: 60px;
    --cb-header-height: 56px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 15px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Roboto Condensed', sans-serif;
    background: var(--cb-bg);
    color: var(--cb-text);
    overflow: hidden;
    height: 100dvh;
    width: 100%;
    position: relative;
}

/* --- App Shell --- */
.app-shell {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    max-width: 430px;
    margin: 0 auto;
    background: var(--cb-bg);
    position: relative;
    overflow: hidden;
    border-left: 1px solid var(--cb-border);
    border-right: 1px solid var(--cb-border);
}

/* --- Header Bar --- */
.header-bar {
    height: var(--cb-header-height);
    background: var(--cb-card);
    border-bottom: 1px solid var(--cb-border);
    display: flex;
    align-items: center;
    padding: 0 var(--cb-edge);
    flex-shrink: 0;
    z-index: 10;
}

.header-brand {
    font-family: 'Fira Sans', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--cb-text);
    flex: 1;
}

.header-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--cb-text-secondary);
}

.header-back {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--cb-text);
    margin-left: -8px;
    margin-right: 4px;
    border-radius: 50%;
}

.header-back:active { background: var(--cb-border-light); }

.header-actions {
    display: flex;
    gap: 4px;
}

.header-action-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--cb-text-secondary);
    border-radius: 50%;
}

.header-action-btn:active { background: var(--cb-border-light); }

/* --- Tab Content Area --- */
.tab-content-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* --- Tab Panels --- */
.tab-panel {
    display: none;
    min-height: 100%;
}

.tab-panel.active { display: block; }

/* --- Sub-views (slide-in screens) --- */
.sub-view {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--cb-bg);
    z-index: 20;
    transform: translateX(100%);
    transition: transform 250ms ease-out;
    display: flex;
    flex-direction: column;
    max-width: 430px;
    margin: 0 auto;
}

.sub-view.active {
    transform: translateX(0);
}

.sub-view .tab-content-area {
    flex: 1;
}

/* --- Bottom Tab Bar --- */
.tab-bar {
    height: var(--cb-tab-height);
    background: var(--cb-card);
    border-top: 1px solid var(--cb-border);
    display: flex;
    align-items: stretch;
    flex-shrink: 0;
    z-index: 10;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.tab-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--cb-text-tertiary);
    position: relative;
    transition: color 150ms;
    -webkit-tap-highlight-color: transparent;
}

.tab-bar-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: transparent;
    transition: background 150ms;
}

.tab-bar-item.active {
    color: var(--cb-accent-start);
}

.tab-bar-item.active::before {
    background: var(--cb-accent-start);
}

.tab-bar-icon {
    font-size: 22px;
    line-height: 1;
}

.tab-bar-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Cards --- */
.card {
    background: var(--cb-card);
    border: 1px solid var(--cb-border);
    border-radius: var(--cb-radius-md);
    box-shadow: var(--cb-shadow-card);
    overflow: hidden;
}

.card:active { transform: scale(0.98); }
.card-static:active { transform: none; }

/* --- Portfolio Card (gradient hero) --- */
.portfolio-card {
    background: linear-gradient(135deg, var(--cb-accent-start), var(--cb-accent-end));
    border: none;
    border-radius: var(--cb-radius-lg);
    padding: 24px 20px;
    color: white;
    margin: var(--cb-edge);
}

.portfolio-card:active { transform: none; }

.portfolio-label {
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 4px;
}

.portfolio-balance {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
}

.portfolio-sub {
    font-size: 12px;
    opacity: 0.7;
    font-family: 'Puritan', sans-serif;
    margin-bottom: 16px;
}

.portfolio-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: white;
    color: var(--cb-accent-start);
    border: none;
    border-radius: var(--cb-radius-sm);
    padding: 10px 20px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.portfolio-btn:active { opacity: 0.9; }

/* --- Section Headers --- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--cb-edge);
    margin-bottom: 10px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--cb-text);
}

.section-action {
    font-size: 13px;
    font-weight: 600;
    color: var(--cb-accent-start);
    background: none;
    border: none;
    cursor: pointer;
}

/* --- Wallet Cards --- */
.wallet-card {
    margin: 0 var(--cb-edge) 10px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.wallet-identicon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    flex-shrink: 0;
    overflow: hidden;
}

.wallet-info {
    flex: 1;
    min-width: 0;
}

.wallet-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--cb-text);
}

.wallet-address {
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 12px;
    color: var(--cb-text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wallet-right {
    text-align: right;
    flex-shrink: 0;
}

.wallet-balance {
    font-size: 15px;
    font-weight: 600;
    color: var(--cb-text);
}

.wallet-stats {
    font-size: 11px;
    color: var(--cb-text-tertiary);
}

.wallet-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 6px;
    vertical-align: middle;
}

.wallet-dot.active { background: var(--cb-success); }
.wallet-dot.empty { background: var(--cb-border); }

/* --- List Rows --- */
.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px var(--cb-edge);
    background: var(--cb-card);
    border: 1px solid var(--cb-border);
    border-radius: var(--cb-radius-md);
    margin: 0 var(--cb-edge) 10px;
    cursor: pointer;
    box-shadow: var(--cb-shadow-card);
}

.list-row:active { background: var(--cb-border-light); }

.list-row-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--cb-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.list-row-chevron {
    color: var(--cb-text-tertiary);
    font-size: 18px;
}

/* --- FAB --- */
.fab {
    position: absolute;
    bottom: calc(var(--cb-tab-height) + 16px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cb-accent-start), var(--cb-accent-end));
    color: white;
    border: none;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--cb-shadow-elevated);
    z-index: 5;
    transition: transform 200ms;
}

.fab:active { transform: scale(0.92); }

/* --- Pill Chips (scrollable row) --- */
.pill-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 var(--cb-edge) 12px;
    scrollbar-width: none;
}

.pill-scroll::-webkit-scrollbar { display: none; }

.pill {
    flex-shrink: 0;
    padding: 8px 16px;
    border-radius: var(--cb-radius-sm);
    border: 1px solid var(--cb-border);
    background: var(--cb-card);
    color: var(--cb-text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 150ms;
}

.pill:active { transform: scale(0.96); }

.pill.active {
    background: linear-gradient(135deg, var(--cb-accent-start), var(--cb-accent-end));
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 4px rgba(102,126,234,0.3);
}

/* --- Form Elements --- */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--cb-text-secondary);
    margin-bottom: 6px;
    text-transform: none;
}

.form-input {
    width: 100%;
    height: 48px;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: var(--cb-radius-sm);
    font-size: 16px;
    font-family: inherit;
    background: var(--cb-card);
    color: var(--cb-text);
    transition: border-color 200ms, box-shadow 200ms;
    appearance: none;
    -webkit-appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: var(--cb-accent-start);
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.form-input::placeholder { color: var(--cb-text-tertiary); }

textarea.form-input {
    height: auto;
    min-height: 100px;
    resize: vertical;
}

select.form-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.form-hint {
    font-size: 12px;
    color: var(--cb-text-tertiary);
    margin-top: 4px;
}

.form-input-with-action {
    position: relative;
}

.form-input-with-action .form-input {
    padding-right: 48px;
}

.form-input-action {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    background: var(--cb-border-light);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--cb-text-secondary);
}

.form-input-action:active { background: var(--cb-border); }

/* --- Account Selector --- */
.account-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #ddd;
    border-radius: var(--cb-radius-sm);
    padding: 8px 12px;
    background: var(--cb-card);
    cursor: pointer;
}

.account-selector:active { background: var(--cb-border-light); }

.selector-identicon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    flex-shrink: 0;
    overflow: hidden;
}

.selector-info {
    flex: 1;
    min-width: 0;
}

.selector-name {
    font-size: 14px;
    font-weight: 600;
}

.selector-address {
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 11px;
    color: var(--cb-text-tertiary);
}

.selector-chevron {
    color: var(--cb-text-tertiary);
    font-size: 12px;
}

/* --- Buttons --- */
.btn-primary {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--cb-accent-start), var(--cb-accent-end));
    color: white;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102,126,234,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 200ms;
}

.btn-primary:active { transform: scale(0.97); }

.btn-outlined {
    width: 100%;
    height: 48px;
    border: 2px solid var(--cb-accent-start);
    border-radius: 10px;
    background: white;
    color: var(--cb-accent-start);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-outlined:active { background: rgba(102,126,234,0.05); }

.btn-ghost {
    width: 100%;
    height: 48px;
    border: none;
    background: none;
    color: var(--cb-text-secondary);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.btn-ghost:active { background: var(--cb-border-light); border-radius: 10px; }

.btn-row {
    display: flex;
    gap: 10px;
}

.btn-row .btn-outlined { flex: 1; }

.btn-small {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid var(--cb-border);
    border-radius: 6px;
    background: var(--cb-card);
    font-size: 12px;
    color: var(--cb-text-secondary);
    cursor: pointer;
    font-family: inherit;
}

.btn-small:active { background: var(--cb-border-light); }

/* --- Preview / Result Boxes --- */
.result-box {
    border-radius: 10px;
    background: #f8f9fa;
    border: 1px solid var(--cb-border);
    padding: 14px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 12px;
    color: var(--cb-text-secondary);
    word-break: break-all;
    white-space: pre-wrap;
    min-height: 56px;
    line-height: 1.6;
}

/* --- Tool Grid --- */
.tool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 var(--cb-edge);
}

.tool-card {
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
}

.tool-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--cb-radius-md);
    background: linear-gradient(135deg, var(--cb-accent-start), var(--cb-accent-end));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    margin: 0 auto 10px;
    box-shadow: 0 2px 4px rgba(102,126,234,0.3);
}

.tool-card-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--cb-text);
}

/* --- Transaction Card (explorer) --- */
.tx-card {
    margin: 0 var(--cb-edge) 10px;
    padding: 14px 16px;
    cursor: pointer;
}

.tx-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.tx-card-block {
    font-size: 14px;
    font-weight: 600;
    color: var(--cb-text);
}

.tx-card-time {
    font-size: 12px;
    color: var(--cb-text-tertiary);
}

.tx-card-mid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.tx-type-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tx-type-badge.transfer { background: #eef; color: #667eea; }
.tx-type-badge.rate { background: #e3f2fd; color: #2196F3; }
.tx-type-badge.nft { background: #f3e5f5; color: #764ba2; }
.tx-type-badge.sell { background: #fff3e0; color: #ff9800; }
.tx-type-badge.buy { background: #e8f5e9; color: #4CAF50; }
.tx-type-badge.burn { background: #fce4ec; color: #e36767; }

.tx-card-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--cb-text);
}

.tx-card-addrs {
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 12px;
    color: var(--cb-text-tertiary);
    margin-bottom: 8px;
}

.tx-card-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
}

.tx-card-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot-green { background: var(--cb-success); }
.dot-blue { background: var(--cb-pending); }
.dot-red { background: var(--cb-error); }

/* --- Search Bar --- */
.search-bar {
    margin: 0 var(--cb-edge) 12px;
    position: relative;
}

.search-bar .form-input {
    padding-left: 40px;
}

.search-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: var(--cb-text-tertiary);
}

/* --- Stats Line --- */
.stats-line {
    padding: 0 var(--cb-edge) 12px;
    font-size: 12px;
    color: var(--cb-text-tertiary);
}

/* --- Contact Card --- */
.contact-card {
    margin: 0 var(--cb-edge) 10px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.contact-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cb-accent-start), var(--cb-accent-end));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
}

.contact-info {
    flex: 1;
    min-width: 0;
}

.contact-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--cb-text);
}

.contact-addr {
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 11px;
    color: var(--cb-text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contact-tags {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--cb-border-light);
    font-size: 11px;
    color: var(--cb-text-secondary);
}

/* --- Bottom Sheet --- */
.sheet-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms;
}

.sheet-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.sheet {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 100%);
    width: 100%;
    max-width: 430px;
    background: var(--cb-card);
    border-radius: var(--cb-radius-lg) var(--cb-radius-lg) 0 0;
    z-index: 51;
    transition: transform 300ms ease-out;
    max-height: 85dvh;
    overflow-y: auto;
    box-shadow: var(--cb-shadow-sheet);
}

.sheet.active {
    transform: translate(-50%, 0);
}

.sheet-handle {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: #ddd;
    margin: 10px auto 0;
}

.sheet-content {
    padding: 20px var(--cb-edge) calc(20px + env(safe-area-inset-bottom, 0px));
}

.sheet-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--cb-text);
    margin-bottom: 16px;
}

/* --- Detail Rows (for block detail, confirm sheet) --- */
.detail-table {
    border: 1px solid var(--cb-border);
    border-radius: var(--cb-radius-md);
    overflow: hidden;
    margin-bottom: 16px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--cb-border-light);
    gap: 12px;
}

.detail-row:last-child { border-bottom: none; }

.detail-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--cb-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.detail-value {
    font-size: 13px;
    color: var(--cb-text);
    text-align: right;
    word-break: break-all;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

.detail-value.normal {
    font-family: inherit;
}

/* --- Wallet Detail Screen --- */
.detail-hero {
    text-align: center;
    padding: 24px var(--cb-edge);
}

.detail-identicon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    margin: 0 auto 12px;
    overflow: hidden;
}

.detail-balance {
    font-size: 28px;
    font-weight: 700;
    color: var(--cb-text);
    margin-bottom: 8px;
}

.detail-address {
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 11px;
    color: var(--cb-text-tertiary);
    word-break: break-all;
    line-height: 1.6;
    margin-bottom: 12px;
    padding: 0 24px;
}

/* --- Collapsible --- */
.collapsible-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--cb-text-secondary);
    border: none;
    background: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.collapsible-trigger .arrow {
    transition: transform 200ms;
    font-size: 12px;
}

.collapsible-trigger.open .arrow {
    transform: rotate(90deg);
}

.collapsible-body {
    display: none;
    padding-bottom: 12px;
}

.collapsible-body.open { display: block; }

.tips-list {
    list-style: disc;
    padding-left: 20px;
    margin: 0 0 12px;
}

.tips-list li {
    font-size: 13px;
    color: var(--cb-text-secondary);
    line-height: 1.6;
    margin-bottom: 6px;
}

.tips-note {
    border-radius: 8px;
    background: #f8f9fa;
    border: 1px solid var(--cb-border);
    padding: 10px;
    font-size: 12px;
    color: var(--cb-text-secondary);
    line-height: 1.5;
}

/* --- Identicon placeholder (gradient squares) --- */
.identicon-placeholder {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
    width: 100%;
    height: 100%;
}

.identicon-placeholder .ic-fill {
    background: linear-gradient(135deg, var(--cb-accent-start), var(--cb-accent-end));
}

.identicon-placeholder .ic-empty {
    background: var(--cb-border-light);
}

/* Alt identicon pattern */
.identicon-alt .ic-fill {
    background: linear-gradient(135deg, #764ba2, #667eea);
}

/* --- Success State --- */
.success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--cb-success);
    color: white;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

/* --- Spacing Utilities --- */
.p-edge { padding: 0 var(--cb-edge); }
.px-edge { padding-left: var(--cb-edge); padding-right: var(--cb-edge); }
.pt-16 { padding-top: 16px; }
.pb-16 { padding-bottom: 16px; }
.pb-24 { padding-bottom: 24px; }
.mb-10 { margin-bottom: 10px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.text-center { text-align: center; }

.screen-pad {
    padding: 16px var(--cb-edge) 24px;
}

.screen-subtitle {
    font-size: 13px;
    color: var(--cb-text-tertiary);
    font-family: 'Puritan', sans-serif;
    line-height: 1.5;
    margin-bottom: 20px;
}

/* --- Load More --- */
.load-more {
    text-align: center;
    padding: 16px;
}

.load-more-btn {
    font-size: 14px;
    font-weight: 600;
    color: var(--cb-accent-start);
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* --- Toast Notifications --- */
#toast-container {
    position: fixed;
    top: calc(var(--cb-header-height) + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 398px;
    z-index: 100;
}

.toast {
    background: var(--cb-card);
    border-radius: var(--cb-radius-sm);
    box-shadow: var(--cb-shadow-elevated);
    margin-bottom: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    border-left: 4px solid #2196F3;
    animation: toastIn 300ms ease-out;
}

.toast.success { border-left-color: #4CAF50; }
.toast.error   { border-left-color: #f44336; }
.toast.warning { border-left-color: #ff9800; }
.toast.info    { border-left-color: #2196F3; }

.toast-icon {
    font-size: 20px;
    margin-right: 12px;
    flex-shrink: 0;
}

.toast.success .toast-icon { color: #4CAF50; }
.toast.error .toast-icon   { color: #f44336; }
.toast.warning .toast-icon { color: #ff9800; }
.toast.info .toast-icon    { color: #2196F3; }

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: bold;
    margin-bottom: 4px;
    font-size: 14px;
}

.toast-message {
    font-size: 13px;
    color: var(--cb-text-secondary);
    word-wrap: break-word;
    line-height: 1.6;
}

.toast-close {
    margin-left: 12px;
    cursor: pointer;
    color: var(--cb-text-tertiary);
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

.toast-close:hover { color: var(--cb-text); }

.toast.removing {
    animation: toastOut 300ms ease-out forwards;
}

@keyframes toastIn {
    from { transform: translateY(-20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

@keyframes toastOut {
    from { transform: translateY(0); opacity: 1; }
    to   { transform: translateY(-20px); opacity: 0; }
}

/* --- Loading Spinner --- */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spinning {
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* --- Hidden utility --- */
.hidden { display: none !important; }

