/* SIRIUS2 公式 期間限定AIシリーズアイコン一括生成スタジオ
   Base: #F8FAFC | Main: #1B3A5C | Accent: #2563EB / #0D9488 */
:root {
  --bg-base: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F1F5F9;
  --main: #1B3A5C;
  --main-dark: #132A43;
  --main-soft: #EBF1F6;
  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --accent-soft: #EFF6FF;
  --teal: #0D9488;
  --teal-hover: #0F766E;
  --teal-soft: #F0FDFA;
  --danger: #B91C1C;
  --danger-soft: #FEF2F2;
  --warn: #B45309;
  --warn-soft: #FFFBEB;
  --text: #0F172A;
  --text-sub: #475569;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --border-med: #CBD5E1;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 6px 18px rgba(15, 23, 42, 0.08);
  --font: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic Medium", "Yu Gothic", "Meiryo", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg-base); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header & Announcement Bar */
.s2-header { background: var(--main); color: #fff; position: sticky; top: 0; z-index: 100; }
.s2-header-inner { max-width: 1380px; margin: 0 auto; padding: 0 20px; height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.s2-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 15px; white-space: nowrap; }
.s2-brand:hover { text-decoration: none; }
.s2-brand-name { margin: 0; font: inherit; }
.s2-brand-name span { white-space: nowrap; }
.s2-brand-tag { background: rgba(13, 148, 136, 0.9); padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.s2-nav { display: flex; align-items: center; gap: 10px; }
.s2-nav-cta { background: var(--teal); color: #fff; padding: 6px 13px; border-radius: 6px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.s2-nav-cta:hover { background: var(--teal-hover); text-decoration: none; }

.teaser-bar { background: linear-gradient(90deg, #EBF1F6 0%, #F0FDFA 100%); border-bottom: 1px solid var(--border); padding: 9px 20px; }
.teaser-inner { max-width: 1380px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 12.5px; }
.teaser-pill { display: inline-block; background: var(--main); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px; margin-right: 6px; }
.quota-meter { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-sub); font-weight: 600; }
.quota-track { width: 110px; height: 7px; background: #CBD5E1; border-radius: 999px; overflow: hidden; }
.quota-fill { height: 100%; width: 100%; background: linear-gradient(90deg, var(--teal), var(--accent)); transition: width 0.3s; }

/* 2-Pane Workspace */
.workspace { max-width: 1380px; margin: 0 auto; padding: 18px 20px 40px; display: grid; grid-template-columns: 440px minmax(0, 1fr); grid-template-areas: "settings preview" "settings community"; gap: 18px; align-items: start; }
.panel { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.panel-head { padding: 13px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-title { margin: 0; font-size: 14.5px; font-weight: 700; color: var(--main); }
.panel-body { padding: 16px; }
.sticky-panel { grid-area: settings; position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow-y: auto; }
.preview-panel { grid-area: preview; }
.sticky-panel, .preview-panel { scroll-margin-top: 80px; min-width: 0; }

.step-block { padding-bottom: 15px; margin-bottom: 15px; border-bottom: 1px solid var(--border); }
.step-block:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: none; }
.step-label { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; font-weight: 700; color: var(--main); margin: 0 0 8px; }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 19px; height: 19px; border-radius: 50%; background: var(--main); color: #fff; font-size: 11px; margin-right: 6px; }

/* Tabs & Inputs */
.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.mode-tab { padding: 8px 10px; font-size: 12.5px; font-weight: 700; border: 1px solid var(--border-med); background: var(--bg-base); color: var(--text-sub); border-radius: 6px; cursor: pointer; font-family: inherit; }
.mode-tab.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.input, .select { width: 100%; padding: 8px 10px; font-size: 13px; font-family: inherit; border: 1px solid var(--border-med); border-radius: 6px; background: #fff; color: var(--text); outline: none; }
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }

.preset-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.chip { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border-med); background: #fff; color: var(--text-sub); cursor: pointer; font-family: inherit; }
.chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.motif-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.motif-grid .input { padding: 6px 8px; font-size: 12.5px; }

/* Choice Cards */
.choice-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.choice-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.choice-card { padding: 8px 6px; border: 1px solid var(--border-med); border-radius: 6px; background: #fff; text-align: center; cursor: pointer; font-family: inherit; transition: all 0.12s; }
.choice-card:hover { border-color: #93C5FD; background: var(--bg-base); }
.choice-card.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice-title { display: block; font-size: 12.5px; font-weight: 700; }
.choice-sub { display: block; font-size: 10.5px; color: var(--text-muted); margin-top: 1px; }

/* Color Swatches */
.color-swatches { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-bottom: 8px; }
.swatch { width: 28px; height: 28px; border-radius: 6px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border-med); cursor: pointer; }
.swatch.active { box-shadow: 0 0 0 2px var(--accent); transform: scale(1.08); }
.color-row { display: flex; gap: 8px; align-items: center; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px; font-size: 13px; font-weight: 700; font-family: inherit; border-radius: 7px; border: 1px solid var(--border-med); background: #fff; color: var(--text); cursor: pointer; transition: all 0.15s; }
.btn:hover:not(:disabled) { background: var(--bg-subtle); }
a.btn:hover { text-decoration: none; }
.btn:focus-visible, .community-links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-teal { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-teal:hover:not(:disabled) { background: var(--teal-hover); }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 16px; font-size: 14.5px; }

/* Right Panel: Preview & Results */
.bg-toggle { display: flex; gap: 4px; }
.bg-toggle .btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.sample-box { padding: 22px; border: 1px solid #DDE7EE; border-radius: var(--radius); background: linear-gradient(125deg, #F3F7FA, #EFF9F8); }
.sample-box[hidden] { display: none; }
.sample-intro h3 { margin: 0; color: var(--main-dark); font-size: clamp(18px, 2.1vw, 29px); line-height: 1.35; }
.sample-intro h3 span { white-space: nowrap; }
.sample-intro p, .sample-actions p { margin: 5px 0 0; color: var(--text-sub); font-size: 12.5px; }
.sample-mode, .sample-options, #sampleArrows { display: flex; flex-wrap: wrap; gap: 5px; }
.sample-mode { margin-top: 15px; }
.sample-options { margin-top: 7px; }
.sample-options[hidden], #sampleArrows[hidden], #btnUseSample[hidden] { display: none; }
.sample-mode button, .sample-options button, #sampleArrows button { min-height: 34px; white-space: nowrap; }
.sample-mode button[aria-pressed="true"] { background: var(--main); border-color: var(--main); color: #fff; }
.sample-options button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.sample-current { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.sample-current p { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 9px; margin: 0; color: var(--main-dark); font-size: 14px; }
.sample-current p span { color: var(--text-sub); font-size: 12px; white-space: nowrap; }
.sample-current p strong { color: var(--main-dark); }
.sample-jump { color: var(--accent); font-size: 12px; white-space: nowrap; text-decoration: underline; }
#sampleHeading { scroll-margin-top: 80px; }
#sampleGrid { touch-action: pan-y; margin-top: 9px; }
.sample-grid { list-style: none; margin: 17px 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.sample-grid li { overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: #fff; text-align: center; }
.sample-grid li span { display: block; padding: 6px 4px; font-size: 12px; font-weight: 700; color: var(--main); }
.sample-grid .sample-stage { aspect-ratio: auto; padding: 6px; }
.sample-grid .sample-stage img { display: block; width: 100%; max-width: 123px; height: auto; }
.sample-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.sample-actions p { margin: 0; }
.sample-applied:not(:empty) { margin: 0 0 12px; padding: 9px 11px; border-radius: 7px; background: var(--teal-soft); color: #115E59; font-size: 12px; }
.sample-applied strong { display: block; }
.sample-applied span { display: inline-block; margin-right: .65em; }
.motif-grid.motif-grid--preset { grid-template-columns: minmax(0, 1fr); }
.maint-box { background: var(--warn-soft); border: 1px solid #FDE68A; border-radius: var(--radius); padding: 28px 22px; text-align: center; display: none; margin-bottom: 14px; }

.loading-box { min-height: 400px; display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px; }
.spinner { width: 42px; height: 42px; border: 4px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.85s linear infinite; margin-bottom: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
.stepper { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; justify-content: center; font-size: 12px; color: var(--text-muted); }
.stepper span { padding: 4px 10px; border-radius: 999px; background: var(--bg-subtle); }
.stepper span.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }

.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); gap: 14px; }
.icon-card { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.icon-stage { aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; padding: 18px; }
.icon-stage.bg-check {
  background-color: #fff;
  background-image: linear-gradient(45deg, #E2E8F0 25%, transparent 25%), linear-gradient(-45deg, #E2E8F0 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #E2E8F0 75%), linear-gradient(-45deg, transparent 75%, #E2E8F0 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.icon-stage.bg-white { background: #FFFFFF; }
.icon-stage.bg-navy { background: #1B3A5C; }
.icon-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.icon-meta { padding: 9px 11px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.icon-name { font-size: 12.5px; font-weight: 700; color: var(--main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.result-actions { background: var(--teal-soft); border: 1px solid #99F6E4; border-radius: 8px; padding: 13px 16px; margin-bottom: 16px; }
#resultHeadline { margin: 0; color: #115E59; font-size: 14px; }
.result-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.share-status { margin: 8px 0 0; color: var(--text-sub); font-size: 12px; }
.share-status:empty { margin: 0; }
#shareUrl { margin-top: 6px; }

.community-panel { grid-area: community; min-width: 0; }
.community-panel h2 { margin: 0 0 10px; color: var(--main); font-size: 16px; }
.community-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.community-links a { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 66px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; color: var(--main); background: var(--bg-base); }
.community-links a:hover { text-decoration: none; border-color: var(--accent); }
.community-links a:hover strong { text-decoration: underline; }
.community-links span { color: var(--text-sub); font-size: 12px; }

/* Toast */
.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--main); color: #fff; padding: 10px 15px; border-radius: 6px; font-size: 13px; box-shadow: var(--shadow-md); }
.toast.error { background: var(--danger); }
.toast.success { background: var(--teal); }

.s2-footer { border-top: 1px solid var(--border); background: #fff; padding: 16px 20px; font-size: 12px; color: var(--text-muted); }
.s2-footer-inner { max-width: 1380px; margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

@media (max-width: 980px) {
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-areas: none; }
  .sticky-panel, .preview-panel, .community-panel { grid-area: auto; }
  .sticky-panel { position: static; max-height: none; }
}

@media (max-width: 640px) {
  .s2-header-inner { height: auto; min-height: 56px; padding: 8px 12px; gap: 8px; }
  .s2-brand { display: grid; min-width: 0; gap: 3px; white-space: normal; font-size: 12px; line-height: 1.35; }
  .s2-brand-tag { justify-self: start; white-space: nowrap; padding: 3px 4px; font-size: 10px; }
  .s2-nav-cta { padding: 6px 7px; font-size: 11px; }
  .teaser-bar, .workspace { padding-left: 12px; padding-right: 12px; }
  .workspace { padding-top: 12px; gap: 12px; }
  .panel-head { padding: 10px 12px; flex-wrap: wrap; gap: 6px; }
  .panel-body { padding: 12px; }
  .sample-box { padding: 12px; }
  .sample-grid { margin: 11px 0; gap: 6px; }
  .sample-grid li span { font-size: 10.5px; }
  .sample-grid .sample-stage { padding: 3px; }
  .sample-actions .btn, .result-buttons .btn { min-height: 42px; }
  .color-row .select { min-width: 0; }
  .loading-box { min-height: 260px; padding: 16px; }
  .result-buttons { gap: 6px; }
  .result-buttons .btn { flex-grow: 1; padding-left: 9px; padding-right: 9px; }
  .icon-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .icon-meta { flex-wrap: wrap; padding: 7px 8px; }
  .community-links { grid-template-columns: minmax(0, 1fr); }
}
