:root {
  font-family: Inter,"Noto Sans JP",system-ui,sans-serif;
  color: #075d68;
  background: #f4fbfa;
  line-height: 1.6;
  --ink: #075d68;
  --accent: #f17d83;
  --sun: #f3c956;
  --aqua: #35aeb7;
  --paper: #fff;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
}
button,
input,
textarea {
  font: inherit;
}
button {
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  padding: .7rem 1.2rem;
  cursor: pointer;
}
button:hover {
  opacity: .85;
}
button:disabled {
  cursor: wait;
  opacity: .55;
}
header {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1rem,4vw,4rem);
  border-bottom: 1px solid #cde5e3;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(10px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
}
.brand img {
  display: block;
  width: auto;
  height: 45px;
}
.brand small {
  font-size: .65rem;
  color: var(--accent);
}
#user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}
#points {
  padding: .15rem .55rem;
  border-radius: 999px;
  color: #9b351f;
  background: #ed5b3d1a;
  font-size: .8rem;
  font-weight: 800;
}
#user-id {
  font-weight: 700;
}
.quiet {
  background: transparent;
  color: var(--ink);
  padding: .4rem;
}
.auth-card {
  max-width: 560px;
  margin: 8vh auto;
  padding: clamp(1.5rem,5vw,4rem);
  background: var(--paper);
  border-radius: 28px;
  box-shadow: 0 16px 60px #075d6817;
}
#auth.auth-card {
  max-width: 940px;
  display: grid;
  grid-template-columns: minmax(220px,.85fr) minmax(300px,1.15fr);
  align-items: center;
  gap: clamp(2rem,5vw,4rem);
}
.auth-logo {
  display: block;
  width: 100%;
  border-radius: 22%;
}
.auth-content {
  min-width: 0;
}
#auth .auth-content h1 {
  font-size: clamp(1rem,5vw,1.9rem);
  white-space: nowrap;
}
.auth-card h1,
#dashboard h1 {
  font-size: clamp(2.2rem,7vw,4.5rem);
  line-height: 1.08;
  margin: .2rem 0 2rem;
}
.eyebrow {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .18em;
  color: var(--accent);
}
form label {
  display: grid;
  gap: .35rem;
  margin: 1rem 0;
  font-weight: 700;
}
input,
textarea {
  width: 100%;
  border: 1px solid #cbc5b9;
  border-radius: 12px;
  padding: .75rem;
  background: white;
}
input:focus,
textarea:focus {
  outline: 3px solid #ed5b3d33;
  border-color: var(--accent);
}
.actions {
  display: flex;
  gap: .6rem;
}
.service-credit {
  margin: 1.5rem 0 0;
  color: #69716d;
  font-size: .78rem;
  line-height: 1.8;
}
.service-credit a {
  color: var(--ink);
}
.secondary {
  background: var(--accent);
}
.error {
  color: #b52e20;
  min-height: 1.5em;
}
.terms-consent {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .9rem;
}
.terms-consent input {
  width: auto;
  margin: 0;
}
.terms-consent a,
.terms-page a {
  color: var(--accent);
}
.terms-page {
  width: min(720px,calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2rem,6vw,5rem) 0;
  line-height: 1.8;
}
.terms-page h1 {
  font-size: clamp(2.4rem,7vw,4.5rem);
}
.terms-page h2 {
  margin-top: 2rem;
}
.terms-updated {
  margin-top: 3rem;
  color: #69716d;
}
#dashboard {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(2rem,6vw,5rem) 1.2rem;
}
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
}
#dashboard .section-title {
  margin-bottom: 2rem;
}
.content-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.content-heading h2 {
  margin: 0;
}
.content-heading button:disabled {
  cursor: not-allowed;
  color: #69716d;
  background: #e4ded3;
}
.plan-card {
  background: linear-gradient(145deg,#fffdf8,#edf4ef);
}
.document-format {
  margin-left: auto;
  padding: .2rem .65rem;
  border-radius: 999px;
  background: #e7eee9;
  font-size: .75rem;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}
.content-section-title {
  margin-top: 3rem;
}
.site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(230px,1fr));
  gap: 1rem;
}
.site-card {
  min-height: 150px;
  border-radius: 20px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid #e4ded3;
  position: relative;
}
.delete-icon {
  position: absolute;
  top: .7rem;
  right: .7rem;
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 50%;
  opacity: .55;
}
.delete-icon:hover,
.delete-icon:focus {
  background: #b52e2018;
  opacity: 1;
  outline: none;
}
.trash-footer {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #ded8cc;
}
.dashboard-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem 1.2rem;
  padding: 1.5rem 0 0;
  text-align: center;
  font-size: .85rem;
}
.dashboard-footer a {
  color: #69716d;
}
.site-card strong {
  font-size: 1.25rem;
}
.site-card span {
  font-size: .8rem;
  color: #69716d;
}
.empty {
  color: #69716d;
}
.editor-bar {
  height: 58px;
  padding: 0 1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  border-bottom: 1px solid #ddd5c8;
  background: var(--paper);
}
.editor-bar strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.publish {
  margin-left: 0;
  white-space: nowrap;
}
#preview-reload {
  margin-left: auto;
  white-space: nowrap;
}
#share {
  white-space: nowrap;
}
#flyer-download {
  margin-left: auto;
  white-space: nowrap;
}
.flyer-preview-pane {
  min-width: 0;
  min-height: calc(100vh - 126px);
  padding: clamp(1rem,3vw,2.5rem);
  display: grid;
  place-items: center;
  overflow: auto;
  background: #ded8cc;
}
#flyer-preview {
  display: block;
  max-width: min(100%,720px);
  max-height: calc(100vh - 180px);
  aspect-ratio: 210 / 297;
  object-fit: contain;
  box-shadow: 0 12px 40px #28231d44;
}
#flyer-empty {
  color: #69716d;
  text-align: center;
}
.publish input {
  width: auto;
}
.editor-bar a {
  color: var(--accent);
  white-space: nowrap;
}
dialog {
  width: min(920px,calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  border: 0;
  border-radius: 24px;
  padding: clamp(1rem,3vw,2rem);
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 24px 80px #28231d55;
}
dialog::backdrop {
  background: #28231d88;
  backdrop-filter: blur(4px);
}
.mypage-dialog {
  max-width: 520px;
}
.share-dialog {
  max-width: 440px;
  text-align: center;
}
.history-dialog {
  max-width: 620px;
}
.history-list {
  display: grid;
  gap: .7rem;
  max-height: 55vh;
  overflow: auto;
}
.history-list.flyer-history {
  grid-template-columns: repeat(5,minmax(110px,1fr));
  align-items: start;
  overflow-x: auto;
}
.history-thumbnail {
  display: grid;
  gap: .45rem;
  min-width: 110px;
  padding: .45rem;
  border-radius: 10px;
  background: #f3efe7;
  color: var(--ink);
  text-align: left;
}
.history-thumbnail img {
  width: 100%;
  aspect-ratio: 210 / 297;
  border-radius: 6px;
  object-fit: cover;
  background: white;
}
.history-thumbnail small {
  font-size: .68rem;
  line-height: 1.35;
}
.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem 0;
  border-bottom: 1px solid #e4ded3;
}
.history-row div {
  display: grid;
  min-width: 0;
}
.history-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-row small {
  color: #69716d;
}
.history-row button {
  flex: 0 0 auto;
}
.share-dialog .dialog-header {
  text-align: left;
}
#share-content {
  display: grid;
  justify-items: center;
  gap: 1rem;
  margin-top: 1rem;
}
#share-qr {
  width: min(320px,100%);
  height: auto;
  border-radius: 12px;
}
#share-url {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--accent);
}
.dialog-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
}
.dialog-header h2 {
  margin: 0;
  font-size: 2rem;
}
.dialog-header .eyebrow {
  margin: 0;
}
#contents-close {
  font-size: 1.6rem;
}
.content-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0 0;
}
.content-form {
  display: grid;
  align-content: start;
  gap: .65rem;
  padding: 1rem;
  border: 1px solid #e4ded3;
  border-radius: 16px;
}
.content-form h3 {
  margin: 0;
}
.content-form select {
  min-width: 0;
  padding: .65rem;
  border: 1px solid #cbc5b9;
  border-radius: 10px;
  background: white;
}
.content-form small {
  color: #69716d;
}
.content-status {
  min-height: 1.6em;
  color: #69716d;
}
.contents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(160px,1fr));
  gap: 1rem;
}
.content-card {
  min-width: 0;
  padding: .7rem;
  border: 1px solid #e4ded3;
  border-radius: 14px;
  background: white;
}
.content-card > strong,
.content-card > small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.content-card > small {
  color: #69716d;
}
.content-description {
  height: 2.8em;
  margin: .35rem 0;
  overflow: hidden;
  color: #69716d;
  font-size: .75rem;
  line-height: 1.4;
}
.content-preview {
  height: 120px;
  display: grid;
  place-items: center;
  margin-bottom: .55rem;
  overflow: hidden;
  border-radius: 9px;
  background: #eee9df;
}
.content-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.content-preview audio {
  width: calc(100% - 1rem);
}
.file-preview {
  font-weight: 900;
  font-size: 1.3rem;
  color: var(--accent);
}
.content-actions {
  display: flex;
  justify-content: space-between;
  margin-top: .4rem;
}
.content-actions button {
  font-size: .72rem;
}
.danger {
  color: #b52e20;
}
.admin-main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1rem;
}
.admin-main #admin-panel h1 {
  margin: .2rem 0 1.5rem;
  font-size: clamp(2rem,6vw,4rem);
}
.admin-setting {
  display: flex;
  align-items: end;
  gap: .7rem;
  max-width: 520px;
  margin-bottom: 1rem;
}
.admin-setting label {
  flex: 1;
  margin: 0;
}
.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid #e4ded3;
  border-radius: 16px;
  background: var(--paper);
}
.admin-table-wrap table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table-wrap th,
.admin-table-wrap td {
  padding: .8rem;
  border-bottom: 1px solid #e4ded3;
  text-align: left;
  white-space: nowrap;
}
.admin-table-wrap td:last-child {
  display: flex;
  gap: .5rem;
}
.admin-table-wrap button {
  padding: .45rem .8rem;
  font-size: .8rem;
}
.admin-table-wrap input[type="number"] {
  width: 8rem;
  padding: .4rem .55rem;
}
.danger-button {
  background: #b52e20;
}
.editor-panes {
  display: grid;
  grid-template-columns: minmax(300px,38%) 1fr;
  height: calc(100vh - 126px);
}
.chat-pane {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 0;
  border-right: 1px solid #ddd5c8;
  background: var(--paper);
}
#messages,
#flyer-messages,
#plan-messages {
  overflow: auto;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: .8rem;
}
.plan-preview-pane {
  min-width: 0;
  min-height: calc(100vh - 126px);
  padding: clamp(1rem,3vw,2.5rem);
  overflow: auto;
  background: #ded8cc;
}
.markdown-document {
  width: min(100%,820px);
  min-height: 100%;
  margin: 0 auto;
  padding: clamp(1.5rem,4vw,4rem);
  background: white;
  box-shadow: 0 12px 40px #28231d33;
}
.markdown-document h1 {
  border-bottom: 2px solid var(--ink);
  line-height: 1.25;
}
.markdown-document h2 {
  margin-top: 2rem;
  border-bottom: 1px solid #ddd5c8;
}
.markdown-document pre {
  overflow: auto;
  padding: 1rem;
  border-radius: 8px;
  background: #f3f1ec;
  white-space: pre-wrap;
}
.markdown-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}
.markdown-document table {
  width: 100%;
  border-collapse: collapse;
}
.markdown-document th,
.markdown-document td {
  padding: .55rem .7rem;
  border: 1px solid #cbc5b9;
  text-align: left;
  vertical-align: top;
}
.markdown-document th {
  background: #f3f1ec;
}
.message {
  max-width: 88%;
  padding: .75rem 1rem;
  border-radius: 18px;
  background: #eee9df;
  white-space: pre-wrap;
}
.message.user {
  align-self: flex-end;
  background: var(--accent);
  color: white;
}
.message.thinking {
  display: flex;
  align-items: center;
  gap: 0;
  color: #68706c;
}
.thinking-label {
  font-size: .82rem;
}
.thinking-dots {
  display: inline-flex;
  width: 3ch;
  color: var(--accent);
  font-family: monospace;
}
.thinking-dots i {
  width: 1ch;
  font-style: normal;
}
.thinking-dots i:nth-child(2) {
  animation: thinking-dot-2 1.5s step-end infinite;
}
.thinking-dots i:nth-child(3) {
  animation: thinking-dot-3 1.5s step-end infinite;
}
.message.failed {
  color: #b52e20;
  background: #fff0ed;
  font-size: .85rem;
}
@keyframes thinking-dot-2 {
  0%,
  33.32% {
    visibility: hidden;
  }
  33.33%,
  100% {
    visibility: visible;
  }
}
@keyframes thinking-dot-3 {
  0%,
  66.65% {
    visibility: hidden;
  }
  66.66%,
  100% {
    visibility: visible;
  }
}
@media (prefers-reduced-motion:reduce) {
  .thinking-dots i {
    animation: none;
    visibility: visible;
  }
}
.chat-pane form {
  display: flex;
  align-items: end;
  gap: .5rem;
  padding: 1rem;
  border-top: 1px solid #ddd5c8;
}
.chat-pane form label {
  margin: 0;
}
.chat-pane textarea {
  resize: none;
}
.chat-pane form button {
  flex: 0 0 auto;
  white-space: nowrap;
  writing-mode: horizontal-tb;
}
.chat-pane form button:disabled {
  cursor: wait;
  opacity: .55;
}
.preview-pane {
  position: relative;
  padding: 1.2rem;
  background: #ddd8ce;
}
.preview-pane::before {
  content: "プレビューを読み込み中・・・";
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 1;
  padding: .6rem 1rem;
  border-radius: 999px;
  color: #69716d;
  background: var(--paper);
  transform: translate(-50%,-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
}
.preview-pane[data-loading="true"]::before {
  opacity: 1;
}
.preview-pane iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 10px;
  background: white;
  box-shadow: 0 8px 24px #3332;
}
.preview-pane[data-loading="true"] iframe {
  visibility: hidden;
}
.mobile-tabs {
  display: none;
}
@media (max-width:700px) {
  header {
    height: 56px;
  }
  .editor-bar {
    height: 62px;
  }
  .editor-bar #public-url {
    display: none;
  }
  #contents-button {
    font-size: .8rem;
  }
  .content-tools {
    grid-template-columns: 1fr;
  }
  .mobile-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--paper);
    padding: .4rem;
  }
  .mobile-tabs button {
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
  }
  .mobile-tabs button.active {
    background: var(--ink);
    color: white;
  }
  .editor-panes {
    display: block;
    height: calc(100vh - 158px);
  }
  .chat-pane,
  .preview-pane {
    height: 100%;
  }
  .editor-panes[data-pane="preview"] .chat-pane,
  .editor-panes:not([data-pane="preview"]) .preview-pane {
    display: none;
  }
  #flyer-editor .editor-panes {
    display: flex;
    flex-direction: column;
    height: auto;
  }
  #plan-editor .editor-panes {
    display: flex;
    flex-direction: column;
    height: auto;
  }
  #plan-editor .chat-pane {
    height: calc(100vh - 114px);
  }
  #plan-editor .plan-preview-pane {
    min-height: 70vh;
  }
  #flyer-editor .chat-pane {
    height: calc(100vh - 114px);
  }
  #flyer-editor .flyer-preview-pane {
    min-height: 70vh;
  }
  .section-title {
    align-items: center;
  }
  .section-title h1 {
    font-size: 2.4rem;
  }
  .section-title button {
    font-size: .85rem;
  }
  .auth-card {
    margin: 3vh 1rem;
  }
  #auth.auth-card {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .auth-logo {
    width: min(58vw,240px);
    margin: 0 auto;
  }
  .brand small {
    display: none;
  }
}
