/* tanakitto.me/pdf/ — everything scoped under .pdft. One centred column on every screen. */
.pdft { max-width: 40rem; margin: 0 auto; padding: 1.25rem 16px 3rem; }
.pdft h1 { font-family: var(--display); font-weight: 600; font-size: clamp(1.7rem, 5.6vw, 2.5rem); line-height: 1.22; margin: .2rem 0 .6rem; }
.pdft h2 { font-family: var(--display); font-weight: 600; font-size: 1.35rem; line-height: 1.3; margin: 0 0 .35rem; }
.pdft h3 { font-family: var(--display); font-weight: 600; font-size: 1.15rem; margin: 0 0 .5rem; }
.pdft-kicker { margin: 0; color: var(--ink-2); font-size: .95rem; }
.pdft-lede { margin: 0 0 .6rem; font-size: 1.05rem; }
.pdft-privacy { display: inline-block; margin: 0 0 1.2rem; padding: .3rem .8rem; background: var(--leaf); color: var(--ink); border: 2px solid var(--ink); border-radius: 12px; font-weight: 600; font-size: .92rem; }

/* mode tabs: a row on wide screens, a 2-column grid of big buttons on phones */
.pdft-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; margin-bottom: 1.2rem; }
.pdft-modes button { display: flex; align-items: center; gap: .45rem; min-height: 3.4rem; padding: .55rem .7rem; font: 600 .98rem/1.2 var(--display); color: var(--ink); background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; cursor: pointer; text-align: left; box-shadow: 3px 3px 0 var(--ink); transition: transform .1s, box-shadow .1s; }
.pdft-modes button:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.pdft-modes button[aria-selected="true"] { background: var(--coin); transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.pdft-modes .ic { flex: none; display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 9px; background: var(--paper-2); font-size: 1.05rem; line-height: 1; }
.pdft-modes button[aria-selected="true"] .ic { background: #fff; }
@media (max-width: 34rem) { .pdft-modes { grid-template-columns: 1fr 1fr; } .pdft-modes button { min-height: 3.8rem; font-size: 1rem; } }

/* panels */
.pdft-panel { background: #fff; border: 2.5px solid var(--ink); border-radius: 22px; box-shadow: var(--shadow); padding: 1.2rem; }
.pdft-sub { margin: 0 0 .9rem; color: var(--ink-2); font-size: .97rem; }
.pdft-note { margin: 0 0 .9rem; padding: .7rem .9rem; background: var(--paper-2); border-radius: 14px; font-size: .96rem; }
.pdft-grip-ic { font-weight: 700; }

.pdft-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; min-height: 7.5rem; padding: 1rem; text-align: center; background: var(--paper); border: 2.5px dashed var(--ink); border-radius: 18px; cursor: pointer; transition: background .15s; }
.pdft-drop:hover, .pdft-drop.over { background: var(--leaf); }
.pdft-drop:focus-within { outline: 3px solid var(--leaf-ink); outline-offset: 3px; }
.pdft-drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.pdft-drop b { font: 600 1.1rem/1.3 var(--display); display: inline-block; padding: .55rem 1.1rem; background: var(--coin); border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: 3px 3px 0 var(--ink); }
.pdft-drop span { color: var(--ink-2); font-size: .9rem; margin-top: .35rem; }

.pdft-work { margin-top: 1rem; }
.pdft-file { margin: 0 0 .8rem; padding: .55rem .8rem; background: var(--paper-2); border-radius: 12px; font-size: .95rem; overflow-wrap: anywhere; }
.pdft-info { margin: 0 0 .8rem; }

/* file lists (merge, images) */
.pdft-list { list-style: none; margin: .9rem 0 0; padding: 0; display: grid; gap: .5rem; }
.pdft-list:empty { display: none; }
.pdft-list li { display: flex; align-items: center; gap: .55rem; padding: .5rem .55rem; background: var(--paper); border: 2px solid var(--ink); border-radius: 14px; }
.pdft-list li.bad { background: var(--blush); }
.pdft-list li.dragging, .pdft-grid li.dragging { opacity: .6; outline: 3px dashed var(--leaf-ink); outline-offset: 2px; }
.pdft-list img { flex: none; width: 3rem; height: 3rem; object-fit: cover; border-radius: 8px; border: 1.5px solid var(--rule); background: #fff; }
.pdft-name { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.pdft-name b { font-weight: 600; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdft-name small { color: var(--ink-2); font-size: .82rem; }
.pdft-grip { flex: none; display: grid; place-items: center; width: 2.3rem; height: 2.6rem; font-size: 1.3rem; font-weight: 700; color: var(--ink-2); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; border-radius: 10px; }
.pdft-grip:hover { background: var(--paper-2); }
.pdft-btns { flex: none; display: flex; gap: .25rem; align-items: center; }
.pdft-btns button { width: 2.4rem; height: 2.4rem; padding: 0; font: 600 1rem/1 var(--body); color: var(--ink); background: #fff; border: 2px solid var(--ink); border-radius: 10px; cursor: pointer; }
.pdft-btns button:hover { background: var(--paper-2); }
.pdft-btns button[disabled] { opacity: .3; cursor: default; }
@media (max-width: 26rem) { .pdft-list [data-up], .pdft-list [data-down] { display: none; } }

/* split: page grid */
.pdft-range { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.pdft-range label { font-weight: 600; }
.pdft-range input { flex: 1 1 8rem; min-width: 0; }
.pdft-range .btn { padding: .55rem 1rem; }
.pdft-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .9rem; }
.pdft-chips button { padding: .4rem .75rem; font: 600 .88rem/1.2 var(--body); color: var(--ink); background: var(--paper-2); border: 2px solid var(--ink); border-radius: 10px; cursor: pointer; }
.pdft-chips button:hover { background: var(--leaf); }
.pdft-grid { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .7rem; }
.pdft-grid li { display: flex; flex-direction: column; gap: .3rem; padding: .4rem; background: var(--paper-2); border: 2px solid var(--rule); border-radius: 14px; }
.pdft-grid li.on { background: var(--leaf); border-color: var(--ink); }
.pdft-thumb { position: relative; display: grid; place-items: center; min-height: 8rem; padding: 0; background: #fff; border: 1.5px solid var(--rule); border-radius: 8px; cursor: pointer; overflow: hidden; }
.pdft-thumb canvas { display: block; max-width: 100%; height: auto; }
.pdft-grid li:not(.on) .pdft-thumb canvas { opacity: .35; }
.pdft-tick { position: absolute; top: .3rem; right: .3rem; display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; font-weight: 700; font-size: .95rem; background: #fff; border: 2px solid var(--ink); color: transparent; }
.pdft-grid li.on .pdft-tick { background: var(--leaf-ink); color: #fff; }
.pdft-pg { font-size: .85rem; font-weight: 600; text-align: center; }
.pdft-grid .pdft-btns { justify-content: space-between; }
.pdft-grid .pdft-btns button, .pdft-grid .pdft-grip { width: 2.1rem; height: 2.2rem; }

/* options */
.pdft-opts { border: 0; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.pdft-opts legend { font-weight: 600; margin-bottom: .35rem; padding: 0; }
.pdft-opts label { display: flex; align-items: center; gap: .4rem; min-height: 2.4rem; cursor: pointer; }
.pdft-opts input[type="radio"], .pdft-check input { width: 1.25rem; height: 1.25rem; accent-color: var(--leaf-ink); flex: none; }
.pdft-modes2 { flex-direction: column; gap: .55rem; }
.pdft-card-opt { align-items: flex-start !important; padding: .7rem .8rem; background: var(--paper); border: 2px solid var(--rule); border-radius: 14px; }
.pdft-card-opt:has(input:checked) { border-color: var(--ink); background: var(--leaf); }
.pdft-card-opt input { margin-top: .2rem; }
.pdft-card-opt span { font-size: .95rem; line-height: 1.5; }
.pdft-card-opt b { display: block; font-family: var(--display); font-weight: 600; font-size: 1.05rem; }
.pdft-raster-opts, .pdft-optgrid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin: 0 0 1rem; }
.pdft-optgrid { margin-top: .9rem; }
.pdft-raster-opts[hidden], .pdft-optgrid[hidden] { display: none; }
.pdft-raster-opts label, .pdft-optgrid label { display: flex; flex-direction: column; gap: .25rem; font-weight: 600; font-size: .92rem; }
.pdft-raster-opts .pdft-check, .pdft-optgrid .pdft-wide { grid-column: 1 / -1; }
.pdft-check { flex-direction: row !important; align-items: center; font-weight: 400 !important; }
@media (max-width: 26rem) { .pdft-raster-opts, .pdft-optgrid { grid-template-columns: 1fr; } }
.pdft select, .pdft input[type="text"], .pdft input[type="password"] { width: 100%; min-height: 2.75rem; padding: .5rem .7rem; font: 400 1rem/1.3 var(--body); color: var(--ink); background: #fff; border: 2px solid var(--ink); border-radius: 12px; box-sizing: border-box; }
.pdft-range input[type="text"] { width: auto; }

.pdft-pw { margin: 0 0 1rem; }
.pdft-pw label { display: block; font-weight: 600; margin-bottom: .3rem; }
.pdft-pw-row { display: flex; gap: .4rem; }
.pdft-pw-row input { flex: 1; min-width: 0; font-size: 1.1rem !important; }
.pdft-eye { flex: none; padding: 0 .9rem; font: 600 .9rem/1 var(--body); color: var(--ink); background: var(--paper-2); border: 2px solid var(--ink); border-radius: 12px; cursor: pointer; }
.pdft-hint { margin: .45rem 0 0; color: var(--ink-2); font-size: .88rem; }

.pdft-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1rem; }
.pdft-actions .btn { min-height: 3.1rem; }
.pdft-actions .btn[data-run] { flex: 1 1 12rem; text-align: center; font-size: 1.1rem; }
.pdft-actions .btn[hidden], .pdft [hidden] { display: none !important; }

/* status, progress, results */
.pdft-status:empty { display: none; }
.pdft-status { margin-top: 1rem; }
.pdft-status > p { margin: 0 0 .5rem; }
.pdft-loading { display: flex; align-items: center; gap: .55rem; color: var(--ink-2); }
.pdft-spin { width: 1.1rem; height: 1.1rem; border: 3px solid var(--rule); border-top-color: var(--leaf-ink); border-radius: 50%; animation: pdft-spin .8s linear infinite; }
@keyframes pdft-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pdft-spin { animation-duration: 3s; } }
.pdft-progress p { margin: 0 0 .35rem; font-weight: 600; }
.pdft-progress progress { width: 100%; height: .9rem; accent-color: var(--leaf-ink); }
.pdft-err { padding: .6rem .8rem; background: var(--blush); border: 2px solid var(--ink); border-radius: 12px; font-weight: 600; }
.pdft-warn { padding: .55rem .8rem; background: #fff3d1; border: 2px solid var(--coin-dark); border-radius: 12px; font-size: .93rem; }
.pdft-result { padding: .9rem 1rem; background: var(--leaf); border: 2.5px solid var(--ink); border-radius: 16px; }
.pdft-result.none { background: var(--paper-2); }
.pdft-result p { margin: 0 0 .7rem; }
.pdft-result .btn { white-space: normal; overflow-wrap: anywhere; text-align: center; }
.pdft-sizes { font: 600 1.2rem/1.4 var(--display); }
.pdft-sizes span { color: var(--ink-2); }
.pdft-sizes em { font-style: normal; display: inline-block; margin-left: .3rem; padding: .05rem .55rem; background: var(--coin); border: 2px solid var(--ink); border-radius: 9px; font-size: 1rem; }
.pdft-small { font-size: .88rem; color: var(--ink-2); }
.pdft-outs { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: .6rem; }
.pdft-outs a { display: flex; flex-direction: column; gap: .25rem; padding: .35rem; background: #fff; border: 2px solid var(--ink); border-radius: 12px; text-decoration: none; font-size: .82rem; font-weight: 600; text-align: center; }
.pdft-outs img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background: var(--paper-2); border-radius: 6px; }

/* password dialog */
.pdft-dialog { width: min(26rem, calc(100vw - 32px)); padding: 1.2rem; color: var(--ink); background: #fff; border: 2.5px solid var(--ink); border-radius: 20px; box-shadow: var(--shadow); }
.pdft-dialog::backdrop { background: rgba(31, 42, 68, .45); }
.pdft-dialog p { margin: 0 0 .6rem; overflow-wrap: anywhere; color: var(--ink-2); }
.pdft-dialog label { display: block; font-weight: 600; margin-bottom: .3rem; }
.pdft-dialog .pdft-err:empty { display: none; }
.pdft-dialog .pdft-err { margin-top: .6rem; }

/* help */
.pdft-help { margin-top: 2.5rem; }
.pdft-steps { margin: .6rem 0 0; padding-left: 1.4rem; }
.pdft-steps li { margin-bottom: .5rem; }
.pdft-faq details { border-top: 1.5px solid var(--rule); padding: .8rem 0; }
.pdft-faq details:last-child { border-bottom: 1.5px solid var(--rule); }
.pdft-faq summary { font-weight: 600; cursor: pointer; }
.pdft-faq details p { margin: .5rem 0 0; }
.pdft-more { margin-top: 2rem; font-size: .95rem; }
.pdft-more .muted { font-size: .85rem; }
