/* ==========================================================
   HTTP STATUS TOOL — CLEAN PROTOTYPE STYLES
   ========================================================== */

/* Tool workspace */

main[data-vital-tool-page="true"] .tool-box-with-star{
  position:relative;
}

main[data-vital-tool-page="true"] .tool-box-with-star.tool-box-with-star{
  padding:28px !important;
}

main[data-vital-tool-page="true"] .tool-box-with-star .vital-tool-heading-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:20px;
  margin:0 0 20px;
}

main[data-vital-tool-page="true"] .tool-box-with-star .vital-tool-panel-title{
  position:static;
  flex:1;
  margin:0;
  padding:0;
  color:var(--text, #172238);
  font-size:clamp(1.35rem, 2vw, 1.7rem);
  font-weight:700;
  line-height:1.25;
  letter-spacing:-0.025em;
}

main[data-vital-tool-page="true"] .tool-box-with-star .vital-tool-heading-row .tool-star-widget{
  position:static;
  flex:0 0 auto;
  margin:0;
}



/* Sharing controls */

main[data-vital-tool-page="true"] .tool-box-with-star .vital-share-box{
  position:relative;
  width:100%;
  margin:22px 0 0;
}

main[data-vital-tool-page="true"] .tool-box-with-star .vital-share-heading{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  position:static;
  padding:0;
}

main[data-vital-tool-page="true"] .tool-box-with-star .vital-share-toggle,
main[data-vital-tool-page="true"] .tool-box-with-star .vital-share-options a,
main[data-vital-tool-page="true"] .tool-box-with-star .vital-share-options button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:44px;
  padding:10px 15px;
  border:1px solid #b7c9db;
  border-radius:10px;
  background:#fff;
  color:#273349;
  font:inherit;
  font-size:.9rem;
  text-decoration:none;
  cursor:pointer;
}

main[data-vital-tool-page="true"] .tool-box-with-star .vital-share-toggle:hover,
main[data-vital-tool-page="true"] .tool-box-with-star .vital-share-options a:hover,
main[data-vital-tool-page="true"] .tool-box-with-star .vital-share-options button:hover{
  background:#f2f8ff;
  border-color:#2f80ed;
}

main[data-vital-tool-page="true"] .tool-box-with-star .vital-share-toggle:focus-visible,
main[data-vital-tool-page="true"] .tool-box-with-star .vital-share-options a:focus-visible,
main[data-vital-tool-page="true"] .tool-box-with-star .vital-share-options button:focus-visible{
  outline:3px solid #2f80ed;
  outline-offset:3px;
}

main[data-vital-tool-page="true"] .tool-box-with-star .vital-share-options{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin:14px 0 18px;
}

main[data-vital-tool-page="true"] .tool-box-with-star .vital-share-options[hidden]{
  display:none;
}

main[data-vital-tool-page="true"] .tool-box-with-star .vital-share-feedback{
  margin:8px 0 12px;
  font-size:.85rem;
}

main[data-vital-tool-page="true"] .tool-box-with-star .vital-share-feedback:empty{
  display:none;
}

/* Bookmark */

.tool-bookmark-control .tool-bookmark-button{
  background:#fff !important;
  color:#273349 !important;
  border-color:#b7c9db !important;
}

html[data-theme="dark"] .tool-bookmark-control .tool-bookmark-button{
  background:#fff !important;
  color:#273349 !important;
  border-color:#b7c9db !important;
}

.tool-bookmark-control .tool-bookmark-button:hover{
  background:#f2f8ff !important;
}

.vital-bookmark-gold-star{
  color:#e3a000;
  font-size:1.1em;
  font-weight:700;
}

/* Blue star support section */

main[data-vital-tool-page="true"]
> .vital-star-support-band.section{
  margin-top:32px;
  padding-top:48px !important;
  padding-bottom:48px !important;
}

.vital-star-support-band .container{
  padding-top:0;
  padding-bottom:0;
}

.vital-star-support-band .tool-support-box{
  width:100%;
  max-width:1100px;
  margin:0 auto;
  padding:0 !important;
  background:transparent !important;
  border:0 !important;
  border-radius:0 !important;
  box-shadow:none !important;
}

.vital-star-support-band .vital-inline-yellow-star{
  color:#f5b400;
  font-weight:800;
}

/* Report an issue */

.vital-tool-report-issue{
  padding:48px 0 56px;
  text-align:center;
}

.vital-tool-report-issue .container{
  max-width:850px;
}

.vital-tool-report-issue h2{
  margin:0 0 14px;
}

.vital-tool-report-issue p{
  margin:0 auto 24px;
  max-width:680px;
}

.vital-tool-report-issue .vital-report-issue-button{
  display:inline-flex;
  align-items:center;
  gap:10px;
  margin-top:0;
  padding:10px 18px;
  background:#fff;
  border:1px solid #b8d0ed;
  border-radius:10px;
  color:#1769d2;
  font-weight:700;
  text-decoration:none;
  transition:background .16s ease, border-color .16s ease;
}

.vital-tool-report-issue .vital-report-issue-button:hover{
  background:#f2f8ff;
  border-color:#83b4f2;
  color:#0f5ebd;
  text-decoration:none;
}

.vital-tool-report-issue .vital-report-issue-button:focus-visible{
  outline:3px solid #348bff;
  outline-offset:3px;
}

html[data-theme="dark"]
.vital-tool-report-issue .vital-report-issue-button{
  background:#172b40;
  border-color:#42658c;
  color:#9cc9ff;
}

html[data-theme="dark"]
.vital-tool-report-issue .vital-report-issue-button:hover{
  background:#203b57;
}

/* Responsive adjustments */

@media(max-width:620px){

  main[data-vital-tool-page="true"] .tool-box-with-star.tool-box-with-star{
    padding:22px !important;
  }

  main[data-vital-tool-page="true"] .tool-box-with-star .vital-tool-heading-row{
    flex-direction:column;
    align-items:stretch;
    gap:14px;
    margin-bottom:20px;
    min-width:0;
  }

  main[data-vital-tool-page="true"] .tool-box-with-star .vital-tool-heading-row .tool-star-widget{
    align-self:flex-start;
    align-items:flex-start;
    width:auto;
    max-width:100%;
    margin:0;
  }

  main[data-vital-tool-page="true"] .tool-box-with-star .vital-tool-heading-row .tool-star-count{
    padding-left:0;
  }

  main[data-vital-tool-page="true"] .tool-box-with-star .vital-tool-panel-title{
    font-size:1.35rem;
  }

  main[data-vital-tool-page="true"] .tool-box-with-star .vital-share-options{
    gap:10px;
    min-width:0;
  }

  main[data-vital-tool-page="true"] .tool-box-with-star .vital-share-options
  :is(a,button)[data-share="copy"],
  main[data-vital-tool-page="true"] .tool-box-with-star .vital-share-options
  :is(a,button)[data-share="native"]{
    flex:0 1 auto;
    max-width:100%;
  }

  main[data-vital-tool-page="true"] .tool-box-with-star .vital-share-options
  :is(a,button)[data-share="linkedin"],
  main[data-vital-tool-page="true"] .tool-box-with-star .vital-share-options
  :is(a,button)[data-share="facebook"],
  main[data-vital-tool-page="true"] .tool-box-with-star .vital-share-options
  :is(a,button)[data-share="x"],
  main[data-vital-tool-page="true"] .tool-box-with-star .vital-share-options
  :is(a,button)[data-share="whatsapp"]{
    flex:0 0 48px;
  }

  main[data-vital-tool-page="true"] .tool-box-with-star .vital-share-options{
    margin-bottom:16px;
  }

  main[data-vital-tool-page="true"]
  > .vital-star-support-band.section{
    margin-top:24px;
    padding-top:32px !important;
    padding-bottom:32px !important;
  }

  .vital-tool-report-issue{
    padding:36px 0 44px;
  }
}

/* Locally embedded sharing SVGs */
main[data-vital-tool-page="true"] .tool-box-with-star .vital-share-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:20px;
  height:20px;
  flex:0 0 20px;
}

main[data-vital-tool-page="true"] .tool-box-with-star .vital-share-icon svg{
  display:block;
  width:20px;
  height:20px;
}

main[data-vital-tool-page="true"] .tool-box-with-star .vital-share-options
:is(a,button)[data-share="linkedin"],
main[data-vital-tool-page="true"] .tool-box-with-star .vital-share-options
:is(a,button)[data-share="facebook"],
main[data-vital-tool-page="true"] .tool-box-with-star .vital-share-options
:is(a,button)[data-share="x"],
main[data-vital-tool-page="true"] .tool-box-with-star .vital-share-options
:is(a,button)[data-share="whatsapp"]{
  width:48px;
  min-width:48px;
  padding:10px;
  flex:0 0 48px;
}


/* VITAL TOOL STAR COLOUR — APPROVED */

/* Yellow star inside the hero bookmark button */
html body .tool-bookmark-control
.tool-bookmark-button .vital-bookmark-star {
  color: #eab308 !important;
  -webkit-text-fill-color: #eab308 !important;
  opacity: 1 !important;
}

/* Yellow star inside the workspace Star this tool button */
html body main[data-vital-tool-page="true"]
.tool-star-widget .tool-star-button .tool-star-symbol {
  color: #eab308 !important;
  -webkit-text-fill-color: #eab308 !important;
  opacity: 1 !important;
}

/* Preserve yellow star in blue support band */
html body .vital-star-support-band .vital-inline-yellow-star {
  color: #facc15 !important;
  -webkit-text-fill-color: #facc15 !important;
}


/* =====================================================
   Shared tool-page prototypes
   ===================================================== */

/* Consistent top Star widget placement without moving
   existing functional workspace elements. */
main[data-vital-tool-page="true"] .tool-box-with-star {
  position: relative;
}

/* Keep the existing star control visible on all tools. */
main[data-vital-tool-page="true"]
.tool-box-with-star > .tool-star-widget {
  position: static;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px auto;
  width: fit-content;
}

/* Approved yellow stars */
main[data-vital-tool-page="true"]
.tool-star-widget .tool-star-symbol {
  color: #eab308 !important;
  -webkit-text-fill-color: #eab308 !important;
  opacity: 1 !important;
}

main[data-vital-tool-page="true"]
.tool-bookmark-button .vital-bookmark-star {
  color: #eab308 !important;
  -webkit-text-fill-color: #eab308 !important;
}

main[data-vital-tool-page="true"]
.vital-star-support-band .vital-inline-yellow-star {
  color: #facc15 !important;
}

/* Sharing stays at the bottom of the tool workspace. */
main[data-vital-tool-page="true"]
.tool-box-with-star > .vital-share-box {
  margin-top: 28px;
  clear: both;
}

@media (max-width: 760px) {
  main[data-vital-tool-page="true"]
  .tool-box-with-star > .tool-star-widget {
    margin: 0 0 20px;
    max-width: 100%;
  }

  main[data-vital-tool-page="true"]
  .tool-box-with-star > .vital-share-box {
    margin-top: 22px;
  }
}


/* VITAL TOOL TEXT CLEARANCE — BULK */

/*
 * Reserve the right-hand area for the Star button
 * and its counter. Keep introductory text clear.
 */

@media (min-width: 761px) {

  main[data-vital-tool-page="true"]
  .tool-box-with-star {
    position: relative;
  }

  main[data-vital-tool-page="true"]
  .tool-box-with-star > .tool-star-widget {
    position: absolute;
    top: 28px;
    right: 28px;
    z-index: 2;
    margin: 0;
  }

  /*
   * Restrict headings and introductory paragraphs,
   * not forms, buttons, results or other workspaces.
   */
  main[data-vital-tool-page="true"]
  .tool-box-with-star > h2:first-of-type,

  main[data-vital-tool-page="true"]
  .tool-box-with-star > h2:first-of-type + p,

  main[data-vital-tool-page="true"]
  .tool-box-with-star > .image-optimiser-workspace > h2:first-child,

  main[data-vital-tool-page="true"]
  .tool-box-with-star > .image-optimiser-workspace > h2:first-child + p,

  main[data-vital-tool-page="true"]
  .tool-box-with-star > .pdf-optimiser-workspace > h2:first-child,

  main[data-vital-tool-page="true"]
  .tool-box-with-star > .pdf-optimiser-workspace > h2:first-child + p {
    max-width: calc(100% - 235px);
    box-sizing: border-box;
  }

  /*
   * The text area remains independent from
   * the absolute-positioned Star widget.
   */
}

/* Narrow screens: normal document flow. */
@media (max-width: 760px) {

  main[data-vital-tool-page="true"]
  .tool-box-with-star > .tool-star-widget {
    position: static;
    margin: 0 0 18px;
  }

  main[data-vital-tool-page="true"]
  .tool-box-with-star > h2:first-of-type,

  main[data-vital-tool-page="true"]
  .tool-box-with-star > h2:first-of-type + p,

  main[data-vital-tool-page="true"]
  .tool-box-with-star > .image-optimiser-workspace > h2:first-child,

  main[data-vital-tool-page="true"]
  .tool-box-with-star > .image-optimiser-workspace > h2:first-child + p,

  main[data-vital-tool-page="true"]
  .tool-box-with-star > .pdf-optimiser-workspace > h2:first-child,

  main[data-vital-tool-page="true"]
  .tool-box-with-star > .pdf-optimiser-workspace > h2:first-child + p {
    max-width: 100%;
  }
}


/* VITAL INTRO TEXT BOUNDARY — FINAL */
@media (min-width: 761px) {
  main[data-vital-tool-page="true"]
  .tool-box-with-star .image-optimiser-workspace > h2 + p,
  main[data-vital-tool-page="true"]
  .tool-box-with-star .pdf-optimiser-workspace > h2 + p,
  main[data-vital-tool-page="true"]
  .tool-box-with-star > h2 + p {
    width: calc(100% - 250px) !important;
    max-width: calc(100% - 250px) !important;
    box-sizing: border-box;
  }
}


/* FINAL TWO TOOLS — DARK MODE CONTRAST */

/* Only the two exceptional prototype pages */
html[data-theme="dark"]
main[data-vital-tool-page="true"]
:is(#tool-ip-lookup, .density-tool-shell) {
  background: #192d43 !important;
  border: 1px solid #35516d !important;
  color: #e7eef7 !important;
}

/* Workspace headings and field labels */
html[data-theme="dark"]
main[data-vital-tool-page="true"]
:is(#tool-ip-lookup, .density-tool-shell)
:is(.vital-tool-workspace-heading, label, label strong) {
  color: #f1f6fc !important;
}

/* Supporting and explanatory text */
html[data-theme="dark"]
main[data-vital-tool-page="true"]
:is(#tool-ip-lookup, .density-tool-shell)
:is(.tool-help, .field-note) {
  color: #b5c6d9 !important;
}

/* Text inputs and textareas */
html[data-theme="dark"]
main[data-vital-tool-page="true"]
:is(#tool-ip-lookup, .density-tool-shell)
:is(input, textarea) {
  background: #102238 !important;
  color: #f1f6fc !important;
  border-color: #45617e !important;
}

/* Placeholder contrast */
html[data-theme="dark"]
main[data-vital-tool-page="true"]
:is(#tool-ip-lookup, .density-tool-shell)
:is(input, textarea)::placeholder {
  color: #a0b2c7 !important;
  opacity: 1;
}

/* Keyword Density inner form panel */
html[data-theme="dark"]
main[data-vital-tool-page="true"]
.density-tool-shell
:is(.density-form, [data-density-panel]) {
  background: #192d43 !important;
  border-color: #35516d !important;
  color: #e7eef7 !important;
}

/* Result panels */
html[data-theme="dark"]
main[data-vital-tool-page="true"]
:is(#tool-ip-lookup, .density-tool-shell)
.tool-result {
  background: #102238 !important;
  border-color: #35516d !important;
  color: #e7eef7 !important;
}

/* Preserve readable Star counters */
html[data-theme="dark"]
main[data-vital-tool-page="true"]
:is(#tool-ip-lookup, .density-tool-shell)
.tool-star-count {
  color: #a9c2dd !important;
}
