:root {
  color-scheme: light;
  --page: #f9f9f9;
  --preview: #f4f4f4;
  --preview-end: #d4d4d4;
  --text: #292929;
  --quiet: #626262;
  --selected: #d2d2d2;
  --focus: #292929;
  --link: #0e7490;
  --link-hover: #155e75;
  --rule: #d5d5d5;
  --surface: #f4f4f4;
  --content-width: 720px;
  --font-body: 1.0625rem;
  --font-note: .9375rem;
  --page-top-space: 16px;
  --portrait-max-height: 780px;
  --portrait-viewport-space: 190px;
  --font-control: 1rem;
  --font-caption: .875rem;
  --icon-size: 1.25rem;
  --icon-small: 1rem;
  --badge-size: 24px;
  --target-size: 44px;
  --choice-height: 64px;
  --choice-thumbnail-width: 36px;
  --choice-thumbnail-height: 44px;
  --color-swatch-size: 32px;
  --color-swatch-stroke: #0008;
  --controls-min-height: 380px;
  font-family: "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  font-size: 100%;
  color: var(--text);
  background: var(--page);
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; }
button, input { font: inherit; }
button, .segmented, .color-inline-label, .model-face { font-size: var(--font-control); }
button { cursor: pointer; color: inherit; }
a { color: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }
button { min-height: 44px; border: 0; border-radius: 6px; padding: 10px 14px; background: transparent; line-height: 1.5; }
button:hover:enabled { background: #e1e1e1; }
button:disabled { color: #777; cursor: default; }
button:focus-visible, input:focus-visible, a:focus-visible, .sv-plane:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
p, figure { margin: 0; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; font-weight: 550; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: 8px; left: 8px; z-index: 4; padding: 10px 14px; border-radius: 6px; background: var(--page); transform: translateY(calc(-100% - 12px)); }
.skip-link:focus { transform: none; }
.quiet { color: var(--quiet); }
.guide-page, .color-tips {
  --article-font-title: 1.75rem;
  --article-font-heading: 1.25rem;
  --article-font-body: 1rem;
  --article-font-note: .875rem;
  --article-space-small: 8px;
  --article-space-paragraph: 16px;
  --article-space-group: 24px;
  --article-space-section: 32px;
  --article-gutter: 24px;
  font-size: var(--article-font-body);
  font-weight: 400;
  line-height: 1.8;
  line-break: strict;
}
:where(.guide-page, .color-tips) :where(a, button) { font-size: var(--article-font-body); }
:where(.guide-page, .color-tips) :where(h1, h2, h3) { margin: 0 0 var(--article-space-paragraph); font-size: var(--article-font-body); font-weight: 700; line-height: 1.5; text-wrap: balance; scroll-margin-top: var(--article-space-group); }
:where(.guide-page, .color-tips) :where(h2) { font-size: var(--article-font-heading); }
:where(.guide-page, .color-tips) strong { font-weight: 700; }
.link-list { margin: 0; padding: 0; padding-inline-start: 1.25rem; list-style: disc; }
.link-list > li { padding-block: var(--article-space-small); }
.link-list > li > a { display: flex; flex-direction: column; justify-content: center; gap: var(--article-space-small); min-height: var(--target-size); }
.guide-links { margin-top: var(--article-space-section); padding-top: var(--article-space-group); border-top: 1px solid var(--rule); }
.guide-links :is(h2, h3) { margin: 0 0 var(--article-space-small); font-size: var(--article-font-heading); }
.guide-links a { color: var(--link); text-decoration: none; overflow-wrap: anywhere; }
.guide-links a > span:first-child, .tips-list h3 a > span:first-child { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.guide-links a:hover { color: var(--link-hover); }
.guide-links a:hover > span:first-child, .tips-list h3 a:hover > span:first-child { text-decoration-thickness: 2px; }
.guide-links small, .howto-note { color: var(--quiet); font-size: var(--article-font-note); line-height: 1.8; }
.tips-link { display: inline-flex; align-items: center; justify-content: center; min-height: var(--target-size); padding: 8px 10px; border-radius: 6px; background: var(--page); font-size: var(--font-caption); text-decoration: none; white-space: nowrap; }
.tips-link:hover { background: #e1e1e1; }
.workspace { max-width: 1424px; margin: 0 auto; padding: var(--page-top-space) 32px 40px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 460px); align-items: start; gap: 40px; }
.preview-panel { min-width: 0; container-type: inline-size; background: radial-gradient(circle closest-side at 50% 45%, var(--preview) 60%, var(--preview-end)); border-radius: 10px; overflow: clip; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; padding: 16px 20px 0; }
.preview-utilities { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; max-width: 100%; margin-left: auto; }
.segmented { display: flex; background: #e7e7e7; border-radius: 6px; padding: 3px; width: fit-content; }
.segmented label { position: relative; flex: 1; cursor: pointer; min-width: 0; }
.segmented input, .shape-option input, .model-option input, .color-preset input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.segmented label > span { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 20px; border-radius: 4px; white-space: nowrap; }
.preview-toolbar .segmented label > span { padding-inline: 12px; font-size: var(--font-caption); }
.segmented input:checked + span { background: #fafafa; font-weight: 650; box-shadow: 0 1px 3px #0000000e; }
.segmented input:focus-visible + span, .shape-option input:focus-visible + span, .model-option input:focus-visible + .model-face, .color-preset input:focus-visible + span, .slide-button:focus-visible > span, .custom-color summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.shape-option input:checked + .shape-face, .model-option input:checked + .model-face, .color-preset input:checked + span { background: var(--selected); }
.shape-option:hover input:not(:checked) + .shape-face, .model-option:hover input:not(:checked) + .model-face { background: #dedede; }
.portrait-gallery { position: relative; }
.previews { --portrait-gap: 8px; --portrait-height-limit: min(var(--portrait-max-height), calc(100svh - var(--portrait-viewport-space))); --visible-portraits: min(var(--portrait-count, 1), var(--max-visible-portraits, 2)); display: flex; gap: var(--portrait-gap); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 12px 12px; scroll-padding-inline: 12px; }
.previews::-webkit-scrollbar { display: none; }
.previews:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.gallery-motion-layer { position: fixed; overflow: hidden; pointer-events: none; z-index: 3; }
.gallery-motion-card { position: absolute; pointer-events: none; }
.gallery-motion-card svg { display: block; width: 100%; height: 100%; overflow: hidden; }
.portrait-card { position: relative; min-width: 0; flex: 0 0 auto; width: min(calc(var(--portrait-height-limit) * var(--portrait-ratio, .8)), calc((100% - (var(--visible-portraits) - 1) * var(--portrait-gap)) / var(--visible-portraits) / var(--widest-portrait-ratio, .8) * var(--portrait-ratio, .8))); scroll-snap-align: start; }
.portrait-card:first-child { margin-left: auto; }
.portrait-card:last-child { margin-right: auto; }
.portrait-stage { width: 100%; aspect-ratio: var(--portrait-ratio, .8); display: grid; place-items: center; }
.portrait-stage svg { width: 100%; height: 100%; min-height: 0; overflow: hidden; }
.portrait-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; }
.portrait-action { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; padding: 0; }
.portrait-action:hover:enabled { background: transparent; }
.portrait-action > span { display: inline-grid; place-items: center; min-height: var(--badge-size); padding: 2px 8px; border-radius: 4px; font-size: var(--font-caption); line-height: 1.25; }
.keep-action > span { background: #353535; color: #fafafa; }
.keep-action:hover:enabled > span { background: #505050; }
.keep-action:disabled > span { background: #ccc; color: #666; }
.person-share-action > span { background: #e7e7e7; }
.person-share-action:hover:enabled > span { background: #dedede; }
#person-share-dialog { width: min(420px, calc(100% - 32px)); max-width: none; padding: 16px; border: 1px solid var(--rule); border-radius: 10px; color: var(--text); box-shadow: 0 6px 24px #0002; }
#person-share-dialog::backdrop { background: #0006; }
.person-share-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.person-share-heading h2 { margin: 0; font-size: 1rem; }
.person-share-heading button { width: 44px; padding: 0; font-size: var(--icon-size); }
#person-share-dialog label { display: block; margin: 8px 0 4px; }
#person-share-url { width: 100%; min-width: 0; padding: 8px; border: 1px solid #999; border-radius: 4px; }
#person-share-copy { margin-top: 12px; }
.person-share-sns { margin: 12px 0 0 4px; }
#person-share-status:not(:empty) { margin-top: 8px; }
.remove-kept > span { width: var(--badge-size); padding: 0; background: #e7e7e7; font-size: var(--icon-size); line-height: 1; }
.remove-kept:hover:enabled > span { background: #dedede; }
.gallery-navigation { position: absolute; top: calc(50% - 44px); left: 0; right: 0; z-index: 2; height: 44px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.slide-button { display: grid; place-items: center; width: 44px; min-width: 44px; height: 44px; padding: 0; background: transparent; pointer-events: auto; }
.slide-button > span { display: grid; place-items: center; width: var(--badge-size); height: var(--badge-size); border-radius: 3px; background: #eeeeeeeb; font-size: var(--icon-small); line-height: 1; }
.slide-button:hover:enabled { background: transparent; }
.slide-button:hover:enabled > span { background: #dedede; }
.slide-button:focus-visible { outline: 0; }
.slide-button:disabled { opacity: .35; }
.secondary-button { background: #e1e1e1; }
.text-button { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: #9b9b9b; }
.controls { min-width: 0; }
.model-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.model-controls > fieldset { display: grid; }
.model-controls .model-trigger { height: 100%; }
.model-trigger { display: flex; align-items: center; gap: 8px; width: 100%; min-height: var(--choice-height); padding: 6px 10px; background: #e9e9e9; text-align: left; }
.model-trigger svg { width: var(--choice-thumbnail-width); height: var(--choice-thumbnail-height); flex: 0 0 var(--choice-thumbnail-width); }
.model-trigger > [aria-hidden="true"]:last-child { display: grid; place-items: center; width: var(--icon-small); flex: 0 0 var(--icon-small); font-size: 0; }
.model-trigger > [aria-hidden="true"]:last-child::before { content: ""; width: .4375rem; height: .4375rem; border-right: .09375rem solid currentColor; border-bottom: .09375rem solid currentColor; transform: translateY(-.125rem) rotate(45deg); }
.model-current-name { flex: 1; min-width: 0; overflow-wrap: anywhere; line-height: 1.5; }
.model-trigger:disabled, .color-trigger:disabled, fieldset:disabled .segmented { opacity: .42; }
.model-palette, .shape-palette { width: min(344px, calc(100vw - 16px)); }
.model-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.model-option, .shape-option { position: relative; cursor: pointer; min-width: 0; }
.model-face { display: flex; flex-direction: column; align-items: center; position: relative; height: 100%; padding: 6px 2px; border-radius: 6px; background: #e9e9e9; text-align: center; }
.model-face svg { display: block; width: 100%; height: 70px; }
.model-face > span { line-height: 1.5; overflow-wrap: anywhere; }
.control-section { padding: 0 0 12px; }
.control-section + .control-section { padding-top: 12px; border-top: 1px solid var(--rule); }
#appearance-colors { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.earring-controls { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .8fr) auto; align-items: center; gap: 8px; }
#earring-colors { display: grid; grid-template-columns: repeat(2, minmax(var(--target-size), auto)); gap: 12px; }
#earring-colors > fieldset, #appearance-colors > fieldset { display: flex; flex-direction: column; align-items: center; }
#earring-colors .color-inline-label, #appearance-colors .color-inline-label { max-width: 100%; margin: 0; line-height: 1.25; text-align: center; }
#appearance-colors .color-trigger { margin-top: auto; }
#earring-reasons #metal-reason:not([hidden]) ~ #ornament-reason { display: none; }
.color-inline-label { display: inline-block; vertical-align: middle; margin-right: 4px; font-weight: 550; cursor: pointer; }
.color-trigger { width: var(--target-size); height: var(--target-size); padding: 6px; flex: 0 0 var(--target-size); border-radius: 50%; vertical-align: middle; }
.color-trigger > span { display: block; width: var(--color-swatch-size); height: var(--color-swatch-size); border: 2px solid var(--color-swatch-stroke); border-radius: 50%; background: var(--current-color); }
.selection-popover { position: fixed; inset: auto; margin: 0; max-height: calc(100svh - 16px); overflow: auto; padding: 12px; border: 1px solid var(--rule); border-radius: 10px; background: #fff; color: var(--text); box-shadow: 0 6px 24px #0002; }
.selection-popover[data-measuring] { display: block; visibility: hidden; pointer-events: none; }
.color-palette { width: min(296px, calc(100vw - 16px)); }
.palette-heading { display: flex; align-items: center; justify-content: flex-end; }
.palette-label { margin-right: auto; font-weight: 550; }
.palette-color-preview { width: var(--color-swatch-size); height: var(--color-swatch-size); flex: 0 0 var(--color-swatch-size); margin-right: auto; background: var(--current-color); box-shadow: inset 0 0 0 1px #0003; }
.palette-heading button { width: var(--target-size); padding: 6px; font-size: var(--icon-size); line-height: 1; }
.color-presets { display: grid; grid-template-columns: repeat(4, minmax(44px, 1fr)); gap: 8px; margin-block: 4px 8px; }
.color-preset { position: relative; display: grid; place-items: center; min-height: 44px; cursor: pointer; }
.color-preset-face { display: grid; place-items: center; width: var(--target-size); height: var(--target-size); border-radius: 6px; }
.color-preset-face::before { content: ""; box-sizing: border-box; width: var(--color-swatch-size); height: var(--color-swatch-size); border: 2px solid var(--color-swatch-stroke); border-radius: 50%; background: var(--preset-color); }
.color-preset:hover input:not(:checked) + span { background: #e9e9e9; }
.named-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.named-presets .color-preset { align-content: start; gap: 4px; padding: 8px 4px; border-radius: 6px; text-align: center; }
.named-presets .color-preset:has(input:checked) { background: var(--selected); }
.named-presets .color-preset:hover:not(:has(input:checked)) { background: #e9e9e9; }
.color-preset-name { font-size: var(--font-control); line-height: 1.5; overflow-wrap: anywhere; }
.custom-color summary { min-height: 44px; padding: 10px 0; cursor: pointer; }
.sv-plane { position: relative; width: min(100%, calc(100svh - 156px)); aspect-ratio: 1; margin: 4px auto 0; touch-action: none; cursor: crosshair; background: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent), var(--hue-color); }
.sv-handle { position: absolute; width: 16px; height: 16px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #292929; transform: translate(-50%, -50%); pointer-events: none; }
.hue-slider { display: block; appearance: none; width: 100%; height: 44px; margin: 8px 0 0; background: transparent; cursor: pointer; }
.hue-slider::-webkit-slider-runnable-track { height: 24px; border-radius: 6px; background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }
.hue-slider::-moz-range-track { height: 24px; border-radius: 6px; background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }
.hue-slider::-webkit-slider-thumb { appearance: none; width: 20px; height: 20px; margin-top: 2px; border: 2px solid #fff; border-radius: 50%; background: var(--hue-color); box-shadow: 0 0 0 1px #292929; }
.hue-slider::-moz-range-thumb { width: 16px; height: 16px; border: 2px solid #fff; border-radius: 50%; background: var(--hue-color); box-shadow: 0 0 0 1px #292929; }
.shape-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.shape-face { min-height: 64px; padding: 8px 2px; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: #e9e9e9; position: relative; }
.shape-face svg { width: var(--choice-thumbnail-width); height: var(--choice-thumbnail-height); }
.size-field, .size-field > div { min-width: 0; }
.size-palette { width: min(260px, calc(100vw - 16px)); }
.size-options { width: 100%; background: #e2e2e2; }
.size-options label > span { min-width: 0; padding-inline: 8px; }
fieldset:disabled label, fieldset:disabled input { cursor: default; }
.disabled-reason { margin-top: 4px; color: var(--quiet); font-size: var(--font-caption); }
.history-actions { display: flex; align-items: center; gap: 8px 4px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--rule); }
.history-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.history-actions > button { padding-inline: 5px; }
.history-actions [aria-hidden="true"] { display: inline-grid; place-items: center; width: var(--icon-size); height: var(--icon-size); font-size: var(--icon-size); line-height: 1; }
.error-message { padding: 0 20px 20px; }
.color-tips { max-width: var(--content-width); margin: 0 auto; padding: var(--article-space-section) var(--article-gutter); border-top: 1px solid var(--rule); }
.color-tips > h2 { margin: 0 0 var(--article-space-group); font-size: var(--article-font-title); overflow-wrap: anywhere; }
.tips-intro, .color-tips > .howto-note { margin-bottom: var(--article-space-paragraph); }
.tips-list h3 { margin: 0 0 var(--article-space-small); }
.tips-list h3 a { display: inline-flex; align-items: center; gap: .35em; min-height: var(--target-size); max-width: 100%; color: var(--link); text-decoration: none; }
.tips-list p { overflow-wrap: anywhere; }
.color-tips > .howto-note:last-child { margin: var(--article-space-group) 0 0; }
.noscript { margin: 32px; }
@container (min-width: 760px) {
  .previews { --max-visible-portraits: 3; }
}
@media (min-width: 960px) and (min-height: 700px) {
  .workspace { min-height: min(100svh, calc(var(--portrait-max-height) + var(--portrait-viewport-space))); }
  .controls { min-height: var(--controls-min-height); align-self: center; }
  .preview-panel { position: sticky; top: 0; }
}
@media (max-width: 1100px) and (min-width: 960px) {
  .workspace { gap: 24px; grid-template-columns: minmax(0, 1fr) 400px; padding-inline: 24px; }
}
@media (max-width: 959px) {
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: var(--page-top-space) 20px 32px; max-width: 720px; }
  .preview-panel { border-radius: 8px; }
  .preview-toolbar { padding: 10px 12px 0; }
  .previews { --portrait-height-limit: clamp(220px, 34svh, 320px); padding: 4px 8px 8px; scroll-padding-inline: 8px; }
  .controls { width: 100%; }
}
@media (min-width: 360px) and (max-width: 959px) and (min-height: 760px) {
  .preview-panel { position: sticky; top: 0; z-index: 2; }
}
@media (max-width: 359px) {
  .workspace { padding-inline: 12px; }
  .shape-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .model-trigger { gap: 4px; padding-inline: 6px; }
}
@media (max-width: 520px) {
  .guide-page, .color-tips { --article-gutter: 20px; }
}
@media (max-width: 359px) {
  .guide-page, .color-tips { --article-gutter: 16px; }
}
@media (prefers-reduced-motion: no-preference) {
  button, .shape-face { transition: background-color .1s; }
}
