* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* Chrome sizes the popup from the root element, so the width goes on <html>. */
html, body { width: 340px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 13px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: default; }

.ph { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.ph b { font-size: 14px; flex: 1; }
.logo { width: 22px; height: 22px; }
.gear { color: var(--muted); font-size: 15px; width: 22px; height: 22px; border-radius: 6px; }
.gear:hover { background: var(--soft); }
.gear-spacer { width: 22px; }
.pb { padding: 12px 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }

.page { display: flex; gap: 10px; align-items: center; background: var(--soft); border: 1px solid var(--soft-line); border-radius: 10px; padding: 8px 10px; }
.fav { width: 20px; height: 20px; border-radius: 5px; flex: none; display: grid; place-items: center; background: var(--accent-strong); color: #fff; font-size: 11px; font-weight: 700; overflow: hidden; }
.fav img { width: 20px; height: 20px; }
.grow { flex: 1; min-width: 0; }
.pt { font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ps { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px dashed var(--muted); border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.chip:disabled { opacity: 0.45; }
.chip:not(:disabled):hover { border-color: var(--accent); }
.chip.on { border-style: solid; border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }

.note-input, .edit input { width: 100%; border: 1px solid var(--card-line); border-radius: 8px; padding: 7px 10px; background: var(--card); color: var(--fg); font: inherit; }
.note-input:focus, .edit input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.item .nl { font-size: 11.5px; color: var(--fg); opacity: 0.8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt { font-size: 12px; background: var(--soft); border-radius: 6px; padding: 4px 7px; margin-top: 4px; overflow-wrap: anywhere; }
.edit { display: grid; gap: 6px; margin-top: 6px; }
.edit .acts { margin-top: 0; }

.sh { display: flex; justify-content: space-between; align-items: baseline; }
.sec { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; }
.link { color: var(--accent-text); font-size: 12px; font-weight: 600; }
.link:hover { text-decoration: underline; }

.qg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.qc { position: relative; border: 1px solid var(--card-line); border-radius: 8px; padding: 9px 6px; text-align: center; background: var(--card); font-weight: 500; min-height: 40px; }
.qc:hover { border-color: var(--accent); }
.qc small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; }
.qc.on { background: var(--accent-soft); border-color: var(--accent); }
.qc .k { position: absolute; top: 4px; left: 5px; font-size: 10px; line-height: 14px; color: var(--muted); border: 1px solid var(--key-line); border-radius: 4px; padding: 0 4px; background: var(--key-bg); font-weight: 600; }

.menu { border: 1px solid var(--key-line); border-radius: 10px; overflow: hidden; background: var(--card); box-shadow: 0 6px 18px var(--shadow); }
.menu button { display: flex; width: 100%; justify-content: space-between; gap: 8px; padding: 7px 12px; border-top: 1px solid var(--row-line); text-align: left; }
.menu button:first-child { border-top: 0; }
.menu button:hover { background: var(--accent-soft); }
.menu .mt { color: var(--muted); }

#custom-panel { display: grid; gap: 10px; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; font-size: 11px; }
.days button { border-radius: 8px; padding: 5px 0; background: var(--soft); color: var(--muted); }
.days button b { display: block; font-size: 13px; color: var(--fg); }
.days button.on { background: var(--accent-soft); outline: 1.5px solid var(--accent); }
.time { display: flex; align-items: center; gap: 8px; }
.tv { background: var(--soft); border-radius: 8px; padding: 6px 10px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 82px; text-align: center; }
.time input { flex: 1; accent-color: var(--accent); }
.cta { background: var(--accent-strong); color: #fff; text-align: center; border-radius: 10px; padding: 10px; font-weight: 600; }
.cta:disabled { opacity: 0.5; }

#reminder-status { font-size: 12px; color: var(--accent-text); min-height: 0; }
#reminder-status:empty { display: none; }
#reminder-status.error { color: var(--due); }

.item { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--row-line); cursor: pointer; }
.item:first-child { border-top: 0; }
.item:hover .pt { color: var(--accent-text); }
.item .pt { white-space: nowrap; display: block; font-weight: 500; }
.when { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.due { color: var(--due); font-weight: 600; }
.rp { color: var(--faint); font-size: 14px; width: 20px; height: 20px; border-radius: 5px; flex: none; }
.rp.on { color: var(--accent-text); }
.rp:hover { color: var(--accent-text); background: var(--soft); }
.repeat-menu { width: 170px; margin-left: auto; }
.chips + .repeat-menu { margin-left: 0; }
.x { color: var(--muted); font-size: 15px; width: 20px; height: 20px; border-radius: 5px; flex: none; }
.x:hover { color: var(--due); background: var(--soft); }
.empty { color: var(--muted); font-size: 12px; padding: 4px 0; }

.sets { gap: 0; }
.set { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--row-line); }
.set:first-child { border-top: 0; }
.foot { display: flex; width: 100%; justify-content: space-between; border-top: 1px solid var(--line); padding: 10px 14px; color: var(--accent-text); font-weight: 600; }
.foot:hover { background: var(--soft); }

.filter { width: 100%; border: 1px solid var(--card-line); border-radius: 8px; padding: 7px 10px; background: var(--card); color: var(--fg); font: inherit; }
.filter:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.thumb { width: 72px; height: 46px; border-radius: 5px; flex: none; border: 1px solid var(--card-line); background: var(--soft) center / cover no-repeat; }
button.thumb:hover { outline: 2px solid var(--accent); outline-offset: 1px; }
.thumb.none { opacity: 0.5; }
.thumb.sm { width: 36px; height: 24px; border-radius: 4px; }
.chk { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.ritem { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--row-line); }
.ritem:first-child { border-top: 0; }
.ritem .pt { white-space: nowrap; display: block; }
.acts { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; margin-top: 4px; }
.acts button { white-space: nowrap; }
.acts button { color: var(--accent-text); font-weight: 500; }
.acts button:hover { text-decoration: underline; }
.acts .del { color: var(--due); }
