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

:root {
    --bg: #0d1117;
    --bg-card: #161b22;
    --bg-input: #1c2128;
    --border: #30363d;
    --text: #e6edf3;
    --text-muted: #7d8590;
    --accent: #58a6ff;
    --accent-hover: #79c0ff;
    --tag-bg: #1f2937;
    --tag-text: #9ca3af;
    --tag-system-bg: #1e3a5f;
    --tag-system-text: #58a6ff;
    --danger: #f85149;
    --success: #3fb950;
    --duplicate: #d29922;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

header {
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 10;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

.search-bar {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.search-bar:focus {
    border-color: var(--accent);
}

main {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px 24px;
}

.stash-form {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.stash-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 14px;
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.stash-input:focus {
    border-color: var(--accent);
}

.stash-btn {
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.stash-btn:hover {
    background: var(--accent-hover);
}

.tag-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.items-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.item-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 14px;
    transition: border-color 0.15s;
}

.item-card:hover {
    border-color: var(--text-muted);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.item-type {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
}

.item-date {
    font-size: 12px;
    color: var(--text-muted);
}

.item-body {
    margin-bottom: 6px;
}

.item-summary {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 4px;
}

.item-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 12px;
    background: var(--bg-input);
    padding: 3px 8px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.item-link:hover {
    color: var(--accent);
    background: var(--tag-system-bg);
}

.favicon {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.link-text {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.link-domain {
    color: inherit;
    font-size: 12px;
    flex-shrink: 0;
}

.link-title {
    color: var(--text-muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.7;
}

.duplicate-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: var(--duplicate);
    border: 1px solid var(--duplicate);
    border-radius: 4px;
    padding: 1px 6px;
    margin-left: 8px;
}

.item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tag-chip {
    display: inline-block;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    background: var(--tag-bg);
    color: var(--tag-text);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    user-select: none;
}

.tag-chip:hover {
    background: var(--tag-system-bg);
    color: var(--tag-system-text);
}

.tag-chip.small {
    font-size: 11px;
    padding: 1px 6px;
}

.item-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}

.item-card:hover .item-actions {
    opacity: 1;
}

.action-btn {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    transition: all 0.15s;
}

.done-btn {
    color: var(--success);
    border-color: var(--success);
}

.done-btn:hover {
    background: var(--success);
    color: var(--bg);
}

.delete-btn {
    color: var(--danger);
    border-color: var(--danger);
}

.delete-btn:hover {
    background: var(--danger);
    color: var(--bg);
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 14px;
}
