* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; background: #f4f6f9; color: #1f2933; line-height: 1.45; }
main { max-width: 900px; margin: 0 auto; padding: 16px; }
h1 { margin: 0 0 4px; font-size: 1.6rem; }
h2 { margin: 0 0 12px; font-size: 1.15rem; }
.top { display: flex; gap: 12px; align-items: center; padding: 12px 20px; background: #fff; border-bottom: 1px solid #dde3ea; }
.top .muted { margin-left: auto; }
.card { background: #fff; border: 1px solid #dde3ea; border-radius: 10px; padding: 18px 20px; margin-bottom: 16px; }
.narrow { max-width: 380px; margin: 12vh auto; }
.muted { color: #62707d; }
.small { font-size: 0.88rem; }
.error { color: #b42318; min-height: 1.2em; }
.warning { background: #fff4e5; border: 1px solid #f5c26b; padding: 10px 14px; border-radius: 8px; }
label { display: block; margin-bottom: 12px; }
label.inline { display: inline-block; margin-right: 12px; }
input, select { font: inherit; padding: 8px 10px; border: 1px solid #c2ccd6; border-radius: 6px; }
.login input { display: block; width: 100%; margin-top: 4px; }
#search { width: 100%; margin-bottom: 12px; }
button, .button { font: inherit; display: inline-block; padding: 9px 16px; border-radius: 6px; border: 1px solid #1d5fa8; background: #1d5fa8; color: #fff; cursor: pointer; text-decoration: none; }
button:disabled { opacity: 0.45; cursor: default; }
button.secondary, .button.secondary { background: #fff; color: #1d5fa8; }
button.link { background: none; border: none; color: #1d5fa8; padding: 0; text-decoration: underline; }
button.danger { color: #b42318; }
.video-list { display: grid; gap: 8px; max-height: 420px; overflow-y: auto; }
.video { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid #dde3ea; border-radius: 8px; margin: 0; cursor: pointer; }
.video.picked { border-color: #1d5fa8; background: #eef5fd; }
.video.full { opacity: 0.5; cursor: default; }
.video input { margin-top: 4px; }
.top a { color: #1d5fa8; }
.category-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 14px; }
.category { width: 152px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px 8px; background: #fff; color: #1f2933; border: 2px solid #dde3ea; border-radius: 12px; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.category:hover { border-color: #9dbbe0; box-shadow: 0 2px 8px rgba(29, 95, 168, 0.12); transform: translateY(-1px); }
.category.selected { border-color: #1d5fa8; background: #eef5fd; box-shadow: 0 0 0 2px #1d5fa8 inset; }
.category img { width: 64px; height: 64px; }
.category-name { font-weight: 600; text-align: center; font-size: 0.95rem; line-height: 1.25; }
@media (max-width: 640px) { .category { width: calc(50% - 5px); } }
.list-heading { display: flex; gap: 12px; align-items: baseline; margin: 2px 0 10px; }
.chosen { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 14px; }
.chip { background: #eef5fd; border: 1px solid #9dbbe0; border-radius: 16px; padding: 3px 6px 3px 12px; font-size: 0.92rem; }
.chip button { text-decoration: none; margin-left: 4px; color: #62707d; }
.tag { white-space: nowrap; display: inline-block; margin: 2px 0; }
.tag { font-size: 0.75rem; background: #e6ebf1; border-radius: 10px; padding: 1px 8px; color: #44515e; }
.result { display: flex; gap: 20px; align-items: flex-start; margin-top: 16px; padding-top: 16px; border-top: 1px solid #dde3ea; flex-wrap: wrap; }
.result img { width: 180px; height: 180px; border: 1px solid #dde3ea; }
.result > div { flex: 1; min-width: 260px; }
.url { font-family: ui-monospace, Consolas, monospace; word-break: break-all; background: #f4f6f9; padding: 6px 8px; border-radius: 6px; }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; }
#links { overflow-x: auto; }
#links td:first-child { min-width: 200px; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid #eef1f4; vertical-align: top; }
tr.expired, tr.cancelled, tr.plan-ended { color: #8a96a3; }
.actions { white-space: nowrap; }
.actions > * { margin-right: 8px; }
