/* SQL4 Practice component owner.
   Owner: #/practice cards/search only.
   This component deliberately uses a route-local high-specificity boundary so
   historical generic .btn / v2 rules cannot inflate the cards again. Theme
   colors still come from semantic tokens only; no legacy generated colors. */

.sq4-practice{
  --practice-gap:10px;
  color:var(--h-text);
}


/* Route-local Practice banner. Geometry lives here; themed paint is owned by
   practice-theme-boundary.css so all Hindex themes share one contract. */
.app.v2-app #view .sq4-practice > .v2-page-head{
  position:relative;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:18px;
  min-height:0;
  margin:0 0 14px;
  padding:18px 20px;
  overflow:hidden;
  border:1px solid var(--h-border);
  border-radius:16px;
  background:var(--h-surface);
  box-shadow:none;
}
.app.v2-app #view .sq4-practice > .v2-page-head h1{margin:2px 0 3px;font-size:clamp(26px,2.4vw,34px);line-height:1.12;letter-spacing:-.03em;}
.app.v2-app #view .sq4-practice > .v2-page-head p{max-width:70ch;margin:0;font-size:13px;line-height:1.5;}
.app.v2-app #view .sq4-practice > .v2-page-head .v2-overline{font-family:var(--h-font-mono,ui-monospace,monospace);font-size:10.5px;letter-spacing:.09em;}
.app.v2-app #view .sq4-practice > .v2-page-head .v2-page-stats{display:grid;grid-template-columns:repeat(3,minmax(76px,1fr));gap:0;margin-left:auto;}
.app.v2-app #view .sq4-practice > .v2-page-head .v2-page-stat{min-width:82px;padding:6px 13px;border-left:1px solid var(--h-border);text-align:center;}
.app.v2-app #view .sq4-practice > .v2-page-head .v2-page-stat strong{font-size:19px;line-height:1.05;}
.app.v2-app #view .sq4-practice > .v2-page-head .v2-page-stat span{display:block;margin-top:4px;font-size:9px;line-height:1.2;}

.app.v2-app #view .sq4-practice .sq4-practice-list{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  grid-auto-rows:auto;
  align-items:start;
  gap:var(--practice-gap);
  overflow:visible;
  border:0;
  background:transparent;
  box-shadow:none;
}

/* Compact card contract: content determines height. There is no spacer row,
   no stretched sequence rail and no minimum card height. */
.app.v2-app #view .sq4-practice .sq4-practice-row{
  display:grid;
  grid-template-columns:68px minmax(0,1fr) auto auto;
  grid-template-areas:
    "id title title action"
    "id meta-one meta-two action";
  column-gap:12px;
  row-gap:6px;
  align-items:center;
  align-content:center;
  min-width:0;
  min-height:0;
  height:auto;
  padding:13px 14px;
  border:1px solid var(--h-border);
  border-radius:14px;
  background:var(--h-surface);
  color:var(--h-text);
  box-shadow:0 2px 5px color-mix(in srgb,var(--h-text) 5%,transparent);
  transform:none;
  transition:background-color .14s ease,border-color .14s ease,box-shadow .14s ease;
}

.app.v2-app #view .sq4-practice .sq4-practice-row:hover{
  background:var(--h-raised);
  border-color:var(--h-accent-line);
  box-shadow:0 5px 16px color-mix(in srgb,var(--h-text) 7%,transparent);
  transform:none;
}

/* Sequence block is a compact badge, never a full-height rail. */
.app.v2-app #view .sq4-practice .sq4-practice-id{
  grid-area:id;
  align-self:center;
  justify-self:start;
  display:flex;
  width:68px;
  height:64px;
  min-width:68px;
  min-height:64px;
  padding:6px;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  border:1px solid var(--h-accent-line);
  border-radius:12px;
  background:var(--h-accent-bg);
  color:var(--h-accent);
  font-family:var(--h-font-mono,ui-monospace,monospace);
  font-size:11.5px;
  font-weight:700;
  line-height:1.25;
  text-align:center;
  white-space:normal;
}

.app.v2-app #view .sq4-practice .sq4-practice-id .chip{
  margin-top:3px;
  padding:1px 5px;
  min-height:0;
  font-size:8.5px;
  line-height:1.2;
}

.app.v2-app #view .sq4-practice .sq4-practice-title{
  grid-area:title;
  min-width:0;
  align-self:end;
}

.app.v2-app #view .sq4-practice .sq4-practice-title strong{
  display:block;
  margin:0;
  color:var(--h-text);
  font-size:17px;
  line-height:1.24;
  letter-spacing:-.01em;
}

.app.v2-app #view .sq4-practice .sq4-practice-title span{
  display:-webkit-box;
  margin-top:3px;
  overflow:hidden;
  color:var(--h-muted);
  font-size:13px;
  line-height:1.35;
  white-space:normal;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
}

.app.v2-app #view .sq4-practice .sq4-practice-row>.sq4-practice-meta:nth-child(3){
  grid-area:meta-one;
  justify-self:start;
}
.app.v2-app #view .sq4-practice .sq4-practice-row>.sq4-practice-meta:nth-child(4){
  grid-area:meta-two;
  justify-self:start;
}

.app.v2-app #view .sq4-practice .sq4-practice-meta{
  min-width:0;
  margin:0;
  color:var(--h-muted);
  font-size:12px;
  line-height:1.25;
  white-space:nowrap;
}

.app.v2-app #view .sq4-practice .sq4-practice-action{
  grid-area:action;
  justify-self:end;
  align-self:center;
  margin:0;
  padding:0;
  text-align:right;
}

/* Reset the generic historical .btn geometry inside Practice by out-specificing
   it at the component boundary. This is the permanent size owner. */
.app.v2-app #view .sq4-practice .sq4-practice-action .btn,
.app.v2-app #view .sq4-practice .sq4-practice-action .btn:hover,
.app.v2-app #view .sq4-practice .sq4-practice-action .btn:active{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:auto;
  min-width:84px;
  max-width:108px;
  min-height:32px;
  height:32px;
  margin:0;
  padding:0 12px;
  border-radius:9px;
  font-size:12.5px;
  font-weight:700;
  line-height:1;
  white-space:nowrap;
  transform:none;
}

/* Search results are even denser because their job is scanning, not browsing. */
.app.v2-app #view .sq4-practice .sq4-practice-list.sq4-practice-search-results{
  grid-template-columns:1fr;
  gap:8px;
}

.app.v2-app #view .sq4-practice .sq4-practice-search-results .sq4-practice-row{
  grid-template-columns:58px minmax(0,1fr) auto auto;
  grid-template-areas:"id title meta-one action";
  min-height:0;
  height:auto;
  column-gap:10px;
  row-gap:0;
  padding:10px 12px;
  border-radius:11px;
}

.app.v2-app #view .sq4-practice .sq4-practice-search-results .sq4-practice-id{
  width:58px;
  min-width:58px;
  height:42px;
  min-height:42px;
  padding:4px;
  border-radius:9px;
}
.app.v2-app #view .sq4-practice .sq4-practice-search-results .sq4-practice-title{
  align-self:center;
}
.app.v2-app #view .sq4-practice .sq4-practice-search-results .sq4-practice-title span{
  margin-top:2px;
  -webkit-line-clamp:1;
}
.app.v2-app #view .sq4-practice .sq4-practice-search-results .sq4-practice-action{
  justify-self:end;
  align-self:center;
}


@media(max-width:760px){
  .app.v2-app #view .sq4-practice > .v2-page-head{grid-template-columns:1fr;gap:12px;padding:16px;}
  .app.v2-app #view .sq4-practice > .v2-page-head .v2-page-stats{width:100%;margin-left:0;}
  .app.v2-app #view .sq4-practice > .v2-page-head .v2-page-stat:first-child{border-left:0;}
}

@media(max-width:980px){
  .app.v2-app #view .sq4-practice .sq4-practice-list{grid-template-columns:1fr}
}

@media(max-width:620px){
  .app.v2-app #view .sq4-practice .sq4-practice-row,
  .app.v2-app #view .sq4-practice .sq4-practice-search-results .sq4-practice-row{
    grid-template-columns:56px minmax(0,1fr) auto;
    grid-template-areas:
      "id title title"
      "id meta-one action";
    column-gap:10px;
    row-gap:5px;
    min-height:0;
    height:auto;
    padding:11px 12px;
  }
  .app.v2-app #view .sq4-practice .sq4-practice-id,
  .app.v2-app #view .sq4-practice .sq4-practice-search-results .sq4-practice-id{
    width:56px;
    min-width:56px;
    height:54px;
    min-height:54px;
  }
  .app.v2-app #view .sq4-practice .sq4-practice-row>.sq4-practice-meta:nth-child(4){display:none}
  .app.v2-app #view .sq4-practice .sq4-practice-title strong{font-size:15.5px}
  .app.v2-app #view .sq4-practice .sq4-practice-title span{font-size:12.5px;-webkit-line-clamp:1}
  .app.v2-app #view .sq4-practice .sq4-practice-action .btn,
  .app.v2-app #view .sq4-practice .sq4-practice-action .btn:hover,
  .app.v2-app #view .sq4-practice .sq4-practice-action .btn:active{
    min-width:76px;
    max-width:92px;
    min-height:30px;
    height:30px;
    padding:0 10px;
    font-size:12px;
  }
}

@media(prefers-reduced-motion:reduce){
  .app.v2-app #view .sq4-practice .sq4-practice-row{transition:none}
}
