/* Sprint148 - Enterprise/Finance API UX comfort layer
   Purpose: make official API fields readable and touch-friendly on desktop/mobile.
   Scope-limited to official API and enterprise finance panels. No calculator formula changes. */

:root{
  --s148-field-bg:#ffffff;
  --s148-field-bg-2:#f8fbff;
  --s148-text:#0b1220;
  --s148-muted:#475569;
  --s148-line:#c9d5e5;
  --s148-primary:#2563eb;
  --s148-accent:#14b8a6;
  --s148-focus:rgba(37,99,235,.16);
}
html[data-theme="dark"], html.dark, body.dark{
  --s148-field-bg:#0f1b2d;
  --s148-field-bg-2:#14243a;
  --s148-text:#f8fafc;
  --s148-muted:#cbd5e1;
  --s148-line:#3d516c;
  --s148-primary:#60a5fa;
  --s148-accent:#2dd4bf;
  --s148-focus:rgba(96,165,250,.22);
}

/* Official API panel: give it a stable, readable surface. */
.s131-official-panel,
.s146-enterprise-shell{
  color:var(--s148-text)!important;
  border-color:var(--s148-line)!important;
}
.s131-official-panel *,
.s146-enterprise-shell *{
  box-sizing:border-box;
}

/* Desktop: wider, calmer API cards. */
.s131-official-panel .s131-api-query-card,
.s131-official-panel .s142-fsc-card,
.s146-enterprise-shell .s146-api-card{
  border-color:var(--s148-line)!important;
  background:var(--s148-field-bg-2)!important;
  color:var(--s148-text)!important;
  border-radius:20px!important;
  padding:18px!important;
}
.s131-official-panel .s131-api-query-card > strong,
.s131-official-panel .s142-fsc-card > strong,
.s146-enterprise-shell .s146-api-card > h3,
.s146-enterprise-shell .s146-api-card > strong{
  display:block;
  color:var(--s148-text)!important;
  -webkit-text-fill-color:var(--s148-text)!important;
  font-size:16px!important;
  line-height:1.35!important;
  font-weight:950!important;
  margin-bottom:6px!important;
}
.s131-official-panel .s131-api-query-card span,
.s131-official-panel .s142-fsc-card span,
.s131-official-panel .s142-help,
.s146-enterprise-shell .s146-api-card p,
.s146-enterprise-shell .s146-api-card small{
  color:var(--s148-muted)!important;
  -webkit-text-fill-color:var(--s148-muted)!important;
  font-weight:740!important;
  line-height:1.55!important;
}

/* Make all official API fields readable and easy to tap. */
.s131-official-panel input,
.s131-official-panel select,
.s146-enterprise-shell input,
.s146-enterprise-shell select,
.s142-fsc-row input,
.s142-fsc-name-input,
.s142-fsc-options input,
.s142-fsc-options select,
#s131-bno,
#s140-dart-search,
#s131-corp-code,
#s140-dart-year,
#s140-dart-report,
#s140-dart-fs,
#s142-fsc-company-name,
#s142-fsc-crno,
#s142-fsc-year,
#s142-fsc-type{
  width:100%!important;
  min-height:54px!important;
  height:auto!important;
  border:1px solid var(--s148-line)!important;
  border-radius:16px!important;
  padding:14px 16px!important;
  background:var(--s148-field-bg)!important;
  color:var(--s148-text)!important;
  -webkit-text-fill-color:var(--s148-text)!important;
  font-size:16px!important;
  font-weight:850!important;
  line-height:1.35!important;
  letter-spacing:-.01em;
  box-shadow:none!important;
  appearance:auto;
}
.s131-official-panel input::placeholder,
.s146-enterprise-shell input::placeholder,
.s142-fsc-row input::placeholder,
.s142-fsc-name-input::placeholder,
#s131-bno::placeholder,
#s140-dart-search::placeholder,
#s142-fsc-crno::placeholder{
  color:#718096!important;
  -webkit-text-fill-color:#718096!important;
  opacity:1!important;
  font-weight:700!important;
}
html[data-theme="dark"] .s131-official-panel input::placeholder,
html[data-theme="dark"] .s146-enterprise-shell input::placeholder,
html.dark .s131-official-panel input::placeholder,
body.dark .s131-official-panel input::placeholder{
  color:#94a3b8!important;
  -webkit-text-fill-color:#94a3b8!important;
}
.s131-official-panel input:focus,
.s131-official-panel select:focus,
.s146-enterprise-shell input:focus,
.s146-enterprise-shell select:focus,
#s131-bno:focus,
#s140-dart-search:focus,
#s142-fsc-crno:focus{
  outline:none!important;
  border-color:var(--s148-primary)!important;
  box-shadow:0 0 0 4px var(--s148-focus)!important;
}

/* Labels must be visible. */
.s131-official-panel label,
.s146-enterprise-shell label,
.s142-fsc-options label{
  color:var(--s148-text)!important;
  -webkit-text-fill-color:var(--s148-text)!important;
  font-weight:950!important;
  font-size:13px!important;
  line-height:1.35!important;
  margin:12px 0 7px!important;
}

/* Button area: bigger hit target. */
.s131-official-panel button,
.s146-enterprise-shell button,
.s142-fsc-row button,
.s142-fsc-card button[data-s142-api],
[data-s131-api],
[data-s142-api],
[data-s146-api]{
  min-height:54px!important;
  border-radius:16px!important;
  padding:0 18px!important;
  font-size:15px!important;
  font-weight:950!important;
  white-space:nowrap!important;
}
.s131-api-row,
.s142-fsc-row,
.s146-api-row{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  gap:10px!important;
  align-items:end!important;
}
.s142-fsc-options,
.s146-api-two{
  gap:12px!important;
}

/* Helper text inserted by Sprint148 JS. */
.s148-input-help{
  display:block;
  margin:6px 2px 0;
  color:var(--s148-muted)!important;
  -webkit-text-fill-color:var(--s148-muted)!important;
  font-size:12px!important;
  font-weight:760!important;
  line-height:1.45!important;
}
.s148-input-help strong{color:var(--s148-text)!important;-webkit-text-fill-color:var(--s148-text)!important;}

/* Results inside official API panel should not be tiny. */
.s131-official-panel .s131-api-result,
.s131-official-panel .s142-fsc-result,
.s146-enterprise-shell .s146-api-result,
.s140-fin-summary,
.s142-fsc-summary{
  font-size:14px!important;
  line-height:1.6!important;
  color:var(--s148-text)!important;
  -webkit-text-fill-color:var(--s148-text)!important;
  border-color:var(--s148-line)!important;
  background:var(--s148-field-bg)!important;
}
.s131-official-panel .s131-api-result[data-ok="true"],
.s131-official-panel .s142-fsc-result[data-ok="true"],
.s146-enterprise-shell .s146-api-result[data-ok="true"]{
  background:rgba(20,184,166,.12)!important;
  color:var(--s148-text)!important;
  border-color:rgba(20,184,166,.5)!important;
}

/* Dedicated enterprise hub: more balanced grid. */
.s146-enterprise-grid{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:16px!important;
}
.s146-enterprise-grid .s146-api-card:nth-child(3){
  grid-column:1 / -1;
}

/* Summary cards should not squeeze content. */
.s140-fin-grid,
.s142-fsc-grid{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:10px!important;
}
.s140-fin-card,
.s142-fsc-kpi,
.s146-fin-grid div{
  min-height:72px!important;
  padding:13px!important;
  background:var(--s148-field-bg-2)!important;
  color:var(--s148-text)!important;
  border-color:var(--s148-line)!important;
}
.s140-fin-card strong,
.s142-fsc-kpi strong,
.s146-fin-grid strong{
  color:var(--s148-text)!important;
  -webkit-text-fill-color:var(--s148-text)!important;
  font-size:16px!important;
  overflow-wrap:anywhere;
}
.s140-fin-card span,
.s142-fsc-kpi span,
.s146-fin-grid span{
  color:var(--s148-muted)!important;
  -webkit-text-fill-color:var(--s148-muted)!important;
}

/* Mobile comfort: one column, full width buttons, no tiny input cards. */
@media(max-width: 760px){
  .s131-official-panel,
  .s146-enterprise-shell{
    margin:14px 0!important;
    padding:14px!important;
    border-radius:18px!important;
  }
  .s131-official-head{
    display:block!important;
  }
  .s131-official-date{
    display:inline-flex!important;
    margin-top:8px!important;
  }
  .s131-official-grid,
  .s146-enterprise-grid,
  .s142-fsc-options,
  .s146-api-two,
  .s140-fin-grid,
  .s142-fsc-grid,
  .s146-fin-grid{
    grid-template-columns:1fr!important;
  }
  .s146-enterprise-grid .s146-api-card:nth-child(3){
    grid-column:auto!important;
  }
  .s131-api-row,
  .s142-fsc-row,
  .s146-api-row{
    grid-template-columns:1fr!important;
  }
  .s131-official-panel button,
  .s146-enterprise-shell button,
  .s142-fsc-row button,
  [data-s131-api],
  [data-s142-api],
  [data-s146-api]{
    width:100%!important;
  }
  .s131-official-panel input,
  .s131-official-panel select,
  .s146-enterprise-shell input,
  .s146-enterprise-shell select,
  #s131-bno,
  #s140-dart-search,
  #s131-corp-code,
  #s142-fsc-company-name,
  #s142-fsc-crno,
  #s142-fsc-year{
    min-height:58px!important;
    font-size:17px!important;
  }
  .s131-official-panel .s131-api-query-card,
  .s131-official-panel .s142-fsc-card,
  .s146-enterprise-shell .s146-api-card{
    padding:15px!important;
    border-radius:18px!important;
  }
}
