/* 学級通信メーカー（画面の部品。紙の見た目は tsushin.js の TS_CSS） */
.ts { display: grid; gap: 0; }
.ts-toolbar { margin-bottom: 12px; }
.ts-main { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .ts-main { grid-template-columns: 1fr; } .ts-right { order: -1; } }
.ts-side { min-width: 0; border: 2px solid var(--line); border-radius: 16px; background: var(--card2); padding: 10px; position: sticky; top: calc(var(--header-h) + 10px); max-height: calc(100vh - var(--header-h) - 24px); overflow-y: auto; }
@media (max-width: 900px) { .ts-side { position: static; max-height: none; } }
.ts-side .app-tabs { margin-bottom: 10px; }
.ts-side .app-tab { padding: 5px 10px; font-size: 13px; }
.ts-right { min-width: 0; display: grid; gap: 8px; }
.ts-stage { background: #d6d0c2; border: 2px solid var(--line); border-radius: 16px; padding: 12px; overflow: hidden; min-height: 300px; }
.ts-stage.full { overflow-x: auto; }
:root[data-theme='dark'] .ts-stage { background: #3a3a3a; }
.ts-stage .ts-paper { margin: 0 auto; box-shadow: 0 4px 18px rgba(0, 0, 0, .28); }
.ts-stage .ts-b { cursor: text; }
.ts-stage .ts-b:hover { outline: 1.5px dashed color-mix(in srgb, var(--c1) 60%, transparent); outline-offset: 1.2mm; }
.ts-stage .ts-b.sel { outline: 2.5px solid #2d7ff9; outline-offset: 1.2mm; }
.ts-stage .ts-ed:focus { background: rgba(255, 230, 120, .25); }
.ts-stage .ts-paper.over::after { content: '↑ ここまでが1枚目（下にはみ出しています）'; position: absolute; left: 0; right: 0; top: 100%; border-top: 3px dashed #d03b2f; color: #d03b2f; font: 700 13px var(--font); padding-top: 4px; text-align: center; }
.ts-stage .ts-photo:not(.has) { cursor: pointer; }
.ts-fit .ts-ok { color: var(--ok); font-weight: 800; padding: 2px 4px; }
.ts-fitnote { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ts-sec { display: grid; gap: 8px; padding: 6px 2px 12px; border-bottom: 2px dashed var(--line-soft); margin-bottom: 8px; }
.ts-sec:last-child { border-bottom: 0; }
.ts-sec > b { font-size: 14px; }
.ts-sec p { margin: 0; }
.ts-addgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.ts-add { display: grid; justify-items: center; gap: 3px; padding: 8px 4px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; line-height: 1.3; }
.ts-add:hover { background: var(--bg2); }
.ts-add-ic svg { width: 22px; height: 22px; display: block; }
.ts-blist { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.ts-bitem { display: flex; align-items: center; gap: 6px; border: 1.5px solid var(--line-soft); border-radius: 10px; padding: 4px 6px; background: var(--card); }
.ts-bitem.on { border-color: #2d7ff9; box-shadow: 0 0 0 2px color-mix(in srgb, #2d7ff9 25%, transparent); }
.ts-grip { cursor: grab; color: var(--ink3); font-weight: 900; letter-spacing: -2px; }
.ts-bname { flex: 1; min-width: 0; text-align: left; border: 0; background: none; color: var(--ink); font: inherit; display: grid; padding: 2px; cursor: pointer; }
.ts-bname b { font-size: 13px; }
.ts-bname small { font-size: 11.5px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-bt { display: inline-flex; gap: 3px; flex-wrap: wrap; }
.ts-ib { width: 28px; height: 28px; border: 1.5px solid var(--line-soft); border-radius: 8px; background: var(--card); color: var(--ink); font-weight: 900; cursor: pointer; }
.ts-ib:hover { border-color: var(--line); }
.ts-themes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ts-theme { display: flex; align-items: center; gap: 7px; padding: 5px 7px; border: 2px solid var(--line-soft); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; text-align: left; }
.ts-theme.on { border-color: var(--line); box-shadow: var(--sh-sm); }
.ts-sw { width: 30px; height: 30px; border-radius: 8px; border: 2px solid; display: grid; place-items: center; flex: none; padding: 3px; }
.ts-sw svg { width: 100%; height: 100%; display: block; }
.ts-decos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.ts-decob { display: grid; gap: 2px; padding: 5px; border: 2px solid var(--line-soft); border-radius: 10px; background: #fff; cursor: pointer; font: inherit; color: #333; }
.ts-decob.on { border-color: var(--line); box-shadow: var(--sh-sm); }
.ts-decothumb { display: block; aspect-ratio: 720 / 150; position: relative; overflow: hidden; }
.ts-decothumb svg { width: 100%; height: 100%; display: block; }
.ts-decob small { font-size: 11.5px; font-weight: 700; }
.ts-opts { gap: 10px; }
.ts-opts .seg button { padding: 6px 10px; font-size: 13px; }
.ts-edhead { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ts-edhead > b { font-size: 16px; }
.ts-tog { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; }
.ts-tog input { width: 18px; height: 18px; }
.ts-schedit { display: grid; grid-template-columns: auto 1fr 1fr; gap: 5px; align-items: center; }
.ts-schedit .d { font-weight: 800; font-size: 13px; white-space: nowrap; display: grid; }
.ts-schedit .d small { color: var(--bad); font-weight: 700; font-size: 10.5px; }
.ts-schedit .input { min-height: 36px; padding: 4px 8px; font-size: 13.5px; min-width: 0; }
.ts-months { margin-bottom: 6px; }
.ts-months .chip { padding: 3px 10px; font-size: 12.5px; }
.ts-exg { display: grid; gap: 6px; margin-top: 10px; }
.ts-exg > b { font-size: 13.5px; }
.ts-ex { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: start; padding: 8px; border: 1.5px solid var(--line-soft); border-radius: 10px; background: var(--card); }
.ts-ex p { margin: 0; font-size: 13px; line-height: 1.6; }
