.manga-app { max-width: 1160px; margin: auto; padding: 0 20px 36px; color: var(--ink); }
.manga-header, .manga-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.manga-header { justify-content: space-between; padding: 16px 0; }
.manga-header h1 { margin: 0; font-size: 22px; }
.manga-panel { margin-top: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); }
.manga-panel h2 { margin: 0 0 12px; font-size: 18px; }
.manga-actions > h2 { margin: 0; }
.manga-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.manga-stats article { display: grid; gap: 7px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.manga-stats span, .manga-card p, .manga-episode p { font-size: 13px; color: var(--muted); }
.manga-stats strong { font-size: 19px; }
.manga-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 12px; }
.manga-card { min-width: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--field); }
.manga-card button { display: block; padding: 0; width: 100%; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.manga-cover { display: grid; place-items: center; aspect-ratio: 2 / 3; width: 100%; background: var(--soft); color: var(--accent); font-size: 28px; }
.manga-cover img { width: 100%; height: 100%; object-fit: cover; }
.manga-card h3, .manga-card p { margin: 9px 10px; overflow-wrap: anywhere; }
.manga-card h3 { font-size: 15px; }
.manga-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 135px), 1fr)); gap: 10px; margin-top: 12px; }
.manga-app label, .manga-dialog label, .auth-form label { display: grid; gap: 5px; min-width: 0; }
.manga-app :is(input, select), .manga-dialog :is(input, select, textarea), .auth-form input { width: 100%; color: var(--ink); background: var(--field); border: 1px solid var(--line); border-radius: 10px; padding: 9px; min-height: 44px; font: inherit; }
.manga-dialog { width: min(790px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 20px; }
.manga-dialog .dialog-shell { padding: 18px; }
.manga-dialog::backdrop { background: #000a; }
.manga-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.manga-dialog header h2 { margin: 0; font-size: 20px; overflow-wrap: anywhere; }
.manga-dialog form > label, .manga-dialog footer { margin-top: 12px; }
.manga-episode { padding: 12px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.manga-episode h3 { font-size: 16px; margin: 0; }
.auth-form { width: min(420px, calc(100vw - 32px)); margin: 12vh auto; background: var(--panel); padding: 24px; border-radius: 18px; }
.auth-form label { margin-bottom: 10px; }
#mangaToast { position: fixed; right: 15px; bottom: 92px; background: var(--panel); padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
@media (max-width: 760px) {
  .manga-app { padding: 0 12px 98px; }
  .manga-header .media-switcher { display: none; }
  .manga-panel { padding: 12px; }
  .manga-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manga-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manga-episode button, .manga-header button { min-height: 44px; }
}
.manga-card .manga-actions { margin: 8px; gap: 5px; }
.manga-card .manga-actions button { width: auto; min-height: 40px; border-radius: 8px; padding: 5px 9px; background: var(--soft); }
.manga-detail-summary { overflow-wrap: anywhere; white-space: pre-wrap; }
#mangaReportForm { margin: 12px 0; }
.manga-report-months { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 6px; padding: 0; list-style: none; }
.manga-report-months li { padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.manga-actions input[type="file"][hidden] { display: none; }
