@import url('../../style.css');

.page-header { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; }
.subtitle { margin:8px 0 0; color:var(--text-soft); font-size:1.05rem; }
.home-link { display:inline-flex; align-items:center; justify-content:center; min-height:58px; padding:10px 22px; border-radius:999px; background:linear-gradient(180deg,#d8ebff 0%,#b9d9fb 100%); color:#174266; font-size:18px; font-weight:800; text-decoration:none; box-shadow:var(--shadow); white-space:nowrap; }
.status { padding:16px; border-radius:var(--radius-md); background:#f8fbff; color:var(--text-soft); }
.status.is-error { background:#fff3f0; color:#a53a2d; }

.daily-entry { padding:8px 0 20px; }
.daily-kicker { margin:0 0 6px; color:var(--accent-deep); font-size:.92rem; font-weight:800; }
.daily-entry h2 { margin:0; color:var(--accent-deep); font-size:1.65rem; }
.daily-summary { margin:8px 0 14px; color:var(--text-soft); font-size:1.02rem; font-weight:700; line-height:1.6; }
.daily-progress-summary { margin:0 0 12px; color:var(--accent-deep); font-size:1rem; font-weight:800; }
.daily-completion-status { margin:0 0 14px; padding:10px 12px; border-radius:14px; background:#e8f8ef; color:#166244; font-weight:800; }
.daily-plan { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.daily-plan span { padding:10px; border-radius:14px; background:#eef7ff; color:var(--text-soft); font-size:.85rem; line-height:1.45; }
.daily-plan b { display:block; color:var(--accent-deep); font-size:1.18rem; }
.daily-start-button { width:100%; min-height:58px; margin-top:14px; border:0; border-radius:18px; background:linear-gradient(180deg,#cfe7ff 0%,#a9d3fa 100%); color:#174266; box-shadow:var(--shadow); cursor:pointer; font:inherit; font-size:1.12rem; font-weight:800; }
.daily-start-button:disabled { cursor:default; opacity:.6; }
.free-training { margin-top:8px; padding-top:18px; border-top:1px solid var(--line); }
.empty-daily-plan { margin:0; color:var(--text-soft); }
.mode-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.mode-card { min-height:104px; border:1px solid #e1edf6; padding:17px; border-radius:var(--radius-md); background:#f7fbff; color:var(--text-main); cursor:pointer; font:inherit; text-align:left; box-shadow:none; }
.mode-card:hover,.mode-card:focus-visible { background:#dceeff; }
.mode-title,.mode-count { display:block; }
.mode-title { color:var(--accent-deep); font-size:1.2rem; font-weight:800; }
.mode-count { margin-top:10px; color:var(--text-soft); font-weight:700; }

.training-panel { max-width:980px; margin:0 auto; }
.training-header { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; }
.training-header h2 { margin:2px 0 0; }
.training-kicker { margin:0; color:var(--text-soft); font-weight:700; }
.daily-progress { margin:8px 0 0; color:var(--accent-deep); font-weight:800; }
.extra-progress { margin:8px 0 0; color:#166244; font-weight:800; }
.back-button,.round-complete button,.daily-complete button,.extra-complete button { border:0; border-radius:14px; padding:12px 16px; background:#eef5fb; color:#174266; cursor:pointer; font:inherit; font-weight:800; }
.round-status { min-height:1.6em; margin:18px 0 14px; color:var(--text-soft); }
.did-not-know-button { display:grid; justify-items:start; gap:2px; width:100%; min-height:54px; margin:0 0 14px; border:1px solid #c5dced; border-radius:15px; padding:9px 14px; background:#f4faff; color:#174266; cursor:pointer; font:inherit; font-weight:800; text-align:left; touch-action:manipulation; }
.did-not-know-button span { color:var(--text-soft); font-size:.86rem; font-weight:700; }
.did-not-know-button:active,.did-not-know-button:focus-visible { background:#e3f2ff; outline:2px solid #72aee2; outline-offset:1px; }
.did-not-know-button[hidden] { display:none !important; }
.match-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.match-column { display:grid; gap:10px; align-content:start; }
.match-column h3 { margin:0 0 2px; color:var(--accent-deep); font-size:1rem; }
.match-card-group { display:grid; gap:7px; min-width:0; }
.match-card { width:100%; min-height:62px; border:2px solid transparent; border-radius:16px; padding:13px 14px; background:#f7fbff; color:var(--text-main); box-shadow:var(--shadow); cursor:pointer; font:inherit; font-size:1rem; line-height:1.5; overflow-wrap:anywhere; text-align:left; }
.match-card.selected { border-color:#5a9ee4; background:#e6f3ff; }
.match-card.is-correct { border-color:#78c69b; background:#dff7e8; color:#166244; }
.match-card.is-wrong { border-color:#e39292; background:#fff0f0; color:#8e2626; }
.match-card.is-unknown { border-color:#8fb5d8; background:#edf6ff; color:#174266; }
.match-card:disabled { cursor:default; }
.word-card-actions { display:flex; flex-wrap:wrap; gap:7px; }
.word-action-button { min-height:44px; border:1px solid #c5dced; border-radius:12px; padding:7px 12px; background:#f4faff; color:#174266; cursor:pointer; font:inherit; font-size:.9rem; font-weight:800; touch-action:manipulation; }
.word-action-button:active,.word-action-button:focus-visible { background:#e3f2ff; outline:2px solid #72aee2; outline-offset:1px; }
.word-detail { display:grid; gap:6px; padding:10px; border-radius:13px; background:#f6fbff; color:var(--text-soft); font-size:.9rem; line-height:1.5; overflow-wrap:anywhere; }
.word-detail[hidden] { display:none !important; }
.word-detail-row { display:grid; grid-template-columns:auto minmax(0,1fr); gap:8px; }
.word-detail-label { color:var(--accent-deep); font-weight:800; white-space:nowrap; }
.word-detail-value { min-width:0; }
.round-complete { display:grid; justify-items:center; gap:8px; margin-top:18px; padding:20px; border-radius:var(--radius-md); background:#e8f8ef; color:#166244; }
.round-complete[hidden],.daily-complete[hidden],.extra-complete[hidden] { display:none !important; }
.daily-complete { display:grid; justify-items:center; gap:8px; margin-top:18px; padding:22px; border-radius:var(--radius-md); background:#e8f8ef; color:#166244; }
.daily-complete strong { font-size:1.2rem; }
.extra-complete { display:grid; justify-items:center; gap:10px; margin-top:18px; padding:22px; border-radius:var(--radius-md); background:#edf8f1; color:#166244; }
.extra-complete strong { font-size:1.2rem; }
.extra-actions { display:flex; flex-wrap:wrap; justify-content:center; gap:10px; width:100%; }
.extra-actions button { flex:1 1 190px; min-height:48px; background:#e5f4ea; color:#166244; }
.did-not-know-review { width:100%; margin-top:10px; padding-top:16px; border-top:1px solid #b9ddc8; text-align:left; }
.did-not-know-review[hidden] { display:none !important; }
.did-not-know-review h3 { margin:0; color:#166244; font-size:1.08rem; }
.did-not-know-review > p { margin:6px 0 12px; color:#42715a; line-height:1.5; }
.did-not-know-review-list { display:grid; gap:10px; }
.did-not-know-review-card { display:grid; gap:7px; padding:13px; border:1px solid #c8e3d2; border-radius:14px; background:#f8fffa; color:var(--text-soft); overflow-wrap:anywhere; }
.did-not-know-review-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.did-not-know-review-word { color:#166244; font-size:1.2rem; font-weight:800; }
.did-not-know-review-speak { min-height:44px; border:1px solid #a9d1b7; border-radius:12px; padding:7px 12px; background:#effaf2; color:#166244; cursor:pointer; font:inherit; font-weight:800; white-space:nowrap; touch-action:manipulation; }
.did-not-know-review-row { display:grid; grid-template-columns:auto minmax(0,1fr); gap:8px; line-height:1.5; }
.did-not-know-review-label { color:#166244; font-weight:800; white-space:nowrap; }
.session-stats { margin-top:18px; padding-top:16px; border-top:1px solid var(--line); }
.session-stats h3 { margin:0 0 10px; color:var(--accent-deep); font-size:1rem; }
.session-stats-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.session-stats-grid div { padding:12px; border-radius:14px; background:#f8fbff; color:var(--text-soft); font-size:.9rem; }
.session-stats-grid strong { display:block; margin-top:4px; color:var(--accent-deep); font-size:1.35rem; }
.persistent-stats { margin-top:18px; padding-top:16px; border-top:1px solid var(--line); }
.persistent-stats h3 { margin:0 0 10px; color:var(--accent-deep); font-size:1rem; }
.persistent-stats-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.persistent-stats-grid div { padding:12px; border-radius:14px; background:#f8fbff; color:var(--text-soft); font-size:.9rem; }
.persistent-stats-grid strong { display:block; margin-top:4px; color:var(--accent-deep); font-size:1.35rem; }
.learning-state-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; margin-top:10px; }
.learning-state-grid div { padding:9px 8px; border-radius:12px; background:#eef7ff; color:var(--text-soft); font-size:.82rem; text-align:center; }
.learning-state-grid strong { display:block; margin-top:3px; color:var(--accent-deep); font-size:1.15rem; }

.parent-tools { margin-top:26px; padding-top:14px; border-top:1px solid var(--line); color:var(--text-soft); }
.parent-tools summary { width:fit-content; min-height:44px; display:flex; align-items:center; padding:4px 10px; border-radius:10px; cursor:pointer; font-weight:700; touch-action:manipulation; }
.parent-tools summary:focus-visible { outline:2px solid #72aee2; outline-offset:2px; }
.parent-tools-content { max-width:560px; margin:8px 0 0; padding:16px; border:1px solid #e1edf6; border-radius:var(--radius-md); background:#f8fbff; }
.parent-tools-content h2 { margin:0; color:var(--accent-deep); font-size:1.12rem; }
.parent-tools-content p { margin:6px 0 12px; }
.parent-tools-content button,.export-fallback-actions button,.export-fallback-header button { min-height:48px; border:1px solid #c5dced; border-radius:12px; padding:9px 15px; background:#edf6ff; color:#174266; cursor:pointer; font:inherit; font-weight:800; touch-action:manipulation; }
.parent-tools-content small { display:block; margin-top:10px; line-height:1.5; }
.export-fallback[hidden] { display:none !important; }
.export-fallback { position:fixed; z-index:1000; inset:0; display:grid; place-items:center; padding:16px; background:rgba(18,35,50,.55); }
.export-fallback-card { display:grid; gap:10px; width:min(100%,760px); max-height:min(90dvh,900px); overflow:hidden; padding:18px; border-radius:18px; background:#fff; box-shadow:0 18px 55px rgba(0,0,0,.25); }
.export-fallback-header { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.export-fallback-header h2 { margin:0; color:var(--accent-deep); font-size:1.2rem; }
.export-fallback-card > p { margin:0; color:var(--text-soft); line-height:1.5; }
#exportJsonText { width:100%; min-width:0; min-height:180px; max-height:55vh; resize:vertical; overflow:auto; box-sizing:border-box; border:1px solid #cbd9e5; border-radius:10px; padding:10px; color:#243746; font:13px/1.4 ui-monospace,SFMono-Regular,Menlo,monospace; white-space:pre; }
.export-fallback-actions { display:flex; justify-content:flex-end; }
.export-copy-status { min-height:1.3em; font-size:.9rem; }
body.export-modal-open { overflow:hidden; }

@media (min-width:721px) {
  .page-home-portal { width:min(100%, 1200px); }
  .training-panel { max-width:none; }
  .match-grid { gap:22px; }
  .match-column { gap:14px; }
  .match-card { min-height:72px; padding:16px 18px; font-size:1.1rem; }
  .word-action-button { min-height:48px; padding:8px 14px; font-size:1rem; }
  .did-not-know-button { min-height:58px; padding:10px 16px; font-size:1.05rem; }
  .word-detail { padding:12px; font-size:1rem; }
}

@media (max-width:720px) {
  .page-header,.training-header { flex-direction:column; }
  .home-link,.back-button { width:100%; }
  .mode-grid { grid-template-columns:1fr; }
  .daily-plan { grid-template-columns:1fr; }
  .training-header { align-items:stretch; }
  .match-grid { gap:8px; }
  .match-card { min-height:68px; padding:12px 10px; font-size:.98rem; }
  .word-action-button { flex:1 1 auto; }
  .did-not-know-button { min-height:54px; }
  .word-detail { font-size:.86rem; }
  .session-stats-grid { gap:7px; }
  .session-stats-grid div { padding:10px 8px; font-size:.82rem; }
  .persistent-stats-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
  .persistent-stats-grid div { padding:10px 8px; font-size:.82rem; }
  .learning-state-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
  .learning-state-grid div { padding:8px 5px; font-size:.78rem; }
  .parent-tools-content { max-width:none; }
  .export-fallback { padding:10px; }
  .export-fallback-card { max-height:94dvh; padding:14px; }
  #exportJsonText { min-height:150px; }
}
