main { max-width: 1440px; margin: 0 auto; padding: 48px 64px; display: grid; grid-template-columns: minmax(0,1fr) 360px; gap: 40px; align-items: start; }
h1 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 40px; line-height: 1.15; letter-spacing: -0.01em; }
.lede { margin: 8px 0 28px; color: var(--muted); font-size: 16px; line-height: 1.5; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.toolbar .group { display: flex; gap: 10px; }
.btn { height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--text); font-weight: 500; font-size: 15px; }
.hint { color: var(--muted); font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 20px; }
.card { display: flex; flex-direction: column; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.card.dragging { opacity: 0.5; }
.card[aria-invalid="true"] { border-color: color-mix(in srgb, var(--accent) 40%, red); }
.thumb { position: relative; height: 188px; border-radius: var(--radius-md); background: var(--well); display: grid; place-items: center; overflow: hidden; }
.thumb canvas { max-width: 100%; max-height: 100%; box-shadow: var(--shadow-page); }
.num { position: absolute; top: 10px; left: 10px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; font-weight: 600; display: grid; place-items: center; }
.remove { position: absolute; top: 4px; right: 4px; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); }
.move-buttons { position: absolute; bottom: 4px; right: 4px; display: flex; gap: 2px; }
.move-buttons button { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--muted); }
.move-buttons button:disabled { opacity: 0.35; cursor: not-allowed; }
.info { display: flex; gap: 8px; padding: 0 4px 4px; min-width: 0; }
.info > div { min-width: 0; }
.grip { flex-shrink: 0; margin-top: 2px; color: var(--muted); cursor: grab; }
.name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { font-size: 13px; color: var(--muted); }
.meta.error-text { color: color-mix(in srgb, var(--text) 60%, red); }
.add { min-height: 262px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border: 1.5px dashed var(--dash); border-radius: var(--radius-lg); background: transparent; color: var(--muted); font-size: 14px; width: 100%; }
.add.dragover { border-color: var(--accent); background: var(--accent-soft); }
.add .plus { width: 40px; height: 40px; border-radius: 20px; background: var(--accent-soft); color: var(--accent-soft-text); display: grid; place-items: center; }
.add strong { color: var(--text); font-weight: 500; }

aside { display: flex; flex-direction: column; gap: 24px; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); position: sticky; top: 24px; }
aside h2 { margin: 0; font-size: 18px; font-weight: 600; }
dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; row-gap: 12px; font-size: 15px; }
dt { color: var(--muted); } dd { margin: 0; text-align: right; font-weight: 500; }
hr { margin: 0; border: 0; height: 1px; background: var(--border); }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 14px; font-weight: 500; }
.field input { height: 44px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg); color: var(--text); font: inherit; font-size: 15px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.check-row { display: flex; align-items: center; gap: 6px; }
.check-row .check { flex: 1; }

.tooltip { position: relative; display: inline-flex; }
.tooltip-trigger { width: 18px; height: 18px; padding: 0; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: var(--well); color: var(--muted); font-size: 11px; line-height: 1; }
.tooltip-text { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 220px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--text); color: var(--bg); font-size: 12px; line-height: 1.4; text-align: center; opacity: 0; visibility: hidden; transition: opacity 0.1s ease; pointer-events: none; z-index: 10; }
.tooltip-trigger:hover + .tooltip-text,
.tooltip-trigger:focus-visible + .tooltip-text { opacity: 1; visibility: visible; }
.primary { height: 52px; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-text); font-size: 16px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; }
.primary:disabled { opacity: 0.5; cursor: not-allowed; }
.notice { display: flex; gap: 10px; padding: 14px; border-radius: var(--radius-md); background: var(--well); color: var(--muted); font-size: 13px; line-height: 1.5; }
.small { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.small a { font-weight: 500; }
.error-banner { padding: 14px; border-radius: var(--radius-md); background: var(--well); color: var(--text); font-size: 14px; border: 1px solid var(--border); }
.progress-track { height: 8px; border-radius: 4px; background: var(--well); overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); width: 0%; transition: width 0.2s; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 1100px) { main { grid-template-columns: 1fr; } .grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 720px) { .grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
