/* ============================================================
   openly - "Warm Ink" editorial aesthetic
   Dark charcoal · amber accents · Georgia serif · grain overlay
   ============================================================ */

/* ---------- Reset & Variables ---------- */

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

:root {
    --bg-deep:       #0e0d0b;
    --bg-primary:    #141310;
    --bg-secondary:  #1c1a17;
    --bg-tertiary:   #252320;
    --bg-elevated:   #2e2b27;
    --bg-hover:      #38352f;

    --border:        rgba(200, 170, 100, 0.10);
    --border-strong: rgba(200, 170, 100, 0.22);

    --text-primary:  #ede8df;
    --text-secondary:#9c9589;
    --text-tertiary: #6b6560;
    --text-muted:    #4d4945;

    --accent:        #c8953c;
    --accent-hover:  #daa54e;
    --accent-glow:   rgba(200, 149, 60, 0.15);
    --accent-subtle: rgba(200, 149, 60, 0.07);

    --success:       #7a9e5a;
    --error:         #c94a3a;
    --error-bg:      rgba(201, 74, 58, 0.10);
    --link:          #8baed4;

    --radius-sm:     6px;
    --radius:        10px;
    --radius-lg:     16px;

    --font-serif:    Georgia, Cambria, "Times New Roman", serif;
    --font-sans:     "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
    --font-mono:     "Cascadia Code", "Fira Code", Consolas, "Courier New", monospace;

    --ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--link);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: var(--accent-hover);
}

/* ---------- Grain Overlay ---------- */

.grain-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.035;
    mix-blend-mode: overlay;
}

.grain-overlay::before {
    content: '';
    position: absolute;
    inset: -200%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 256px 256px;
    animation: grain 8s steps(10) infinite;
}

@keyframes grain {
    0%, 100% { transform: translate(0,0) }
    10% { transform: translate(-5%,-10%) }
    20% { transform: translate(-15%,5%) }
    30% { transform: translate(7%,-25%) }
    40% { transform: translate(-5%,25%) }
    50% { transform: translate(-15%,10%) }
    60% { transform: translate(15%,0%) }
    70% { transform: translate(0%,15%) }
    80% { transform: translate(3%,35%) }
    90% { transform: translate(-10%,10%) }
}

/* ---------- Screen Reader Only ---------- */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* ---------- Typography ---------- */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 400;
    line-height: 1.2;
}

/* ---------- Logo ---------- */

.logo {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    text-decoration: none;
    transition: color 0.3s;
}
.logo:hover {
    color: var(--accent);
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.65em 1.4em;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.btn .arrow {
    display: inline-block;
    transition: transform 0.25s var(--ease-out);
}
.btn:hover .arrow {
    transform: translateX(3px);
}

.btn-primary {
    background: var(--accent);
    color: #0e0d0b;
    border-color: var(--accent);
}
.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #0e0d0b;
    box-shadow: 0 0 24px var(--accent-glow);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-strong);
}
.btn-ghost:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    background: var(--accent-subtle);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-strong);
}
.btn-outline:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.btn-danger {
    background: transparent;
    color: var(--error);
    border-color: rgba(201, 74, 58, 0.3);
}
.btn-danger:hover {
    background: var(--error-bg);
    border-color: var(--error);
}

.btn-small {
    padding: 0.35em 0.85em;
    font-size: 0.8rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn-copy {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border-strong);
}
.btn-copy:hover {
    background: var(--accent);
    color: #0e0d0b;
    border-color: var(--accent);
}
.btn-copy.copied {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

/* ---------- Form Elements ---------- */

input[type="text"],
input[type="url"],
input[type="password"],
input[type="search"] {
    width: 100%;
    padding: 0.7em 1em;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
}

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

input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

label {
    display: block;
    margin-bottom: 0.5em;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* ---------- Alerts ---------- */

.alert {
    padding: 0.75em 1em;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 1.25em;
}

.alert-error {
    background: var(--error-bg);
    border: 1px solid rgba(201,74,58,0.25);
    color: #e8b4ae;
}

/* ---------- Toast Notifications ---------- */

#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 10000;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
}

.toast {
    padding: 0.75em 1.25em;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-primary);
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    animation: toastIn 0.4s var(--ease-out) forwards;
    max-width: 360px;
}

.toast.toast-success {
    border-color: var(--success);
}
.toast.toast-error {
    border-color: var(--error);
}

.toast.toast-out {
    animation: toastOut 0.3s var(--ease-out) forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(12px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(12px) scale(0.95); }
}

/* ---------- Spinner ---------- */

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(14,13,11,0.3);
    border-top-color: #0e0d0b;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.hidden { display: none !important; }

/* ============================================================
   LANDING PAGE
   ============================================================ */

.landing {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2.5rem;
    border-bottom: 1px solid var(--border);
}

.nav-link {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.nav-link:hover {
    color: var(--accent);
}

/* Hero */

.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem 3rem;
    max-width: 720px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-subtle);
    border: 1px solid rgba(200,149,60,0.2);
    border-radius: 100px;
    padding: 0.4em 1.2em;
    margin-bottom: 2.5rem;
    animation: fadeUp 0.8s var(--ease-out) both;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(2.8rem, 7vw, 5rem);
    font-weight: 400;
    line-height: 1.08;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
    animation: fadeUp 0.8s 0.1s var(--ease-out) both;
}

.hero-accent {
    color: var(--accent);
    font-style: italic;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 480px;
    line-height: 1.7;
    margin-bottom: 2.5rem;
    animation: fadeUp 0.8s 0.2s var(--ease-out) both;
}

.hero-cta {
    animation: fadeUp 0.8s 0.3s var(--ease-out) both;
}

/* Features */

.features-wrapper {
    padding: 4rem 2rem;
    border-top: 1px solid var(--border);
}

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    max-width: 960px;
    margin: 0 auto;
}

.feature {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.25rem 2rem;
    transition: border-color 0.3s, background 0.3s, transform 0.3s, box-shadow 0.3s;
}
.feature:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.feature-icon {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    display: inline-block;
}

.feature-title {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    color: var(--text-primary);
    margin-bottom: 0.6rem;
}

.feature-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* Footer */

.landing-footer {
    padding: 2rem 2.5rem;
    text-align: center;
}

.footer-line {
    width: 40px;
    height: 1px;
    background: var(--border-strong);
    margin: 0 auto 1.25rem;
}

.landing-footer p {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    letter-spacing: 0.06em;
}

.footer-sub {
    margin-top: 0.5rem;
    font-size: 0.75rem !important;
}

.footer-link {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.25s;
}

.footer-link:hover {
    border-bottom-color: var(--accent);
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(200,149,60,0.06) 0%, transparent 60%),
        var(--bg-deep);
}

.login-container {
    width: 100%;
    max-width: 380px;
    text-align: center;
}

.login-logo {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.75rem;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.login-form {
    text-align: left;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.login-back {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}
.login-back:hover {
    color: var(--text-secondary);
}

/* ============================================================
   DASHBOARD
   ============================================================ */

.dashboard {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.dash-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

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

.nav-badge {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-subtle);
    border: 1px solid rgba(200,149,60,0.18);
    border-radius: 100px;
    padding: 0.25em 0.75em;
}

.logout-form {
    display: inline;
}

/* Dashboard Main */

.dash-main {
    flex: 1;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 2rem 4rem;
}

/* Stats Row */

.stats-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.stat-card:hover {
    border-color: var(--border-strong);
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

.stat-number {
    display: block;
    font-family: var(--font-serif);
    font-size: 2.75rem;
    line-height: 1;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    letter-spacing: -0.03em;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

/* Section Title */

.section-title {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

/* Create URL Section */

.create-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    margin-bottom: 2.5rem;
}

.create-form-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group-grow {
    flex: 1;
}

.create-result {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--accent-subtle);
    border: 1px solid rgba(200,149,60,0.2);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: fadeUp 0.4s var(--ease-out);
}

.result-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.result-link {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.result-link:hover {
    color: var(--accent-hover);
}

/* URLs Section */

.urls-section {
    margin-bottom: 2rem;
}

.urls-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.search-box input {
    width: 220px;
    padding: 0.5em 0.85em;
    font-size: 0.85rem;
}

/* URL Card */

.urls-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.url-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.25s, box-shadow 0.25s;
}
.url-card:hover {
    border-color: var(--border-strong);
}

.url-card-main {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
}

.url-info {
    min-width: 0;
}

.url-short {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--accent);
    font-weight: 500;
}
.url-short:hover {
    color: var(--accent-hover);
}

.url-original {
    font-size: 0.82rem;
    color: var(--text-tertiary);
    margin-top: 0.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.url-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
    white-space: nowrap;
}

.url-clicks {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.clicks-count {
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.url-date {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.url-actions {
    display: flex;
    gap: 0.4rem;
}

/* Stats Panel */

.url-stats-panel {
    border-top: 1px solid var(--border);
    padding: 1.25rem;
    background: var(--bg-tertiary);
    animation: slideDown 0.35s var(--ease-out);
}

@keyframes slideDown {
    from { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; }
    to   { opacity: 1; max-height: 600px; }
}

.stats-loading {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    font-style: italic;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.stats-empty {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    font-style: italic;
}

.click-row {
    display: grid;
    grid-template-columns: 180px 1fr 140px;
    gap: 0.75rem;
    font-size: 0.8rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}
.click-row:last-child {
    border-bottom: none;
}

.click-time {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

.click-referrer {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.click-ip {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    text-align: right;
}

.stats-header-row {
    display: grid;
    grid-template-columns: 180px 1fr 140px;
    gap: 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-strong);
    margin-bottom: 0.25rem;
}

/* Empty State */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

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

.empty-state h3 {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ============================================================
   MODALS
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 1rem;
    animation: modalFadeIn 0.2s var(--ease-out);
}

.modal-overlay.hidden {
    display: none !important;
}

.modal-dialog {
    background: var(--bg-secondary);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    animation: modalSlideUp 0.3s var(--ease-out);
}

.modal-title {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.modal-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.anim-fade-up {
    animation: fadeUp 0.6s var(--ease-out) both;
}

.anim-stagger {
    animation: fadeUp 0.6s var(--ease-out) both;
    animation-delay: calc(0.08s * var(--i, 0));
}

/* ============================================================
   SCROLLBAR
   ============================================================ */

::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

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

@media (max-width: 768px) {
    .features {
        grid-template-columns: 1fr;
        max-width: 420px;
    }

    .features-wrapper {
        padding: 2.5rem 1.25rem;
    }

    .feature {
        padding: 1.75rem 1.5rem;
    }

    .landing-nav {
        padding: 1.25rem 1.25rem;
    }

    .hero {
        padding: 2.5rem 1.25rem 2rem;
    }

    .hero-badge {
        margin-bottom: 1.75rem;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .dash-nav {
        padding: 0.85rem 1rem;
    }

    .dash-main {
        padding: 1.25rem 0.85rem 3rem;
    }

    .stats-row {
        gap: 0.65rem;
    }

    .stat-card {
        padding: 1.15rem;
    }

    .stat-number {
        font-size: 1.85rem;
    }

    .stat-label {
        font-size: 0.72rem;
    }

    .create-section {
        padding: 1.25rem;
        margin-bottom: 1.75rem;
    }

    .create-form-row {
        flex-direction: column;
        align-items: stretch;
    }

    .create-form-row .btn {
        width: 100%;
    }

    .section-title {
        font-size: 1.15rem;
    }

    .url-card-main {
        grid-template-columns: 1fr;
        gap: 0.6rem;
        padding: 0.85rem 1rem;
    }

    .url-meta {
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
    }

    .url-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .url-actions .btn-small {
        padding: 0.3em 0.7em;
        font-size: 0.75rem;
    }

    .click-row,
    .stats-header-row {
        grid-template-columns: 1fr 1fr;
    }

    .click-referrer {
        display: none;
    }

    .search-box input {
        width: 150px;
    }

    .nav-badge {
        font-size: 0.6rem;
        padding: 0.2em 0.55em;
    }

    .btn-ghost {
        padding: 0.5em 0.9em;
        font-size: 0.82rem;
    }

    .modal-dialog {
        padding: 1.5rem;
    }

    .url-stats-panel {
        padding: 1rem;
    }

    #toast-container {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }

    .toast {
        max-width: none;
    }
}

@media (max-width: 480px) {
    .stats-row {
        grid-template-columns: 1fr;
    }

    .urls-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .search-box {
        width: 100%;
    }

    .search-box input {
        width: 100%;
    }

    .hero-title {
        font-size: 1.9rem;
    }

    .hero-subtitle {
        font-size: 0.92rem;
    }

    .logo {
        font-size: 1.25rem;
    }
}
