/* =============================================================================
   KoeBox — app-specific styles (layered over base.css)
   accent: emerald (信頼 / 温かみ)
   ========================================================================== */
:root {
  --accent: 162 72% 36%;
  --accent-strong: 162 74% 29%;
  --accent-soft: 160 55% 95%;
  --accent-ink: 0 0% 100%;
  --accent-ring: 162 72% 36% / 0.35;
}
[data-theme="dark"] { --accent-soft: 162 38% 15%; }

/* ---- Landing ---------------------------------------------------------- */
.lp-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4); padding: var(--s-4) 0;
}
.lp-nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4);
  background: hsl(var(--surface) / 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border: 1px solid hsl(var(--border));
  border-radius: var(--r-full);
  padding: 9px var(--s-3) 9px var(--s-5);
  box-shadow: var(--shadow-xs);
}
.hero {
  position: relative;
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4rem);
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 50% at 18% 0%, hsl(var(--accent) / 0.10), transparent 70%),
    radial-gradient(46% 44% at 92% 6%, hsl(160 70% 50% / 0.08), transparent 72%);
  pointer-events: none;
}
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4rem); align-items: center;
}
@media (max-width: 880px) { .hero-grid { grid-template-columns: 1fr; } }

.hero h1 { font-size: clamp(2.1rem, 5.2vw, 3.4rem); line-height: 1.06; letter-spacing: -0.03em; font-weight: 730; }
.hero h1 .mk { color: hsl(var(--accent-strong)); }

.trust-strip { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); align-items: center; }
.trust-strip .ts-item { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); color: hsl(var(--ink-3)); font-weight: 540; }
.trust-strip .ts-item svg { width: 16px; height: 16px; color: hsl(var(--accent)); }

/* Floating wall-of-love preview in hero */
.hero-wall { display: grid; gap: var(--s-3); }
.hero-wall .wl-card {
  background: hsl(var(--surface)); border: 1px solid hsl(var(--border));
  border-radius: var(--r-lg); padding: var(--s-4) var(--s-5);
  box-shadow: var(--shadow-md);
}
.hero-wall .wl-card:nth-child(2) { transform: translateX(clamp(8px, 3vw, 28px)); }
.hero-wall .wl-quote { line-height: 1.6; color: hsl(var(--ink)); font-size: var(--text-base); }
.hero-wall .wl-meta { display: flex; align-items: center; gap: var(--s-3); margin-top: var(--s-3); }

.feature-card { padding: var(--s-6); height: 100%; }
.feature-card .fc-ico {
  display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: var(--r-md); background: hsl(var(--accent-soft)); color: hsl(var(--accent-strong));
  margin-bottom: var(--s-4);
}
.feature-card .fc-ico svg { width: 22px; height: 22px; }

.step-num {
  display: grid; place-items: center; width: 30px; height: 30px; flex: none;
  border-radius: 50%; background: hsl(var(--accent)); color: hsl(var(--accent-ink));
  font-weight: 700; font-size: var(--text-sm); box-shadow: var(--shadow-sm);
}

/* Pricing */
.price-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-5); max-width: 760px; margin-inline: auto; }
@media (max-width: 720px) { .price-grid { grid-template-columns: 1fr; } }
.price-card { padding: var(--s-7); position: relative; display: flex; flex-direction: column; }
.price-card.featured { border-color: hsl(var(--accent) / 0.5); box-shadow: 0 0 0 1px hsl(var(--accent) / 0.35), var(--shadow-lg); }
.price-amount { font-size: var(--text-4xl); font-weight: 740; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.price-feat { display: flex; gap: var(--s-3); align-items: flex-start; font-size: var(--text-md); line-height: 1.5; }
.price-feat svg { width: 17px; height: 17px; flex: none; margin-top: 2px; color: hsl(var(--accent-strong)); }
.price-feat.off { color: hsl(var(--ink-4)); }
.price-feat.off svg { color: hsl(var(--ink-4)); }

.lp-footer { border-top: 1px solid hsl(var(--border)); padding: var(--s-10) 0 var(--s-8); margin-top: var(--s-16); }
.lp-footer a { color: hsl(var(--ink-3)); font-size: var(--text-md); }
.lp-footer a:hover { color: hsl(var(--ink)); }

/* ---- App layout helpers ---------------------------------------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }
.menu-btn { display: none; }
@media (max-width: 880px) { .menu-btn { display: inline-grid; } }

.stat-card { padding: var(--s-5); }
.stat-ico {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r-md);
  background: hsl(var(--accent-soft)); color: hsl(var(--accent-strong)); flex: none;
}
.stat-ico svg { width: 19px; height: 19px; }

/* Testimonial card */
.t-card { padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); }
.t-card .t-body { line-height: 1.65; color: hsl(var(--ink)); }
.t-card .t-foot { display: flex; align-items: center; gap: var(--s-3); }
.t-card .t-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.t-img { width: 100%; max-height: 180px; object-fit: cover; border-radius: var(--r-md); border: 1px solid hsl(var(--border)); }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); align-items: start; }
@media (max-width: 960px) { .kanban { grid-template-columns: 1fr; } }
.kanban-col { background: hsl(var(--bg-subtle)); border: 1px solid hsl(var(--border)); border-radius: var(--r-lg); padding: var(--s-3); min-height: 120px; transition: border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease); }
.kanban-col.drag-over { border-color: hsl(var(--accent)); background: hsl(var(--accent-soft) / 0.5); }
.kanban-col-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s-2) var(--s-3) var(--s-3); }
.kanban-list { display: flex; flex-direction: column; gap: var(--s-3); }
.kanban-card { background: hsl(var(--surface)); border: 1px solid hsl(var(--border)); border-radius: var(--r-md); padding: var(--s-4); box-shadow: var(--shadow-xs); cursor: grab; transition: box-shadow var(--dur-2) var(--ease), transform var(--dur-2) var(--ease); }
.kanban-card:hover { box-shadow: var(--shadow-sm); }
.kanban-card.dragging { opacity: 0.5; cursor: grabbing; }
.kanban-card .kc-body { font-size: var(--text-md); line-height: 1.55; color: hsl(var(--ink)); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Widget preview frame */
.preview-frame { border: 1px solid hsl(var(--border)); border-radius: var(--r-lg); overflow: hidden; background: hsl(var(--bg-subtle)); }
.preview-frame iframe { width: 100%; border: 0; display: block; background: transparent; }
.snippet { font-family: var(--font-mono); font-size: var(--text-sm); background: hsl(var(--ink) / 0.04); border: 1px solid hsl(var(--border)); border-radius: var(--r-md); padding: var(--s-4); white-space: pre-wrap; word-break: break-all; line-height: 1.6; color: hsl(var(--ink-2)); }

/* Insights */
.insight-term { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: var(--s-3) 0; border-bottom: 1px solid hsl(var(--border)); }
.insight-term:last-child { border-bottom: 0; }
.bar { flex: 1; height: 7px; background: hsl(var(--bg-muted)); border-radius: var(--r-full); overflow: hidden; max-width: 220px; }
.bar > i { display: block; height: 100%; background: hsl(var(--accent)); border-radius: inherit; }

/* Public collect form */
.collect-wrap { max-width: 540px; margin-inline: auto; padding: var(--s-6) var(--s-4) var(--s-12); }
.collect-card { padding: clamp(1.5rem, 5vw, 2.25rem); }
.collect-success { text-align: center; padding: var(--s-8) var(--s-4); }
.collect-success .cs-ico { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: hsl(var(--accent-soft)); color: hsl(var(--accent-strong)); margin: 0 auto var(--s-5); }
.collect-success .cs-ico svg { width: 32px; height: 32px; }

/* Wall-of-love widget rendering (used by widget.html too) */
.wall { columns: 280px 3; column-gap: var(--s-4); }
.wall .wall-item { break-inside: avoid; margin-bottom: var(--s-4); }
.wol-card { background: hsl(var(--surface)); border: 1px solid hsl(var(--border)); border-radius: var(--r-lg); padding: var(--s-5); box-shadow: var(--shadow-xs); }
.wol-card .wol-quote { line-height: 1.65; color: hsl(var(--ink)); }
.wol-foot { display: flex; align-items: center; gap: var(--s-3); margin-top: var(--s-4); }
.wol-name { font-weight: 600; font-size: var(--text-md); }
.wol-role { font-size: var(--text-sm); color: hsl(var(--ink-3)); }

/* Carousel widget */
.carousel { display: flex; gap: var(--s-4); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--s-2); scrollbar-width: thin; }
.carousel .wol-card { scroll-snap-align: start; flex: 0 0 clamp(260px, 80%, 340px); }

.koe-badge { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: hsl(var(--ink-4)); margin-top: var(--s-4); }
.koe-badge svg { width: 13px; height: 13px; }

/* Notice block */
.notice { display: flex; gap: var(--s-3); padding: var(--s-4); border-radius: var(--r-md); background: hsl(var(--amber-soft)); border: 1px solid hsl(var(--amber) / 0.3); color: hsl(38 70% 30%); font-size: var(--text-sm); line-height: 1.55; }
[data-theme="dark"] .notice { background: hsl(40 60% 14%); color: hsl(40 80% 78%); }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }

.dz {
  border: 1.5px dashed hsl(var(--border-strong)); border-radius: var(--r-md);
  padding: var(--s-5); text-align: center; cursor: pointer; transition: all var(--dur-2) var(--ease);
  color: hsl(var(--ink-3)); font-size: var(--text-md);
}
.dz:hover, .dz.over { border-color: hsl(var(--accent)); background: hsl(var(--accent-soft) / 0.4); color: hsl(var(--accent-strong)); }

.swatch-row { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: transform var(--dur-1) var(--ease); position: relative; }
.swatch:hover { transform: scale(1.1); }
.swatch.on { border-color: hsl(var(--ink)); box-shadow: 0 0 0 2px hsl(var(--surface)); }

.divider { height: 1px; background: hsl(var(--border)); border: 0; margin: var(--s-2) 0; }

.lim-bar { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: hsl(var(--accent-soft) / 0.6); border: 1px solid hsl(var(--accent) / 0.25); font-size: var(--text-sm); }
.lim-bar svg { width: 16px; height: 16px; color: hsl(var(--accent-strong)); flex: none; }

/* Generic responsive 3-grid for app cards */
.cards-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s-4); }

.qrow { display: flex; gap: var(--s-2); align-items: center; }
.qrow .input { flex: 1; }

/* Collapse inline-styled multi-column app grids on tablet/mobile.
   These use inline grid-template-columns, so the base.css .grid rules
   cannot reach them — override explicitly here. */
@media (max-width: 880px) {
  /* minmax(0,1fr) (not 1fr) so the single track can shrink below its content's
     min-content — otherwise a nowrap descendant forces the track wider than the
     viewport and the whole page scrolls horizontally. min-width:0 lets the grid
     items themselves shrink too so .truncate children clip instead of overflow. */
  #dash-grid, #w-grid, #insights-grid { grid-template-columns: minmax(0, 1fr) !important; }
  #dash-grid > *, #w-grid > *, #insights-grid > * { min-width: 0; }
}

@media (max-width: 560px) { .no-mobile { display: none !important; } }

@media print { .no-print { display: none !important; } }
