.ukww-valid--image {
    position: relative;
    top: 0;
    text-align: center;
}

/* Center the valid line at the top; buttons wrap below */
.ukww-card .ukww-tsbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;   /* center the buttons */
  align-items: flex-start;
  padding: 12px;
  gap: 6px 8px;              /* space between buttons */
}

.ukww-card .ukww-tsbar .ukww-valid--tsbar {
  flex: 0 0 100%;            /* full row at the top */
  margin: 0 0 8px 0;
  text-align: center;        /* center the text */
  font-weight: 600;
}



/* ===========================
   UKWW Charts — Clean Styles
   =========================== */

#page-header .navbar {
    display: none !important;
}

/* ----- Page container (soft panel) ----- */
.ukww-charts-wrap{
  max-width: 1400px;
  margin: 0 auto;
  background:#e9f2fa;               /* pale blue */
  border-radius: 18px;
  padding: 26px 28px;
  box-shadow: 0 12px 28px rgba(16,24,40,.08), 0 2px 6px rgba(16,24,40,.06);
    margin-top: 10px;
}
.ukww-charts-title {
    font-size: 2.1rem;
    font-weight: 800;
    color: #184b78;
    margin: 4px 0 18px;
    text-align: center;
}

/* ----- Top model tabs (UKMO etc.) as pills ----- */
.ukww-tabbar{
  display:flex; gap:8px; list-style:none;
  padding:0; margin:0 0 14px;
}
.ukww-tabbar .tab a{
  display:inline-block; padding:6px 12px; border-radius: 12px;
  border:1px solid #cfe0ef; background:#f4f8fc; color:#1f466b; text-decoration:none;
  box-shadow: 0 1px 0 rgba(17, 24, 39, .04) inset;
}
.ukww-tabbar .tab.active a{
  background:#e6f0ff; border-color:#a7c1e0; font-weight:700;
}

/* ----- In-tab switches (Surface/Temp/Cloud/Precip) ----- */
.ukww-switchbar{
  display:flex; flex-wrap:wrap; gap:12px;
  margin: 6px 0 18px;
}
.ukww-switch{
  appearance:none; border:1px solid #cfe0ef; background:#f4f8fc; color:#193c57;
  padding:6px 14px; border-radius: 12px; font-size:1.05rem; cursor:pointer;
  transition: transform .05s ease, background .15s ease, border-color .15s ease;
  box-shadow: 0 1px 0 rgba(17, 24, 39, .04) inset;
}
.ukww-switch:hover{ transform: translateY(-1px); background:#eef6ff; }
.ukww-switch.active{ background:#e6f0ff; border-color:#a7c1e0; font-weight:700; }

/* ----- Panels / grid ----- */
.ukww-panel{ display:none; }
.ukww-panel.active{ display:block; }

.ukww-group-title {
    color: #184b78;
    font-weight: 600;
    letter-spacing: .01em;
    margin: 4px 0 10px;
    text-transform: uppercase;
    text-align: center;
    font-size: 24px;
}

.ukww-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap:16px;
}

/* If a panel has only one card, make it full-width (bigger map) */
.ukww-group.single .ukww-grid{ grid-template-columns: 1fr; }

/* ----- Card (map tile) ----- */
.ukww-card{
  background:#8bb7d3;
  border:1px solid #e6edf5;
  border-radius: 16px;
  padding: 14px;
  width: 80%;
  height: auto;
  margin: 0 auto;
  box-shadow: 0 6px 18px rgba(16,24,40,.06);
}
.ukww-card-title {
    font-weight: 700;
    color: #173b58;
    margin-top: 10px;
    text-align: center;
    font-size: 18px;
    text-transform: none;
}
.ukww-card-attrib {
    color: #5b6b7b;
    font-size: 12px;
    text-align: center;
}

/* ----- Image sizing (80% width & centered) ----- */
/* Single-image cards */
.ukww-card > img{
  width: 50%;
  height: auto;
  margin: 0 auto;
  display: block;
  border-radius:12px;
}

/* Layered-image cards: shrink the container, layers fill it */
.ukww-layerbox{
  position: relative;
  width: 100%;
  margin: 0 auto;
}
.ukww-layerbox .ukww-layer{
  width:100%;
  height:auto;
  display:block;
  border-radius:12px;
}
.ukww-layerbox .ukww-layer.overlay{
  position:absolute; inset:0;
  mix-blend-mode:multiply; opacity:.75; pointer-events:none; z-index:2;
}

/* ----- Time-step buttons (under map) ----- */
.ukww-tsbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0 6px;
    background-color: #ffffff;
    padding: 25px;
    align-content: center;
    border-radius: 12px;
}
.ukww-ts{
  appearance:none; border:1px solid #cfe0ef; background:#f6f9fc; color:#1d4b72;
  padding:0px 0x; border-radius: 8px; font-size:.8rem; cursor:pointer;
}
.ukww-ts:hover{ background:#eef6ff; }
.ukww-ts.active{ background:#e6f0ff; border-color:#a7c1e0; font-weight:700; }

/* ----- Optional: style the “Charts” navbar link as a pill ----- */
#page-header a[href*="charts"]{
  display:inline-block; padding:6px 14px; border-radius:12px;
  border:1px solid #cfe0ef; background:#f4f8fc; color:#184b78 !important;
  font-weight:600; transition: background .15s ease, border-color .15s ease;
}
#page-header a[href*="charts"]:hover{ background:#eef6ff; border-color:#a7c1e0; }

/* ----- Responsive tweaks ----- */
@media (max-width: 900px){
  .ukww-grid{ grid-template-columns: 1fr; }
  .ukww-card > img, .ukww-layerbox{ width: 100%; } /* use full width on small screens */
}

/* Run bar */
.ukww-runbar{
  display:flex;
  gap:.5rem;
  align-items:center;
  margin:8px 0 12px;
}

/* Pills (supports both class names just in case) */
.ukww-runpill, .ukww-pill{
  border:1px solid var(--ukww-b, #d0d7de);
  background:#fff;
  padding:.35rem .75rem;
  border-radius:9999px;
  cursor:pointer;
  font:600 14px/1.2 system-ui, Segoe UI, Roboto, Arial, sans-serif;
  transition:box-shadow .15s ease, transform .06s ease, background .15s ease, border-color .15s ease;
}

.ukww-runpill:hover, .ukww-pill:hover{
  box-shadow:0 2px 10px rgba(0,0,0,.06);
  transform:translateY(-1px);
}

.ukww-runpill.is-active, .ukww-pill.is-active{
  background:var(--ukww-accent, #0ea5e9);
  color:#fff;
  border-color:transparent;
}

.ukww-runpill:focus-visible, .ukww-pill:focus-visible{
  outline:2px solid var(--ukww-accent, #0ea5e9);
  outline-offset:2px;
}

/* Optional: compact on small screens */
@media (max-width: 540px){
  .ukww-runbar{ flex-wrap:wrap; gap:.4rem; }
  .ukww-runpill, .ukww-pill{ padding:.3rem .65rem; font-weight:700; }
}


.chart-item {
  background:#fff;
  border-radius:12px;
  box-shadow:0 2px 6px rgba(0,0,0,.1);
  margin:16px 0;
  padding:8px;
  overflow:hidden;
}

.chart-item img.chart-layer {
  max-width:100%;
  height:auto;
  display:block;
  margin:0 auto;
}

.chart-title {
  font-weight:600;
  margin:4px 0 8px;
}

.chart-attrib {
  font-size:12px;
  color:#666;
  margin-top:6px;
}


/* Make TS buttons equal width and neat */
.ukww-tsbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  justify-content: center;   /* ✅ centers the whole group */
}

.ukww-ts {
  flex: 0 0 42px;   /* fixed width */
  height: 28px;     /* consistent height */
  font-size: 12px;
  line-height: 1;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #f7f7f7;
  cursor: pointer;
}

.ukww-ts.active {
  background: #0073e6;
  color: #fff;
  border-color: #005bb5;
}

.ukww-tsbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  justify-content: center; /* center group */
}

.ukww-ts {
    flex: 0 0 24px;
    height: 28px;
    font-size: 8px;
    line-height: 15px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f7f7f7;
    cursor: pointer;
}
.ukww-ts.active {
  background: #0073e6;
  color: #fff;
  border-color: #005bb5;
}

/* Controls */
.ukww-tscontrols {
  display: flex;
  align-items: center;
  justify-content: center;   /* center as a group */
  gap: 8px;
  margin: 8px 0 4px;
  flex-wrap: wrap;
}
.ukww-tscontrols .ukww-step,
.ukww-tscontrols .ukww-play {
  min-width: 36px;
  height: 28px;
  border: 1px solid #ccc;
  background: #fafafa;
  border-radius: 4px;
  cursor: pointer;
  line-height: 26px;
}
.ukww-tscontrols .ukww-play.is-playing {
  background: #e7f4ff;
  border-color: #68aef3;
}
.ukww-speedwrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.ukww-speed {
  height: 28px;
}

.ukww-ts.is-active{
  background: #1a4d80;
  color: #fff;
  outline: none;
}
.ukww-ts[aria-pressed="true"]{ /* accessibility-friendly fallback */
  background: #1a4d80;
  color: #fff;
}

/* ============ UKWW: polished pills & segmented control (overrides) ============ */
:root{
  --ukww-primary: #1a4d80;
  --ukww-text: #1d3557;
  --ukww-pill-bg: #f4f7fb;
  --ukww-pill-bd: #d9e3f0;
  --ukww-pill-hover: #e9f1fa;
  --ukww-ring: rgba(26,77,128,.28);
}

/* Top model tabs (UKMO/GFS/ECM) */
.ukww-tabbar .tab > a{
  display:inline-flex; align-items:center; justify-content:center;
  height:34px; padding:0 .9rem;
  background:var(--ukww-pill-bg);
  border:1px solid var(--ukww-pill-bd);
  border-radius:9999px;
  color:var(--ukww-text);
  font-weight:600; text-decoration:none;
  transition:background .18s ease, border-color .18s ease, transform .12s ease, box-shadow .18s ease;
}
.ukww-tabbar .tab > a:hover{ background:var(--ukww-pill-hover); transform:translateY(-1px); }
.ukww-tabbar .tab > a:focus-visible{ outline:none; box-shadow:0 0 0 3px var(--ukww-ring); }
.ukww-tabbar .tab.active > a{
  background:var(--ukww-primary); border-color:var(--ukww-primary); color:#fff;
  box-shadow:0 6px 14px rgba(0,0,0,.10), inset 0 -1px 0 rgba(255,255,255,.15);
}

/* Group switches (MSLP / Temperature / Cloud / Precip) */
.ukww-switch{
  appearance:none; border:1px solid var(--ukww-pill-bd);
  background:var(--ukww-pill-bg); color:var(--ukww-text);
  height:34px; padding:0 .95rem; border-radius:9999px; cursor:pointer;
  font-weight:700; font-size:14px; line-height:1;
  transition:background .18s ease, border-color .18s ease, transform .12s ease, box-shadow .18s ease;
}
.ukww-switch:hover{ background:var(--ukww-pill-hover); transform:translateY(-1px); }
.ukww-switch:focus-visible{ outline:none; box-shadow:0 0 0 3px var(--ukww-ring); }
.ukww-switch.active{
  background:var(--ukww-primary); border-color:var(--ukww-primary); color:#fff;
  box-shadow:0 6px 14px rgba(0,0,0,.10), inset 0 -1px 0 rgba(255,255,255,.15);
}

/* 00z / 12z segmented control */
.ukww-runbar{
  display:inline-flex; align-items:center; gap:0;
  border:1px solid var(--ukww-pill-bd);
  border-radius:10px; overflow:hidden; background:#f6f9ff;
  margin:.25rem 0 1.25rem;
}
.ukww-runpill{
  appearance:none; border:0; background:transparent; cursor:pointer;
  padding:.45rem .75rem; font-weight:700; font-size:14px; color:var(--ukww-text);
  line-height:1; transition:background .18s ease;
  border-radius:0;                    /* overrides earlier pill rounding */
}
.ukww-runpill + .ukww-runpill{ border-left:1px solid var(--ukww-pill-bd); }
.ukww-runpill:hover{ background:var(--ukww-pill-hover); }
.ukww-runpill:focus-visible{ outline:none; box-shadow: inset 0 0 0 2px var(--ukww-ring); }
.ukww-runpill.is-active,
.ukww-runpill[aria-pressed="true"]{
  background:var(--ukww-primary); color:#fff;
}

/* Small-screen tweak */
@media (max-width:700px){
  .ukww-tabbar .tab > a,
  .ukww-switch{ height:32px; padding:0 .75rem; font-size:13px; }
}
@media (prefers-reduced-motion: reduce){
  .ukww-tabbar .tab > a, .ukww-switch, .ukww-runpill{ transition:none; }
}

/* Tabs disabled state */
.ukww-tabbar .tab.disabled {
  opacity: .5;
  cursor: default;
}
.ukww-tabbar .tab.disabled a {
  pointer-events: none;
}

/* Group switch disabled */
.ukww-switch[disabled],
.ukww-switch[aria-disabled="true"] {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Run pill disabled (optional) */
.ukww-runpill[disabled],
.ukww-runpill[aria-disabled="true"] {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Tabs disabled state */
.ukww-tabbar .tab.disabled { opacity:.5; cursor:default; }
.ukww-tabbar .tab.disabled a { pointer-events:none; }

/* Group switch disabled */
.ukww-switch[disabled],
.ukww-switch[aria-disabled="true"] {
  opacity:.5; cursor:not-allowed; pointer-events:none;
}

/* Run pill disabled (optional) */
.ukww-runpill[disabled],
.ukww-runpill[aria-disabled="true"] {
  opacity:.5; cursor:not-allowed; pointer-events:none;
}

/* Center the Valid line above TS buttons */
.ukww-card .ukww-tsbar {
  display:flex; flex-wrap:wrap; justify-content:center; align-items:flex-start;
  padding:12px; gap:6px 8px;
}
.ukww-card .ukww-tsbar .ukww-valid--tsbar {
  flex:0 0 100%; margin:0 0 8px 0; text-align:center; font-weight:600;
}

