/* ─────────────────────────────────────────────────────────────────────────
   ULTRA CONNECTED — Component layer
   Built on top of ucag-tokens.css.
   Imports are NOT required; this file only uses the design tokens defined
   in ucag-tokens.css (--ink, --paper, --tide, --brand-gradient, …).

   Conventions
   ─ Semantic colors used here (kept as raw hex so they stay decoupled from
     the neutral palette in tokens):
       Positive   #2A9D6A → #1F8A5B  (success)
       Challenge  #E08A3C → #C77800  (warning)
       Brand      var(--tide) → var(--brand-magenta)
   ───────────────────────────────────────────────────────────────────────── */


/* ─────────────────────────────────────────────────────────────────────────
   1 ─ Icon system
   Usage:
     <svg class="ico"><use href="#ico-sparkle"/></svg>
     <span class="ico-chip pos">
       <svg class="ico"><use href="#ico-trend-up"/></svg>
     </span>
   ───────────────────────────────────────────────────────────────────────── */

.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.ico {
  width: 22px; height: 22px;
  display: inline-block;
  vertical-align: -4px;
  flex: none;
  stroke-width: 1.8;
}
.ico-lg { width: 40px; height: 40px; }
.ico-xl { width: 56px; height: 56px; }

/* Filled-on-circle chip */
.ico-chip {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
  box-shadow:
    0 6px 14px -6px rgba(17,17,19,0.18),
    inset 0 1px 0 rgba(255,255,255,0.18);
}
.ico-chip .ico { width: 28px; height: 28px; color: var(--paper); stroke-width: 2.2; }
.ico-chip.sm  { width: 44px; height: 44px; }
.ico-chip.sm .ico { width: 22px; height: 22px; }
.ico-chip.xs  { width: 36px; height: 36px; }
.ico-chip.xs .ico { width: 18px; height: 18px; }

/* Chip palette — semantic */
.ico-chip.pos   { background: linear-gradient(135deg, #2A9D6A 0%, #1F8A5B 100%); }
.ico-chip.chal  { background: linear-gradient(135deg, #E08A3C 0%, #C77800 100%); }
.ico-chip.act   { background: linear-gradient(135deg, #1F3FA8 0%, #CC1F7A 100%); }
.ico-chip.info  { background: linear-gradient(135deg, #1F3FA8 0%, #4A1B5B 100%); }
.ico-chip.brand { background: var(--brand-gradient); }
.ico-chip.ink   { background: var(--ink); }

/* Soft (low-saturation) variants — for in-card use, where a full-color
   chip would compete with the data. Icon color stays in the family. */
.ico-chip.soft-blue  { background: var(--tide-soft); }
.ico-chip.soft-blue  .ico { color: var(--tide); }
.ico-chip.soft-pos   { background: rgba(31,138,91,0.10); }
.ico-chip.soft-pos   .ico { color: #1F8A5B; }
.ico-chip.soft-chal  { background: rgba(199,120,0,0.10); }
.ico-chip.soft-chal  .ico { color: #C77800; }
.ico-chip.soft-brand { background: rgba(31,63,168,0.08); }
.ico-chip.soft-brand .ico { color: var(--tide); }


/* ─────────────────────────────────────────────────────────────────────────
   2 ─ Data pills
   Small uppercase badges placed next to key numbers ("TOP", "追い風", …).
   Usage:
     <span class="data-pill pos">追い風</span>
     <span class="data-pill chal">課題</span>
     <span class="data-pill brand">本丸</span>
   ───────────────────────────────────────────────────────────────────────── */

.data-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: var(--w-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  background: rgba(255,255,255,0.85);
}
.data-pill::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: var(--r-pill);
  background: currentColor;
}
.data-pill.pos   { color: #1F8A5B;     border-color: rgba(31,138,91,0.35); background: rgba(31,138,91,0.06); }
.data-pill.chal  { color: #C77800;     border-color: rgba(199,120,0,0.40); background: rgba(199,120,0,0.06); }
.data-pill.brand { color: var(--tide); border-color: rgba(31,63,168,0.35); background: rgba(31,63,168,0.06); }


/* ─────────────────────────────────────────────────────────────────────────
   3 ─ Tinted cards
   Base card lives in your kit; these are tint variants applied on top.
   Usage:
     <div class="card tint-pos">…</div>
   ───────────────────────────────────────────────────────────────────────── */

.card {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 40px 44px;
}
.card.flat { background: var(--mist); border: none; }

.card.tint-pos   { background: rgba(31,138,91,0.06);  border-color: rgba(31,138,91,0.22); }
.card.tint-chal  { background: rgba(199,120,0,0.055); border-color: rgba(199,120,0,0.26); }
.card.tint-brand { background: rgba(31,63,168,0.05);  border-color: rgba(31,63,168,0.20); }
.card.tint-mag   { background: rgba(204,31,122,0.04); border-color: rgba(204,31,122,0.18); }


/* ─────────────────────────────────────────────────────────────────────────
   4 ─ 3D bar chart row
   Subtle inset/outset to add depth without losing data clarity.
   Usage:
     <div class="bar-row">
       <div class="name">Label</div>
       <div class="bar-track"><div class="bar-fill tide" style="width:64%"></div></div>
       <div class="pct">64%</div>
     </div>
   ───────────────────────────────────────────────────────────────────────── */

.bar-row {
  display: grid;
  grid-template-columns: 220px 1fr 100px;
  gap: 16px;
  align-items: center;
  padding: 8px 0;
}
.bar-row .name { font-family: var(--font-jp); font-size: 18px; color: var(--ink); font-weight: var(--w-medium); }
.bar-row .pct  { font-family: var(--font-mono); font-size: 18px; color: var(--ink); text-align: right; letter-spacing: 0.02em; }

.bar-track {
  height: 16px;
  background: var(--fog);
  border-radius: var(--r-pill);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(17,17,19,0.08);
}
.bar-fill {
  height: 100%;
  background: var(--ink);
  border-radius: var(--r-pill);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.20),
    0 1px 2px rgba(17,17,19,0.10);
}
.bar-fill.tide,
.bar-fill.brand { background: var(--tide); }
.bar-fill.pos   { background: linear-gradient(95deg, #2A9D6A 0%, #1F8A5B 100%); }
.bar-fill.chal  { background: linear-gradient(95deg, #E08A3C 0%, #C77800 100%); }
.bar-fill.grad  { background: var(--brand-gradient); }


/* ─────────────────────────────────────────────────────────────────────────
   5 ─ Semantic tags (with auto-icon via CSS mask)
   Usage:
     <span class="tag positive">Positive</span>
     <span class="tag challenge">Challenge</span>
     <span class="tag action">Action</span>
   ───────────────────────────────────────────────────────────────────────── */

.tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border: 1px solid currentColor;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: var(--w-semibold);
  letter-spacing: 0.04em;
  background: rgba(255,255,255,0.6);
}
.tag.positive  { color: #1F8A5B;     border-color: rgba(31,138,91,0.30); }
.tag.challenge { color: #C77800;     border-color: rgba(199,120,0,0.35); }
.tag.action    { color: var(--tide); border-color: rgba(31,63,168,0.30); }

.tag::before {
  content: "";
  width: 16px; height: 16px;
  background: currentColor;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-size: contain; mask-size: contain;
  flex: none;
}
.tag.positive::before  {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='3 17 9 11 13 15 21 7'/><polyline points='15 7 21 7 21 13'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='3 17 9 11 13 15 21 7'/><polyline points='15 7 21 7 21 13'/></svg>");
}
.tag.challenge::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3l10 18H2z'/><line x1='12' y1='10' x2='12' y2='14'/><circle cx='12' cy='17' r='.5' fill='black'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3l10 18H2z'/><line x1='12' y1='10' x2='12' y2='14'/><circle cx='12' cy='17' r='.5' fill='black'/></svg>");
}
.tag.action::before    {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><circle cx='12' cy='12' r='5'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><circle cx='12' cy='12' r='5'/></svg>");
}


/* ─────────────────────────────────────────────────────────────────────────
   6 ─ Pill (icon + label)
   For larger category indicators (title slides, legends).
   Usage:
     <span class="pill pos">
       <span class="ico-chip pos"><svg class="ico"><use href="#ico-trend-up"/></svg></span>
       ポジティブ要因
     </span>
   ───────────────────────────────────────────────────────────────────────── */

.pill {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 10px 22px 10px 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  font-family: var(--font-jp);
  font-size: 18px;
  font-weight: var(--w-medium);
  color: var(--ink);
  background: var(--paper);
}
.pill .ico-chip { width: 32px; height: 32px; }
.pill .ico-chip .ico { width: 18px; height: 18px; }


/* ─────────────────────────────────────────────────────────────────────────
   7 ─ Eyebrow with icon
   For section openers, ref-style.
   Usage:
     <span class="eyebrow-icon">
       <span class="ico-chip xs soft-brand"><svg class="ico"><use href="#ico-bulb"/></svg></span>
       INSIGHT
     </span>
   ───────────────────────────────────────────────────────────────────────── */

.eyebrow-icon {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: var(--r-pill);
  background: rgba(31,63,168,0.06);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: var(--w-semibold);
  letter-spacing: 0.06em;
  color: var(--tide);
}


/* ─────────────────────────────────────────────────────────────────────────
   8 ─ Background pattern
   Subtle constellation — dotted base + brand-blue/magenta corner washes.
   Apply with .ucag-bg or directly on a section.
   ───────────────────────────────────────────────────────────────────────── */

.ucag-bg {
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(31,63,168,0.06) 1px, transparent 0),
    radial-gradient(circle at 240px 160px, rgba(204,31,122,0.04) 0, transparent 60%),
    radial-gradient(circle at 80% 90%, rgba(31,63,168,0.04) 0, transparent 55%);
  background-size: 28px 28px, 1920px 1080px, 1920px 1080px;
  background-position: 0 0, 0 0, 0 0;
}
.ucag-bg-mist {
  background-color: var(--mist);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(31,63,168,0.06) 1px, transparent 0),
    radial-gradient(circle at 240px 160px, rgba(204,31,122,0.04) 0, transparent 60%);
  background-size: 28px 28px, 1920px 1080px;
}
.ucag-bg-graphite {
  background-color: var(--graphite);
  color: var(--paper);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.05) 1px, transparent 0),
    radial-gradient(circle at 10% 10%, rgba(31,63,168,0.25) 0, transparent 55%),
    radial-gradient(circle at 90% 90%, rgba(204,31,122,0.20) 0, transparent 60%);
  background-size: 28px 28px, 100% 100%, 100% 100%;
}
