:root {
  --ink: #20201f; --muted: #6f6d68; --line: #e9e6df; --paper: #fbfaf7;
  --white: #fff; --accent: #6246d7; --accent-dark: #4932b8; --soft: #f0ecff;
  --green: #246d51; --danger: #b83a4b; --shadow: 0 16px 45px rgba(39,31,20,.08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "Noto Sans JP", sans-serif; line-height: 1.75; }
button,input,textarea,select { font: inherit; }
button,a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
.site-header { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; height: 70px; padding: 0 max(24px,calc((100vw - 1180px)/2)); border-bottom: 1px solid rgba(233,230,223,.85); background: rgba(251,250,247,.9); backdrop-filter: blur(18px); }
.brand { display: inline-flex; align-items: center; gap: 9px; font: 700 25px/1 "DM Sans", sans-serif; letter-spacing: -.05em; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; color: white; border-radius: 9px 9px 9px 3px; background: var(--accent); }
.header-actions,.footer-links,.meta-row,.chips,.card-meta,.form-actions { display: flex; align-items: center; gap: 12px; }
.button,.text-button,.icon-button { border: 0; cursor: pointer; font-weight: 700; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 48px; padding: 0 22px; border-radius: 13px; transition: .2s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: white; background: var(--accent); box-shadow: 0 8px 20px rgba(98,70,215,.22); }
.button-primary:hover { background: var(--accent-dark); }
.button-secondary { color: var(--accent); border: 1px solid #d8d0fa; background: var(--soft); }
.button-ghost { border: 1px solid var(--line); background: white; }
.button-small { min-height: 40px; padding: 0 17px; border-radius: 11px; font-size: 14px; }
.button-wide { width: 100%; }
.text-button,.icon-button { color: var(--ink); background: transparent; }
.icon-button { width: 40px; height: 40px; border-radius: 50%; font-size: 23px; }
.shell { width: min(1120px,calc(100% - 40px)); margin: 0 auto; }
.hero { position: relative; overflow: hidden; padding: 88px 0 72px; }
.hero::after { content:""; position:absolute; right:-80px; top:20px; width:460px; height:460px; border-radius:50%; background:radial-gradient(circle,#ded5ff 0,rgba(222,213,255,0) 68%); pointer-events:none; }
.hero-content { position: relative; z-index: 1; max-width: 740px; }
.eyebrow { margin: 0 0 15px; color: var(--accent); font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
h1,h2,h3,p { margin-top: 0; }
h1 { margin-bottom: 24px; font-size: clamp(42px,7vw,76px); line-height: 1.15; letter-spacing: -.065em; }
.hero h1 span { color: var(--accent); }
.lead { max-width: 610px; color: var(--muted); font-size: clamp(16px,2vw,19px); }
.search-box { display: flex; max-width: 620px; margin-top: 34px; padding: 8px; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: var(--shadow); }
.search-box input { flex: 1; min-width: 0; padding: 8px 14px; border: 0; outline: 0; background: transparent; }
.section { padding: 44px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.section-head h2 { margin-bottom: 4px; font-size: 27px; letter-spacing: -.04em; }
.section-head p { margin: 0; color: var(--muted); font-size: 14px; }
.categories { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.chip { flex: 0 0 auto; padding: 9px 15px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: white; cursor: pointer; }
.chip.active,.chip:hover { color: var(--accent); border-color: #cfc4fb; background: var(--soft); }
.grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 22px; }
.prompt-card { display: flex; flex-direction: column; min-height: 355px; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: white; transition: .25s ease; }
.prompt-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-cover { position: relative; display: grid; place-items: center; height: 142px; overflow: hidden; color: white; background: linear-gradient(135deg,var(--cover1),var(--cover2)); }
.card-cover.has-image,.detail-hero.has-image { background-position:center; background-size:cover; }
.card-cover span { font-size: 46px; filter: drop-shadow(0 6px 13px rgba(0,0,0,.16)); }
.price-badge { position: absolute; top: 12px; right: 12px; padding: 5px 10px; border-radius: 999px; color: var(--ink); background: rgba(255,255,255,.92); font-size: 12px; font-weight: 700; }
.card-body { display: flex; flex: 1; flex-direction: column; padding: 20px; }
.card-body h3 { margin-bottom: 8px; font-size: 18px; line-height: 1.5; letter-spacing: -.025em; }
.card-body>p { display:-webkit-box; overflow:hidden; margin-bottom:18px; color:var(--muted); font-size:13px; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.card-meta { justify-content: space-between; margin-top: auto; color: var(--muted); font-size: 12px; }
.author { display: flex; align-items: center; gap: 8px; }
.avatar { display:grid; place-items:center; width:28px; height:28px; border-radius:50%; color:white; background:var(--accent); font-size:11px; font-weight:700; }
.tag { padding: 4px 9px; border-radius: 7px; color: var(--accent); background: var(--soft); font-size: 11px; font-weight: 700; }
.tag-link { transition:.18s ease; }
.tag-link:hover,.tag-link:focus-visible { color:white; background:var(--accent); transform:translateY(-1px); outline:none; }
.results-shell { width:min(1120px,calc(100% - 40px)); min-height:65vh; margin:52px auto 90px; }
.results-head { margin-bottom:32px; }
.results-head h1 { margin-bottom:8px; font-size:clamp(34px,5vw,52px); }
.results-head>p:last-child { color:var(--muted); }
.empty { grid-column:1/-1; padding:60px 20px; text-align:center; color:var(--muted); border:1px dashed var(--line); border-radius:20px; }
.detail-shell { width:min(980px,calc(100% - 40px)); margin:52px auto 80px; }
.back-link { display:inline-block; margin-bottom:24px; color:var(--muted); font-size:14px; }
.detail-grid { display:grid; grid-template-columns:minmax(0,1fr) 320px; gap:55px; align-items:start; }
.detail-title { margin-bottom:16px; font-size:clamp(32px,5vw,51px); line-height:1.25; letter-spacing:-.055em; }
.detail-summary { color:var(--muted); font-size:17px; }
.detail-hero { display:grid; place-items:center; height:300px; margin:30px 0; border-radius:24px; color:white; background:linear-gradient(135deg,var(--cover1),var(--cover2)); font-size:88px; }
.content-section { padding:30px 0; border-bottom:1px solid var(--line); }
.content-section h2 { font-size:21px; }
.feature-list { padding-left:1.25em; }
.output-box,.prompt-box { padding:22px; border-radius:16px; white-space:pre-wrap; }
.output-box { border:1px solid var(--line); background:white; }
.output-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.output-heading h2 { margin-bottom:10px; }
.model-badge { flex:0 0 auto; padding:5px 10px; color:var(--accent); border:1px solid #d8d0fa; border-radius:999px; background:var(--soft); font-size:12px; font-weight:700; }
.prompt-box { position:relative; padding:18px; color:#372a70; background:var(--soft); font-size:14px; overflow-wrap:anywhere; }
.prompt-box .copy { position:absolute; top:12px; right:12px; }
.prompt-toolbar { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:14px; }
.prompt-toolbar>div { display:flex; gap:8px; }
.prompt-state { color:var(--muted); font-family:"Noto Sans JP",sans-serif; font-size:12px; font-weight:700; }
.prompt-editor { display:block; width:100%; min-height:230px; padding:18px; color:#372a70; border:1px solid transparent; border-radius:12px; background:rgba(255,255,255,.48); font-family:ui-monospace,SFMono-Regular,Consolas,monospace; font-size:14px; line-height:1.8; resize:vertical; }
.prompt-editor[readonly] { cursor:default; }
.prompt-box.is-editing { box-shadow:inset 0 0 0 2px rgba(98,70,215,.22); }
.prompt-box.is-editing .prompt-editor { border-color:#cfc4fb; background:white; }
.purchase-card { position:sticky; top:96px; padding:24px; border:1px solid var(--line); border-radius:20px; background:white; box-shadow:var(--shadow); }
.purchase-card .price { margin:12px 0 18px; font:700 30px/1 "DM Sans",sans-serif; }
.purchase-card ul { padding-left:1.3em; color:var(--muted); font-size:13px; }
.lock-box { padding:42px 24px; text-align:center; border:1px solid #d8d0fa; border-radius:18px; background:linear-gradient(180deg,#f7f4ff,#eee9ff); }
.lock-icon { display:grid; place-items:center; width:50px; height:50px; margin:0 auto 14px; border-radius:15px; background:white; font-size:22px; }
.editor-shell { width:min(1000px,calc(100% - 40px)); margin:45px auto 90px; }
.editor-head { margin-bottom:30px; }
.editor-head h1 { margin-bottom:8px; font-size:38px; }
.editor-grid { display:grid; grid-template-columns:1fr 300px; gap:28px; align-items:start; }
.form-card,.side-card { padding:26px; border:1px solid var(--line); border-radius:20px; background:white; }
.side-card { position:sticky; top:95px; }
.form-group { margin-bottom:23px; }
.form-group label { display:block; margin-bottom:8px; font-size:14px; font-weight:700; }
.required { color:var(--danger); }
.hint { margin:7px 0 0; color:var(--muted); font-size:12px; }
.other-ai-field { margin-top:10px; }
.other-ai-field[hidden] { display:none; }
input,textarea,select { width:100%; padding:13px 14px; color:var(--ink); border:1px solid #dcd8d0; border-radius:11px; background:#fff; outline:none; }
input:focus,textarea:focus,select:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(98,70,215,.11); }
textarea { min-height:130px; resize:vertical; }
textarea.tall { min-height:240px; font-family:ui-monospace,SFMono-Regular,Consolas,monospace; }
.two-cols { display:grid; grid-template-columns:1fr 1fr; gap:15px; }
.two-cols.single-column { grid-template-columns:1fr; }
.check-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; }
.check-option { display:flex!important; align-items:center; gap:8px; margin:0!important; padding:10px 12px; border:1px solid var(--line); border-radius:10px; cursor:pointer; font-size:13px!important; font-weight:500!important; }
.check-option:has(input:checked) { color:var(--accent); border-color:#cfc4fb; background:var(--soft); }
.check-option input { width:auto; margin:0; accent-color:var(--accent); }
.cover-uploader { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:14px; align-items:center; }
.cover-preview { display:grid; place-items:center; min-height:150px; overflow:hidden; color:var(--muted); border:1px dashed #cbc6bd; border-radius:14px; background:linear-gradient(135deg,#4330a6,#9c88ea); background-position:center; background-size:cover; font-size:13px; }
.cover-preview:not(.has-image) span { padding:8px 12px; color:white; border-radius:999px; background:rgba(0,0,0,.24); }
.cover-select { position:relative; overflow:hidden; white-space:nowrap; }
.cover-select input { position:absolute; width:1px; height:1px; opacity:0; }
.price-input { position:relative; }
.price-input::before { content:"¥"; position:absolute; left:14px; top:13px; font-weight:700; }
.price-input input { padding-left:32px; }
.segmented { display:grid; grid-template-columns:1fr 1fr; gap:7px; padding:5px; border-radius:13px; background:#f3f1ed; }
.segmented label { margin:0; padding:9px; text-align:center; border-radius:9px; cursor:pointer; }
.segmented input { display:none; }
.segmented label:has(input:checked) { color:var(--accent); background:white; box-shadow:0 2px 8px rgba(0,0,0,.07); }
.preview-panel { margin-top:28px; }
.preview-panel[hidden] { display:none; }
.toast { position:fixed; z-index:100; left:50%; bottom:30px; transform:translate(-50%,20px); padding:11px 18px; color:white; border-radius:999px; background:#242321; opacity:0; pointer-events:none; transition:.25s; font-size:13px; }
.toast.show { transform:translate(-50%,0); opacity:1; }
.site-footer { padding:55px max(24px,calc((100vw - 1120px)/2)); color:var(--muted); border-top:1px solid var(--line); background:white; }
.auth-link { display:inline-flex; align-items:center; padding:8px; }
.auth-shell { display:grid; place-items:center; min-height:calc(100vh - 70px); padding:55px 20px 75px; background:radial-gradient(circle at 50% 0,#eee9ff 0,transparent 38%); }
.auth-card { width:min(100%,460px); padding:36px; border:1px solid var(--line); border-radius:24px; background:white; box-shadow:var(--shadow); }
.auth-brand { margin-bottom:35px; }
.auth-card h1 { margin-bottom:10px; font-size:36px; }
.auth-intro { margin-bottom:28px; color:var(--muted); }
.auth-switch { margin:22px 0 0; text-align:center; color:var(--muted); font-size:13px; }
.auth-switch a { color:var(--accent); font-weight:700; }
.auth-error { padding:10px 12px; color:var(--danger); border-radius:9px; background:#fff0f2; font-size:13px; }
.auth-notice { text-align:center; }
.auth-notice h1 { font-size:30px; }
.mail-mark { display:grid; place-items:center; width:58px; height:58px; margin:0 auto 20px; color:var(--accent); border-radius:18px; background:var(--soft); font-size:25px; }
.user-menu { display:flex; align-items:center; gap:8px; }
.user-name { max-width:130px; overflow:hidden; font-size:13px; font-weight:700; text-overflow:ellipsis; white-space:nowrap; }
.logout-button { margin-left:4px; color:var(--muted); font-size:12px; }
.user-dashboard-link { display:flex; align-items:center; gap:8px; }
.dashboard-shell { width:min(1050px,calc(100% - 40px)); min-height:70vh; margin:55px auto 90px; }
.dashboard-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:25px; margin-bottom:30px; }
.dashboard-heading h1 { margin-bottom:6px; font-size:42px; }
.dashboard-heading p:last-child { margin:0; color:var(--muted); }
.dashboard-tabs { display:flex; gap:9px; margin-bottom:22px; }
.manage-list { display:flex; flex-direction:column; gap:12px; }
.manage-row { display:grid; grid-template-columns:110px minmax(0,1fr) auto; gap:20px; align-items:center; padding:18px; border:1px solid var(--line); border-radius:17px; background:white; }
.manage-cover { display:grid; place-items:center; width:110px; height:76px; color:white; border-radius:11px; background:linear-gradient(135deg,#4330a6,#9c88ea); font-size:25px; }
.manage-cover.has-image { background-position:center; background-size:cover; }
.manage-title-row { display:flex; align-items:center; gap:10px; }
.manage-title-row h3 { overflow:hidden; margin:0; font-size:16px; text-overflow:ellipsis; white-space:nowrap; }
.manage-main>p { overflow:hidden; margin:5px 0; color:var(--muted); font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.manage-meta { display:flex; gap:12px; color:var(--muted); font-size:11px; }
.status-badge { flex:0 0 auto; padding:3px 8px; border-radius:999px; font-size:10px; font-weight:700; }
.status-published { color:var(--green); background:#e7f5ef; }
.status-draft { color:var(--muted); background:#f0efec; }
.status-suspended { color:var(--danger); background:#fff0f2; }
.manage-actions { display:flex; align-items:center; gap:7px; }
.danger-button { padding:7px; color:var(--danger); font-size:12px; }
.form-card.is-loading { opacity:.55; pointer-events:none; }
@media(max-width:800px){.manage-row{grid-template-columns:85px minmax(0,1fr)}.manage-cover{width:85px}.manage-actions{grid-column:1/-1;justify-content:flex-end;flex-wrap:wrap}.dashboard-heading{align-items:flex-start;flex-direction:column}}
@media(max-width:580px){.dashboard-shell{width:calc(100% - 28px);margin-top:32px}.dashboard-heading h1{font-size:34px}.manage-row{grid-template-columns:1fr}.manage-cover{width:100%;height:130px}.manage-actions{justify-content:flex-start}.manage-title-row{align-items:flex-start;flex-direction:column}.manage-title-row h3,.manage-main>p{white-space:normal}}
.footer-brand { color:var(--ink); }
.site-footer p { margin:15px 0; }
.footer-links { flex-wrap:wrap; margin-bottom:20px; font-size:13px; }
@media(max-width:850px){.grid{grid-template-columns:repeat(2,1fr)}.detail-grid,.editor-grid{grid-template-columns:1fr}.purchase-card,.side-card{position:static}.detail-grid{gap:25px}}
@media(max-width:580px){.desktop-only{display:none}.site-header{height:62px;padding:0 18px}.shell,.detail-shell,.editor-shell{width:min(100% - 28px,1120px)}.hero{padding:55px 0 42px}.hero h1{font-size:43px}.search-box .button{padding:0 14px}.grid{grid-template-columns:1fr}.prompt-card{min-height:335px}.section{padding:32px 0}.detail-shell{margin-top:28px}.detail-hero{height:210px}.detail-title{font-size:32px}.two-cols{grid-template-columns:1fr}.check-grid{grid-template-columns:1fr}.cover-uploader{grid-template-columns:1fr}.cover-select{width:100%}.form-card,.side-card{padding:20px}.form-actions{flex-direction:column}.form-actions .button{width:100%}}
@media(max-width:580px){.prompt-toolbar{align-items:flex-start;flex-direction:column}.prompt-toolbar>div{width:100%;flex-wrap:wrap}.prompt-toolbar .button{flex:1}.prompt-editor{min-height:280px;padding:14px}}
