:root {
  --bg: #f4f1e8; --fg: #1d241f; --muted: #5b6458; --line: #d8d2c2; --field: #fffdf7; --accent: #2f6b4f;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #101712; --fg: #e8eee6; --muted: #9aa597; --line: #2c372f; --field: #18211b; --accent: #7fc4a0; }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font: 16px/1.5 system-ui, sans-serif; }
#bar { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px; border-bottom: 1px solid var(--line); }
#bar button { min-width: 40px; height: 40px; border: 0; border-radius: 8px; background: transparent; color: var(--fg); font-size: 22px; }
#bar button:disabled { opacity: .35; }
#tabs span { display: inline-block; min-width: 24px; padding: 0 4px; border: 2px solid currentColor; border-radius: 6px; font-size: 13px; font-weight: 600; }
#go { flex: 1; min-width: 0; }
#address { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 20px; background: var(--field); color: var(--fg); font-size: 16px; }
#progress { position: absolute; left: 0; bottom: -1px; height: 2px; background: var(--accent); transition: width .2s; }
#area { padding: 16px; }
#start h1 { font-size: 22px; margin: 8px 0; }
#start p { color: var(--muted); margin: 8px 0; }
#note { flex-basis: 100%; margin: 2px 6px 0; font-size: 14px; color: var(--fg); }
.row { display: flex; align-items: center; justify-content: space-between; }
#tablist h2 { font-size: 18px; margin: 0; }
#tablist button, #tab-items button { height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--fg); }
#tab-items { list-style: none; padding: 0; margin: 12px 0; }
#tab-items li { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
#tab-items li.current .title { font-weight: 700; }
#tab-items .open { flex: 1; min-width: 0; text-align: left; border: 0 !important; background: transparent !important; height: auto !important; padding: 0 !important; }
#tab-items .title, #tab-items .url { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#tab-items .url { color: var(--muted); font-size: 13px; }
#private-badge { flex-basis: 100%; margin: 2px 6px 0; font-size: 13px; }
body.private #bar { background: #2b2540; color: #ece8f6; }
body.private #bar button { color: #ece8f6; }
body.private #address { background: #3a3352; color: #ece8f6; border-color: #514870; }
#download, #confirm, #ask { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 6px 2px; }
#download[hidden], #confirm[hidden], #ask[hidden] { display: none; }
#download p, #confirm p, #ask p { flex-basis: 100%; margin: 0; font-size: 14px; overflow-wrap: anywhere; }
#download button, #confirm button, #ask button { height: 36px !important; font-size: 15px !important; padding: 0 14px; border: 1px solid var(--line) !important; border-radius: 8px; background: var(--field) !important; color: var(--fg) !important; }
#star[aria-pressed="true"] { color: var(--accent); }
.actions { display: flex; gap: 8px; }
#listview h2 { font-size: 18px; margin: 0; }
#listview button, #tablist .row button { height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--fg); }
#list-items { list-style: none; padding: 0; margin: 12px 0; }
#list-items li { padding: 8px 0; border-bottom: 1px solid var(--line); }
#list-items .open { width: 100%; text-align: left; border: 0 !important; background: transparent !important; height: auto !important; padding: 0 !important; }
#list-items .title, #list-items .url { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#list-items .url { color: var(--muted); font-size: 13px; }
#tab-items .private-mark { font-size: 12px; color: var(--muted); margin-left: 6px; }
#searchview h2 { font-size: 18px; margin: 0; }
#searchview .hint { color: var(--muted); font-size: 13px; margin: 8px 0; }
#searchview .check { display: flex; gap: 8px; align-items: center; font-size: 15px; }
#searchview button { height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--fg); }
#search-items { list-style: none; padding: 0; margin: 12px 0; }
#search-items li { padding: 10px 0; border-bottom: 1px solid var(--line); }
#search-items .open { width: 100%; text-align: left; border: 0 !important; background: transparent !important; height: auto !important; padding: 0 !important; }
#search-items .title { display: block; font-weight: 600; }
#search-items .url { display: block; color: var(--muted); font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#search-items .summary { display: block; font-size: 14px; margin-top: 2px; }
#search-items .label { font-size: 12px; margin-left: 6px; padding: 0 6px; border-radius: 4px; background: #8a2d2d; color: #fff; }
#list-items .site { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
#list-items .site span { overflow-wrap: anywhere; }
#list-items .site button { height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--fg); }
#contributeview h2 { font-size: 18px; margin: 0; }
#contributeview .hint { color: var(--muted); font-size: 13px; margin: 8px 0; }
#contributeview .check { display: flex; gap: 8px; align-items: center; font-size: 15px; }
#contributeview button { height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--fg); }
#contributeview button:disabled { opacity: .5; }
#contribute-items { list-style: none; padding: 0; margin: 12px 0; }
#contribute-items li { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
#contribute-items .what { min-width: 0; }
#contribute-items .what span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#contribute-items .what .meta { color: var(--muted); font-size: 12px; }
