:root {
    color-scheme: dark;
    --tc-bg: #07131c;
    --tc-bg-2: #0c1b27;
    --tc-surface: rgba(10, 25, 36, 0.88);
    --tc-surface-2: rgba(16, 35, 49, 0.94);
    --tc-line: rgba(132, 177, 205, 0.18);
    --tc-line-strong: rgba(132, 177, 205, 0.34);
    --tc-text: #edf6fb;
    --tc-muted: #95a8b7;
    --tc-brand: #67f6d5;
    --tc-brand-2: #2db0ff;
    --tc-warm: #ffc982;
    --tc-danger: #ff8e8e;
    --tc-success: #7ce4b6;
    --tc-shadow: 0 24px 80px rgba(1, 11, 19, 0.42);
    --tc-radius: 24px;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body.tapcount-body {
    font-family: "IBM Plex Sans", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(103, 246, 213, 0.14), transparent 28%),
        radial-gradient(circle at top right, rgba(45, 176, 255, 0.18), transparent 30%),
        linear-gradient(180deg, #061018 0%, #091722 52%, #050e16 100%);
    color: var(--tc-text);
}

body.tc-feedback-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.tc-app-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 20px 0 32px;
}

.tc-topbar,
.tc-panel,
.tc-banner,
.tc-status {
    backdrop-filter: blur(18px);
}

.tc-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding: 14px 18px;
    border: 1px solid var(--tc-line);
    border-radius: 22px;
    background: rgba(6, 16, 24, 0.76);
    box-shadow: var(--tc-shadow);
}

.tc-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.tc-brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--tc-brand), var(--tc-brand-2));
    color: #031116;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.tc-brand-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tc-brand-copy strong,
.tc-panel h1,
.tc-panel h2,
.tc-counter-title {
    font-family: "Space Grotesk", sans-serif;
}

.tc-brand-copy span:last-child,
.tc-nav a,
.tc-inline-note,
.tc-counter-meta,
.tc-metric-label {
    color: var(--tc-muted);
}

.tc-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tc-nav a {
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.tc-nav a:hover,
.tc-nav a:focus-visible {
    border-color: var(--tc-line-strong);
    background: rgba(255, 255, 255, 0.04);
    color: var(--tc-text);
}

.tc-main {
    display: grid;
    gap: 18px;
}

.tc-layout {
    display: grid;
    gap: 18px;
}

.tc-sidebar {
    display: grid;
    gap: 18px;
}

.tc-panel {
    padding: 22px;
    border: 1px solid var(--tc-line);
    border-radius: var(--tc-radius);
    background: linear-gradient(180deg, rgba(9, 21, 31, 0.92), rgba(9, 19, 28, 0.82));
    box-shadow: var(--tc-shadow);
}

.tc-feedback-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 80;
}

.tc-feedback-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(3, 10, 16, 0.74);
    backdrop-filter: blur(10px);
}

.tc-feedback-modal {
    width: min(720px, 100%);
    display: grid;
    gap: 16px;
}

.tc-feedback-head {
    align-items: flex-start;
}

.tc-feedback-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.tc-feedback-form label {
    display: grid;
    gap: 8px;
}

.tc-feedback-form label span {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--tc-brand);
}

.tc-feedback-form input,
.tc-feedback-form select,
.tc-feedback-form textarea {
    width: 100%;
    min-height: 50px;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    border: 1px solid var(--tc-line);
    background: rgba(5, 13, 20, 0.92);
    color: var(--tc-text);
}

.tc-feedback-form textarea {
    min-height: 180px;
    resize: vertical;
}

.tc-feedback-message,
.tc-feedback-error,
.tc-feedback-actions {
    grid-column: 1 / -1;
}

.tc-feedback-upload {
    grid-column: 1 / -1;
}

.tc-feedback-upload small {
    color: #b8cddd;
    font-size: 0.82rem;
}

.tc-feedback-error {
    min-height: 1.2rem;
    color: var(--tc-danger);
}

.tc-feedback-actions {
    display: flex;
    justify-content: flex-end;
}

.tc-hero-panel {
    display: grid;
    gap: 20px;
}

.tc-hero-panel h1,
.tc-share-panel h1 {
    margin: 8px 0 12px;
    font-size: clamp(2rem, 6vw, 4rem);
    line-height: 0.96;
}

.tc-hero-panel p,
.tc-share-panel p {
    margin: 0;
    max-width: 62ch;
    color: #bdd0dd;
    font-size: 1.02rem;
    line-height: 1.7;
}

.tc-eyebrow,
.tc-section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--tc-brand);
}

.tc-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.tc-tag-row span,
.tc-visibility-badge,
.tc-metric-card strong {
    border-radius: 999px;
}

.tc-tag-row span {
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--tc-line);
    color: #d8e7ef;
    font-size: 0.92rem;
}

.tc-hero-metrics {
    display: grid;
    gap: 12px;
}

.tc-metric-card {
    padding: 16px;
    border-radius: 20px;
    border: 1px solid var(--tc-line);
    background: rgba(255, 255, 255, 0.03);
}

.tc-metric-card strong {
    display: inline-flex;
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(103, 246, 213, 0.12);
    color: var(--tc-brand);
}

.tc-status,
.tc-banner {
    display: grid;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--tc-line-strong);
}

.tc-status {
    background: rgba(8, 34, 43, 0.84);
}

.tc-status.is-error {
    border-color: rgba(255, 142, 142, 0.42);
    background: rgba(48, 18, 24, 0.86);
}

.tc-status.is-success {
    border-color: rgba(124, 228, 182, 0.42);
    background: rgba(12, 38, 31, 0.86);
}

.tc-banner {
    margin-bottom: 18px;
    background: rgba(255, 255, 255, 0.03);
}

.tc-banner p,
.tc-banner strong,
.tc-empty-state p,
.tc-empty-state strong {
    margin: 0;
}

.tc-banner-alt {
    background: rgba(45, 176, 255, 0.08);
}

.tc-inline-actions,
.tc-form-actions,
.tc-panel-head,
.tc-account-actions,
.tc-tab-row,
.tc-counter-toolbar,
.tc-counter-stepper {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tc-panel-head {
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.tc-panel-head h2 {
    margin: 4px 0 0;
    font-size: 1.35rem;
}

.tc-form,
.tc-account-card {
    display: grid;
    gap: 16px;
}

.tc-field-grid {
    display: grid;
    gap: 14px;
}

.tc-form label,
.tc-panel label {
    display: grid;
    gap: 8px;
    color: var(--tc-muted);
    font-size: 0.95rem;
}

.tc-form input,
.tc-panel input,
.tc-panel select,
.tc-panel textarea {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid var(--tc-line);
    border-radius: 16px;
    background: rgba(5, 17, 25, 0.9);
    color: var(--tc-text);
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.tc-form input:focus,
.tc-panel input:focus,
.tc-panel select:focus,
.tc-panel textarea:focus {
    border-color: rgba(103, 246, 213, 0.54);
    box-shadow: 0 0 0 4px rgba(103, 246, 213, 0.12);
}

.tc-checkbox {
    grid-template-columns: auto 1fr;
    align-items: start;
    column-gap: 12px;
}

.tc-checkbox input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.tc-checkbox small {
    grid-column: 2;
    color: var(--tc-muted);
}

.tc-btn {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--tc-text);
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.tc-btn:hover,
.tc-btn:focus-visible {
    transform: translateY(-1px);
    border-color: var(--tc-line-strong);
}

.tc-btn-primary {
    background: linear-gradient(135deg, var(--tc-brand), var(--tc-brand-2));
    color: #041017;
    font-weight: 700;
}

.tc-btn-subtle {
    background: rgba(255, 255, 255, 0.04);
}

.tc-full-width {
    width: 100%;
    justify-content: center;
    text-align: center;
}

.tc-empty-state {
    display: grid;
    gap: 8px;
    padding: 18px;
    border-radius: 18px;
    border: 1px dashed var(--tc-line-strong);
    background: rgba(255, 255, 255, 0.02);
}

.tc-counter-list {
    list-style: none;
    padding: 0;
    margin: 18px 0 0;
    display: grid;
    gap: 14px;
}

.tc-counter-card {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid var(--tc-line);
    background: rgba(255, 255, 255, 0.03);
}

.tc-counter-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.tc-counter-title-wrap {
    display: flex;
    align-items: start;
    gap: 14px;
    min-width: 0;
}

.tc-counter-emoji {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: rgba(103, 246, 213, 0.12);
    font-size: 1.4rem;
}

.tc-counter-title {
    margin: 0 0 4px;
    font-size: 1.2rem;
}

.tc-counter-meta {
    margin: 0;
    line-height: 1.6;
}

.tc-visibility-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid var(--tc-line);
    color: var(--tc-muted);
    font-size: 0.9rem;
}

.tc-visibility-badge.is-public {
    color: var(--tc-brand);
    border-color: rgba(103, 246, 213, 0.34);
}

.tc-counter-toolbar {
    align-items: center;
    justify-content: space-between;
}

.tc-counter-value {
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(2rem, 8vw, 3.1rem);
    line-height: 1;
}

.tc-counter-stepper .tc-btn {
    min-width: 72px;
}

.tc-manual-form {
    display: grid;
    gap: 10px;
}

.tc-manual-row {
    display: grid;
    gap: 10px;
}

.tc-share-link {
    word-break: break-all;
    color: var(--tc-brand);
    font-size: 0.92rem;
}

.tc-note-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 18px;
    color: #c5d6df;
}

.tc-account-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(103, 246, 213, 0.12);
    color: var(--tc-brand);
}

.tc-account-pill.is-guest {
    background: rgba(255, 201, 130, 0.12);
    color: var(--tc-warm);
}

.tc-inline-note {
    color: var(--tc-muted);
    line-height: 1.65;
}

.tc-tab-button {
    flex: 1 1 0;
    border: 1px solid var(--tc-line);
    border-radius: 16px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--tc-muted);
    cursor: pointer;
}

.tc-tab-button.is-active {
    border-color: rgba(103, 246, 213, 0.4);
    background: rgba(103, 246, 213, 0.1);
    color: var(--tc-text);
}

.tc-auth-main,
.tc-auth-layout {
    gap: 18px;
}

.tc-stack {
    display: grid;
    gap: 18px;
}

.tc-list-grid {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.tc-list-card {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid var(--tc-line);
    background: rgba(255, 255, 255, 0.03);
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.tc-list-card:hover {
    border-color: var(--tc-line-strong);
    transform: translateY(-1px);
}

.tc-list-card.is-active {
    border-color: rgba(103, 246, 213, 0.34);
    background: rgba(103, 246, 213, 0.08);
}

.tc-list-summary {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--tc-muted);
    font-size: 0.92rem;
}

.tc-selected-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.tc-selected-header h2 {
    margin: 6px 0 10px;
    font-size: 1.55rem;
}

.tc-workspace-panel {
    min-height: 280px;
}

.tc-share-panel {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}

.tc-share-value {
    margin: 22px 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(4rem, 20vw, 8rem);
    line-height: 1;
    color: var(--tc-brand);
}

.tc-footer {
    padding: 22px 4px 4px;
    text-align: center;
    color: var(--tc-muted);
    font-size: 0.9rem;
}

@media (min-width: 900px) {
    .tc-layout {
        grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.8fr);
        align-items: start;
    }

    .tc-field-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tc-hero-panel {
        grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
        align-items: end;
    }

    .tc-list-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tc-manual-row {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }
}

@media (max-width: 680px) {
    .tc-app-shell {
        width: min(100% - 22px, 1180px);
        padding-top: 12px;
    }

    .tc-topbar,
    .tc-panel {
        padding: 18px;
        border-radius: 20px;
    }

    .tc-counter-toolbar {
        align-items: start;
        flex-direction: column;
    }

    .tc-selected-header {
        flex-direction: column;
    }

    .tc-counter-stepper {
        width: 100%;
    }

    .tc-counter-stepper .tc-btn {
        flex: 1 1 0;
    }

    .tc-form-actions .tc-btn,
    .tc-inline-actions .tc-btn,
    .tc-share-actions .tc-btn {
        flex: 1 1 100%;
        text-align: center;
        justify-content: center;
    }
}
