:root {
    --bg: #f7f8fa;
    --surface: #ffffff;
    --text: #1a1d26;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-soft: #eef2ff;
    --danger: #dc2626;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
    --font: 'Inter', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 3.5rem;
}

.logo {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav__link {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.375rem 0.625rem;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.nav__link:hover {
    color: var(--text);
    background: var(--bg);
}

.main {
    flex: 1;
    padding: 2.5rem 0 3rem;
}

.footer {
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.hero {
    text-align: center;
    margin-bottom: 2rem;
}

.hero--compact {
    margin-bottom: 1.5rem;
}

.hero__title {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    margin: 0 0 0.5rem;
}

.hero__subtitle {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.9375rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.card--center {
    text-align: center;
    padding: 2.5rem 1.5rem;
}

.card__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1.25rem;
    letter-spacing: -0.02em;
}

.tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--bg);
    padding: 0.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.tabs__btn {
    flex: 1;
    padding: 0.5rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.tabs__btn.is-active {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.tab-panel {
    display: none;
}

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

.input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9375rem;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.input--textarea {
    resize: vertical;
    min-height: 160px;
    line-height: 1.6;
}

.input--select {
    cursor: pointer;
}

.label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
    color: var(--text);
}

.form-row {
    margin-bottom: 1rem;
}

.hint {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0.375rem 0 0;
}

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2.5rem 1rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    text-align: center;
}

.dropzone:hover,
.dropzone.is-dragover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.dropzone__icon {
    font-size: 1.5rem;
    color: var(--accent);
}

.dropzone__text {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.dropzone__hint {
    font-size: 0.8125rem;
    color: var(--text);
    font-weight: 500;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}

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

.btn--primary {
    width: 100%;
    background: var(--accent);
    color: #fff;
}

.btn--primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

.btn--ghost {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    white-space: nowrap;
}

.btn--ghost:hover {
    background: var(--border);
}

.btn--danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid transparent;
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
}

.btn--danger:hover {
    background: #fef2f2;
}

.result {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.result__label {
    font-size: 0.8125rem;
    font-weight: 500;
    margin: 0 0 0.5rem;
    color: var(--text-muted);
}

.result__row {
    display: flex;
    gap: 0.5rem;
}

.result__url {
    flex: 1;
    font-size: 0.8125rem;
}

.auth-card {
    max-width: 400px;
    margin: 0 auto;
}

.auth-form .btn {
    margin-top: 0.5rem;
}

.auth-switch {
    text-align: center;
    margin: 1.25rem 0 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.auth-switch a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.clip-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.clip-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.15s;
}

.clip-item:hover {
    border-color: #d1d5db;
}

.clip-item__icon {
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 8px;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.clip-item__body {
    flex: 1;
    min-width: 0;
}

.clip-item__title {
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clip-item__meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0.125rem 0 0;
}

.clip-item__actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge--active {
    background: #ecfdf5;
    color: #059669;
}

.badge--expired {
    background: #fef2f2;
    color: var(--danger);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9375rem;
    margin: 0 0 1rem;
}

.empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.clip-content {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0;
    padding: 1rem;
    background: var(--bg);
    border-radius: 8px;
    max-height: 70vh;
    overflow: auto;
}

.clip-file__meta {
    margin: 0 0 1.25rem;
}

.clip-file__row {
    display: flex;
    gap: 0.75rem;
    font-size: 0.875rem;
    padding: 0.375rem 0;
}

.clip-file__row dt {
    color: var(--text-muted);
    min-width: 5rem;
}

.clip-file__row dd {
    margin: 0;
    font-weight: 500;
}

.clip-file__preview {
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg);
}

.clip-file__preview img {
    display: block;
    max-width: 100%;
    max-height: 60vh;
    margin: 0 auto;
}

.clip-file__download {
    width: auto;
    display: inline-flex;
}

.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: #fff;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    z-index: 100;
    animation: toast-in 0.2s ease;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(0.5rem); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

body.is-authenticated .nav__link--guest {
    display: none;
}

body:not(.is-authenticated) .nav__link--auth {
    display: none;
}

@media (max-width: 480px) {
    .hero__title {
        font-size: 1.5rem;
    }

    .result__row {
        flex-direction: column;
    }

    .clip-item {
        flex-wrap: wrap;
    }

    .clip-item__actions {
        width: 100%;
        justify-content: flex-end;
    }
}
