/* Copeak one-screen home: layout only. No recording/scoring selectors. */
body.copeak-home-mode {
  margin: 0 !important;
  padding-bottom: 0 !important;
  background: #f3f8ff !important;
  background-image: none !important;
  overflow: hidden;
}
#homeScreen.cp-dashboard-mode.active {
  display: block !important;
  box-sizing: border-box;
  width: 100% !important;
  max-width: none !important;
  height: 100dvh;
  min-height: 0 !important;
  margin: 0 !important;
  padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(9px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)) !important;
  background: radial-gradient(circle at 13% 4%,#dceeff 0,transparent 34%),linear-gradient(135deg,#f9fcff,#eff8ff 62%,#f6fbf9);
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: hidden;
}
#copeakHomeHub[hidden], #copeakLegacyWorkspace[hidden], #copeakLegacyBack[hidden] { display: none !important; }
#copeakHomeHub {
  width: min(1220px, 100%);
  height: 100%;
  margin: auto;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto auto;
  gap: clamp(8px,1.6vh,17px);
  color: #152f53;
  font-family: "Noto Sans JP",system-ui,sans-serif;
}
#copeakHomeHub * { box-sizing: border-box; }
.cp-home-header {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 100px;
  height: clamp(100px,18vh,157px);
  overflow: visible;
}
.cp-brand { display: flex; align-items: center; gap: clamp(8px,1.3vw,16px); z-index: 1; min-width: 0; }
.cp-brand-logo {
  width: clamp(50px,7.2vw,90px);
  height: clamp(50px,7.2vw,90px);
  object-fit: contain;
  filter: drop-shadow(0 7px 10px rgba(27,77,139,.10));
}
.cp-brand-word { font-size: clamp(31px,4.8vw,62px); font-weight: 900; letter-spacing: -.055em; line-height: 1.08; color: #133d7f; }
.cp-brand-word span { color: #178ef0; }
.cp-brand-sub { margin-top: 4px; font-size: clamp(10px,1.2vw,14px); font-weight: 750; letter-spacing: .16em; color: #657b95; }
.cp-home-illustration {
  position: absolute;
  inset: 2px 13% 0 auto;
  width: clamp(130px,26vw,380px);
  height: 100%;
  object-fit: contain;
  object-position: center;
  opacity: .96;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to right,transparent 0%,#000 13%,#000 88%,transparent);
  mask-image: linear-gradient(to right,transparent 0%,#000 13%,#000 88%,transparent);
}
.cp-header-actions { display: flex; align-items: center; gap: 10px; z-index: 3; align-self: flex-start; padding-top: 12px; }
.cp-profile-pill,.cp-settings {
  border: 1px solid #dbe8f5; background:rgba(255,255,255,.93);
  box-shadow:0 5px 18px rgba(24,78,134,.1);
  color:#1e416c; font-weight:800; cursor:pointer;
}
.cp-profile-pill { padding: 9px 13px; border-radius: 99px; display:flex; align-items:center; gap:9px; max-width: 175px; }
.cp-profile-pill span:last-child { text-overflow:ellipsis; overflow:hidden; white-space:nowrap; font-size:12px; }
.cp-profile-avatar { background:#e7f4ff; width:28px; height:28px; border-radius:50%; display:grid; place-items:center; flex:none; font-size:15px; }
.cp-settings { width:45px; height:45px; border-radius:50%; display:grid; place-items:center; font-size:22px; }
.cp-home-cards { display:grid; min-height: 0; grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:repeat(2,minmax(0,1fr)); gap:clamp(9px,1.6vh,18px); }
.cp-action {
  display:flex; align-items:center; width:100%; height:100%; min-height:0; text-align:left;
  padding:clamp(13px,2.2vw,29px); gap:clamp(12px,2vw,26px);
  border:1.5px solid rgba(255,255,255,.95); border-radius:clamp(19px,2.4vw,30px);
  box-shadow:0 10px 28px rgba(37,86,145,.10),inset 0 1px rgba(255,255,255,.95);
  cursor:pointer; transition: transform .18s ease,box-shadow .18s ease; color:#10284b; overflow:hidden;
}
.cp-action:hover { transform:translateY(-3px);box-shadow:0 16px 34px rgba(37,86,145,.16); }
.cp-action:active { transform:scale(.988); }
.cp-action:focus-visible,.cp-settings:focus-visible,.cp-profile-pill:focus-visible,
#copeakHomeHub button:focus-visible,#copeakHomeHub select:focus-visible { outline:3px solid #176fec;outline-offset:2px; }
.cp-action-read { background:linear-gradient(120deg,#f5faff,#e4f1ff); }
.cp-action-create { background:linear-gradient(120deg,#f7fffd,#e2f8f3); }
.cp-action-sound { background:linear-gradient(120deg,#fffaf1,#fff0d9); }
.cp-action-vocabulary { background:linear-gradient(120deg,#faf8ff,#eee9ff); }
.cp-action-icon {
  width:clamp(62px,9vw,116px); height:clamp(62px,9vw,116px);
  display:grid;place-items:center;flex:none;border-radius:25%;
  font-size:clamp(39px,6.2vw,72px);line-height:1;
  background:rgba(255,255,255,.53);
}
.cp-action-copy { display:flex;flex-direction:column;gap:7px;min-width:0;flex:1; }
.cp-action-title {font-size:clamp(18px,2.2vw,28px);font-weight:900;letter-spacing:-.045em;line-height:1.35;}
.cp-action-sub {font-size:clamp(12px,1.25vw,16px);font-weight:650;color:#58718f;}
.cp-action-arrow {
  width:clamp(33px,3.7vw,46px);height:clamp(33px,3.7vw,46px);border-radius:50%;display:grid;place-items:center;
  background:rgba(255,255,255,.64);font-size:clamp(20px,2.3vw,29px);font-weight:800;flex:none;color:#2589db;
}
.cp-action-create .cp-action-arrow{color:#159b83}.cp-action-sound .cp-action-arrow{color:#f19820}.cp-action-vocabulary .cp-action-arrow{color:#7964df}
.cp-home-extras {display:grid;grid-template-columns:1.3fr 1fr;gap:clamp(9px,1.6vh,18px);min-height:88px;}
.cp-extra {
  min-width:0; background:rgba(255,255,255,.87); border:1px solid #e4edf7;
  border-radius:22px; box-shadow:0 5px 17px rgba(37,86,145,.065);
  padding:15px 20px;display:flex;align-items:center;justify-content:space-between;gap:12px;
}
.cp-extra h3 {font-size:clamp(13px,1.35vw,17px);font-weight:900;margin:0 0 4px;color:#203b63}
.cp-extra p {font-size:clamp(11px,1.1vw,13px);color:#66809c;font-weight:650;margin:0;line-height:1.55}
.cp-extra-link {white-space:nowrap;flex:none;padding:9px 13px;border-radius:99px;background:#edf5ff;color:#2873b9;font-size:12px;font-weight:850;cursor:pointer;}
.cp-extra-spark { font-size:34px;flex:none; }
.cp-home-bottom {
  display:flex;justify-content:center;align-items:center;gap:clamp(9px,3.3vw,45px);
  min-height:51px;padding:3px 10px; background:rgba(255,255,255,.86);
  border:1px solid #e4edf7;border-radius:18px;
}
.cp-nav {display:flex;flex-direction:column;align-items:center;gap:2px;min-width:66px;padding:3px 10px;border-radius:11px;color:#617b97;font-size:11px;font-weight:800;cursor:pointer;}
.cp-nav .cp-nav-icon {font-size:20px;line-height:1.2;}
.cp-nav[aria-current="page"]{color:#1283eb;background:#e9f4ff}
.cp-home-menu {
  position:absolute;right:0;top:63px;z-index:100;
  width:min(320px,90vw);max-height:min(70dvh,530px);overflow-y:auto;
  padding:16px;background:white;border:1px solid #d7e7f8;border-radius:20px;
  box-shadow:0 18px 60px rgba(17,52,98,.25);display:grid;gap:5px;
}
.cp-home-menu[hidden] {display:none!important}
.cp-home-menu-title{font-weight:900;font-size:15px;margin:0 0 4px}
.cp-menu-button,.cp-menu-link {padding:11px 12px;border-radius:11px;color:#2d4e71;text-align:left;font-size:13px;font-weight:750;display:block;width:100%;background:#f5f9ff;cursor:pointer;text-decoration:none;}
.cp-menu-button:hover,.cp-menu-link:hover{background:#e7f3ff}
.cp-menu-label{font-weight:850;font-size:12px;color:#5d7791;margin:8px 0 2px}
.cp-home-menu select{width:100%;border:1px solid #dbe7f6;border-radius:10px;padding:10px;background:white;color:#244d78;font-weight:750;font-size:13px}
#homeScreen.cp-legacy-mode { overflow:visible; }
#copeakLegacyBack {
  position:sticky;top:8px;z-index:25;
  width:max-content;max-width:100%;margin:0 0 14px auto;
  background:#eaf5ff;color:#0f5c9c;border:1px solid #a8cdea;
  box-shadow:0 4px 20px rgba(0,0,0,.12);
  border-radius:99px;padding:10px 18px;cursor:pointer;font-size:13px;font-weight:850;
}
#homeScreen.cp-legacy-mode #copeakLegacyWorkspace {display:block;}
@media (max-width:700px) {
  #homeScreen.cp-dashboard-mode.active {padding: max(8px,env(safe-area-inset-top)) 10px max(5px,env(safe-area-inset-bottom)) !important}
  #copeakHomeHub{gap:9px}
  .cp-home-header{height:clamp(82px,15dvh,115px);min-height:0;padding:0 3px}
  .cp-brand-logo{width:42px;height:42px}
  .cp-brand {gap:6px}
  .cp-brand-word{font-size:clamp(26px,7vw,37px)}
  .cp-brand-sub{font-size:9px;letter-spacing:.05em}
  .cp-home-illustration{right:12%;width:30%;opacity:.24}
  .cp-header-actions{gap:6px;padding-top:5px}
  .cp-profile-pill{padding:6px;border-radius:50%;width:38px;height:38px;display:grid;place-items:center}
  .cp-profile-avatar{width:26px;height:26px}
  .cp-profile-pill span:last-child{display:none}
  .cp-settings{width:38px;height:38px;font-size:19px}
  .cp-home-cards{gap:9px}
  .cp-action{flex-direction:column;justify-content:center;text-align:center;gap:4px;padding:10px 6px;border-radius:19px}
  .cp-action-icon{width:clamp(44px,10vw,58px);height:clamp(44px,10vw,58px);font-size:clamp(30px,7vw,39px);border-radius:17px}
  .cp-action-copy{gap:4px;flex:none;align-items:center;width:100%}
  .cp-action-title{font-size:clamp(13px,3.35vw,17px);line-height:1.4;overflow-wrap:anywhere}
  .cp-action-sub{font-size:clamp(10px,2.55vw,12px)}
  .cp-action-arrow{display:none}
  .cp-home-extras{grid-template-columns:1fr;min-height:0}
  .cp-extra{padding:10px 13px;border-radius:17px;min-height:63px}
  .cp-extra h3{font-size:13px;margin:0 0 1px}
  .cp-extra p{font-size:10px}
  .cp-extra-link{font-size:10px;padding:8px 9px}
  .cp-home-extras .cp-extra:nth-child(2){display:none}
  .cp-home-bottom{min-height:48px;border-radius:14px;gap:2px;justify-content:space-around;padding:3px}
  .cp-nav{min-width:0;width:25%;font-size:10px;padding:3px}
  .cp-nav .cp-nav-icon{font-size:19px}
}
@media (max-height:620px) {
  .cp-home-header{height:72px}
  .cp-home-extras{display:none}
  .cp-home-cards{gap:8px}
  .cp-action-icon{width:38px;height:38px;font-size:27px}
  .cp-action-title{font-size:clamp(12px,2.5vw,19px)}
  .cp-action-sub{font-size:10px}
  #copeakHomeHub{gap:7px}
}
@media (prefers-reduced-motion: reduce) {
  .cp-action{transition:none}
  .cp-action:hover{transform:none}
}
/* Home action PNG art: maintain original card sizing, alignment and tap targets. */
#copeakHomeHub .cp-action-icon { overflow: hidden; }
#copeakHomeHub .cp-action-icon img { display:block; width:88%; height:88%; max-width:100%; max-height:100%; object-fit:contain; object-position:center; pointer-events:none; user-select:none; }
#copeakHomeHub .cp-action-vocabulary .cp-action-icon img { width:95%; height:95%; }
@media (max-width:700px) { #copeakHomeHub .cp-action-icon img { width:92%; height:92%; } #copeakHomeHub .cp-action-vocabulary .cp-action-icon img { width:100%; height:100%; } }

/* COPEAK HOME STUDENTS ART BEGIN */
/* Decorative artwork, sized to the free center of the Copeak header. */
#copeakHomeHub .cp-home-students-banner {
  display: block;
  flex: 1 1 0;
  width: 100%;
  min-width: 0;
  max-width: 375px;
  height: 100%;
  max-height: 120px;
  align-self: center;
  object-fit: contain;
  object-position: center;
  opacity: .98;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  animation: cp-home-students-enter .55s ease-out both;
}
#copeakHomeHub .cp-home-header > .cp-brand { flex-shrink: 0; }
#copeakHomeHub .cp-home-header > .cp-header-actions { flex-shrink: 0; }
@keyframes cp-home-students-enter {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: .98; transform: translateY(0); }
}
@media (min-width: 701px) and (max-width: 1040px) {
  #copeakHomeHub .cp-home-students-banner { max-width: 30vw; }
  #copeakHomeHub .cp-home-header { gap: 9px; }
}
/* Narrow phones should prioritize tappable navigation and readable branding. */
@media (max-width: 700px) {
  #copeakHomeHub .cp-home-students-banner { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  #copeakHomeHub .cp-home-students-banner { animation: none; opacity: 1; }
}
/* COPEAK HOME STUDENTS ART END */

/* Vocabulary Check replaces Japeak as the fourth main dashboard card. */
#copeakHomeHub .cp-action-vocabulary .cp-action-icon img{width:88%;height:88%;object-fit:contain}


/* A visible, native header QR action (the dashboard replaces the legacy home markup). */
#copeakHomeHub .cp-header-actions > .cp-home-qr-button {
  display: inline-flex !important;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid #c7dff2;
  border-radius: 50%;
  background: rgba(255,255,255,.96);
  color: #1c5787;
  box-shadow: 0 5px 18px rgba(24,78,134,.1);
  cursor: pointer;
  touch-action: manipulation;
}
#copeakHomeHub .cp-header-actions > .cp-home-qr-button svg {
  display: block; width: 21px; height: 21px;
  stroke: currentColor; stroke-width: 2; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
}
#copeakHomeHub .cp-header-actions > .cp-home-qr-button:hover {
  box-shadow: 0 6px 18px rgba(24,78,134,.19);
}
@media (max-width: 700px) {
  #copeakHomeHub .cp-header-actions > .cp-home-qr-button {
    flex: 0 0 38px;
    width: 38px; height: 38px; min-width: 38px;
  }
}


/* NCC shortcut, fifth item in the compact Copeak home bottom navigation. */
#copeakHomeHub .cp-home-bottom .cp-nav-ncc {
  color:#9b6e22;
  border:1px solid rgba(225,181,92,.46);
  background:linear-gradient(145deg,#fffaf0,#fff1ce);
  box-shadow:0 0 9px rgba(239,193,97,.14);
  animation:cpNccNavGlow 3.8s ease-in-out infinite;
}
#copeakHomeHub .cp-home-bottom .cp-nav-ncc .cp-nav-icon {
  filter:drop-shadow(0 1px 3px rgba(180,131,42,.23));
}
#copeakHomeHub .cp-home-bottom .cp-nav-ncc:hover {
  color:#835515;background:#fff0c2;
}
@keyframes cpNccNavGlow {
  0%,100%{box-shadow:0 0 5px rgba(239,193,97,.13)}
  50%{box-shadow:0 0 14px rgba(239,193,97,.48)}
}
@media (max-width:700px) {
  #copeakHomeHub .cp-home-bottom .cp-nav {width:20%;min-width:0; padding:3px 2px;}
  #copeakHomeHub .cp-home-bottom .cp-nav-ncc{font-size:10px;}
}
@media (prefers-reduced-motion:reduce) {
  #copeakHomeHub .cp-home-bottom .cp-nav-ncc{animation:none;}
}

/* NCC bottom tab is a native link, independent of competing home click routers. */
#copeakHomeHub .cp-home-bottom a.cp-nav-ncc{text-decoration:none;justify-content:center;min-height:41px;touch-action:manipulation;}
