:root {
    --bg: #fff9f6;
    /* UI全体の背景（タイプ適用で動的に変える） */
    --ink: #333333;
    /* 標準テキスト色 */
    --muted: #6b7280;
    /* 補助テキスト色 */
    --card: #ffffff;
    /* カード背景 */
    --border: #e5e7eb;
    /* 境界線 */
    --accent: #3b82f6;
    /* 強調色 */
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
        "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic UI",
        "Yu Gothic", Meiryo, sans-serif;
}

/* フォント：明朝系を全体に */
:root {
    --font-ui: "Shippori Mincho", "Noto Serif JP", serif;
}

html,
body {
    font-family: var(--font-ui);
    /* 和文の詰めを少し良くする（対応ブラウザのみ） */
    font-feature-settings: "palt" 1;
}

/* タイトル（アイコン＋テキスト） */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 8px 0;
    font-weight: 700;
}

.brand-icon {
    display: inline-block;
    border-radius: 6px;
    /* 角を少し丸く */
}

.brand-title {
    line-height: 1.2;
}

.app-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 16px 18px;
}

.app-header h1 {
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 18px;
    display: grid;
    gap: 14px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .03);
}

.row {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 12px;
    align-items: start;
}

@media (max-width: 900px) {
    .row {
        grid-template-columns: 1fr;
    }
}

textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font: inherit;
    resize: vertical;
    background: #fff;
}

input[type="url"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font: inherit;
    background: #fff;
}

.controls {
    display: grid;
    gap: 12px;
}

.buttons {
    display: flex;
    gap: 8px;
}

.inline {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

button {
    padding: 8px 12px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 10px;
    font: inherit;
    cursor: pointer;
    transition: background-color .2s ease, filter .2s ease;
}

button[disabled] {
    opacity: .6;
    cursor: not-allowed;
}

#generateBtn {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

#generateBtn:hover:not(:disabled),
#generateBtn:focus-visible:not(:disabled) {
    filter: brightness(1.1);
}

.hint {
    color: var(--muted);
    font-size: 12px;
    margin: 0;
}

.poster-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 420px;
}

.poster-wrap .preview {
    width: 360px;
    /* 表示時の見た目サイズ（実サイズはSVG内で大きく作成） */
    box-shadow: 0 16px 40px rgba(0, 0, 0, .10);
    border-radius: 8px;
    overflow: hidden;
}

.input-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toggle-input {
    align-self: flex-end;
}

.hidden {
    display: none;
}
