:root {
  color-scheme: light;
  --paper: #f5f2fa;
  --ink: #221932;
  --muted: #675e74;
  --line: #ded8e8;
  --violet: #5630cf;
  --deep: #2f2043;
  --mist: #eee7fc;
  --lime: #d5f594;
  --coral: #ffb1a1;
  --radius: 16px;
  font-family: 'Helvetica Neue', 'Hiragino Sans', 'Yu Gothic UI', Meiryo, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overflow-wrap: anywhere;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
select,
summary,
input[type='file'] {
  -webkit-tap-highlight-color: transparent;
}
button,
select,
summary,
a {
  touch-action: manipulation;
}
button,
.button {
  cursor: pointer;
}
a {
  color: var(--violet);
  text-underline-offset: 3px;
}
:focus-visible {
  outline: 3px solid #9b54ee;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.bar {
  background: white;
  border-bottom: 1px solid var(--line);
}
.bar-in {
  max-width: 620px;
  margin: auto;
  padding: 8px 18px;
  min-height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.09rem;
  font-weight: 850;
  letter-spacing: -0.04em;
  min-height: 44px;
}
.brand-icon {
  position: relative;
  display: grid;
  place-items: center;
  background: var(--violet);
  color: white;
  height: 33px;
  width: 35px;
  border-radius: 10px;
  font-size: 24px;
  line-height: 1;
}
.brand-icon::before {
  position: absolute;
  content: '';
  width: 19px;
  height: 12px;
  border: 1.5px solid #fff;
  border-radius: 3px;
  transform: rotate(-12deg);
}
.brand-icon {
  font-size: 13px;
}
.user {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}
.avatar {
  border-radius: 50%;
  height: 28px;
  width: 28px;
  display: inline-grid;
  place-items: center;
  background: var(--lime);
  color: #2f3d1c;
}
main {
  max-width: 620px;
  margin: auto;
  padding: 20px 16px calc(104px + env(safe-area-inset-bottom));
  min-height: 69vh;
}
main:focus {
  outline: none;
}
h1,
h2,
h3,
p,
dl {
  margin: 0;
}
h1 {
  font-size: clamp(1.75rem, 7vw, 2.3rem);
  line-height: 1.22;
  letter-spacing: -0.055em;
  margin: 2px 0 16px;
  font-weight: 850;
}
h2 {
  font-size: 1.13rem;
  letter-spacing: -0.035em;
  line-height: 1.4;
  font-weight: 820;
}
h3 {
  font-size: 1rem;
  line-height: 1.45;
}
.section {
  margin: 24px 0 0;
}
.section-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}
.count {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}
.card,
.ticket-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 2px 7px #26104405;
}
.panel {
  padding: 16px;
}
.stack,
.form {
  display: grid;
  gap: 12px;
}
.stack.tight {
  gap: 7px;
}
.muted,
.quiet,
small {
  color: var(--muted);
}
.quiet {
  font-size: 0.84rem;
  line-height: 1.6;
}
.empty {
  padding: 18px 16px;
  border: 1px dashed #cfc6dc;
  border-radius: 13px;
  color: var(--muted);
  font-size: 0.9rem;
}
.back {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}
.back::before {
  content: '‹';
  font-size: 1.4rem;
  line-height: 1;
}
.row-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  color: var(--ink);
  text-decoration: none;
  min-height: 53px;
}
.row-link + .row-link {
  border-top: 1px solid var(--line);
}
.row-link .grow {
  flex: 1;
}
.row-link .arrow {
  color: var(--muted);
  font-size: 1.3rem;
}
.row-link .glyph {
  width: 34px;
  height: 34px;
  background: var(--mist);
  color: var(--violet);
  display: grid;
  place-items: center;
  border-radius: 10px;
}
.row-link strong,
.row-link small {
  display: block;
}
.row-link small {
  font-size: 0.79rem;
}
.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
  flex-shrink: 0;
}
nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  background: #fffffff7;
  border-top: 1px solid var(--line);
  z-index: 4;
  padding: 3px max(9px, calc((100vw - 620px) / 2)) calc(3px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
nav a {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 55px;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 700;
}
nav a span {
  min-width: 46px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 20px;
}
nav a[aria-current='page'] {
  color: var(--violet);
}
nav a[aria-current='page'] span {
  background: var(--mist);
}
.hero,
.detail-cover {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--violet);
  color: white;
  border-radius: 20px;
  padding: 20px;
}
.hero h1,
.detail-cover h2 {
  margin: 5px 0 10px;
  font-size: clamp(1.7rem, 7vw, 2.25rem);
  line-height: 1.22;
  font-weight: 850;
  letter-spacing: -0.045em;
}
.hero-top {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: space-between;
  padding-right: 46px;
}
.hero-top small {
  color: #eee6ff;
  font-weight: 600;
}
.hero h1 {
  max-width: 87%;
}
.hero .stub {
  position: absolute;
  right: -23px;
  top: 9px;
  width: 66px;
  height: 83px;
  transform: rotate(13deg);
  z-index: -1;
}
.stub {
  flex: 0 0 auto;
  width: 47px;
  height: 57px;
  overflow: hidden;
  border-radius: 7px;
  position: relative;
  background-color: #d8f298;
  color: #44394c;
  background-image: repeating-radial-gradient(
    ellipse at 105% 100%,
    transparent 0px 4px,
    #43344b 4.8px 5.4px,
    transparent 6.3px 7.2px
  );
}
.stub::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 9px;
  background:
    repeating-linear-gradient(
      90deg,
      #342736 0px 2px,
      transparent 2px 4px,
      #342736 4px 5px,
      transparent 5px 8px
    ),
    #ffffff70;
  border-top: 1px dashed #4c3b66;
}
.stub.b {
  background-color: #d3b8ff;
  background-image: repeating-linear-gradient(
    121deg,
    transparent 0 4px,
    #65537b 5px 6px,
    transparent 7px 9px
  );
}
.stub.c {
  background-color: #ffb7a5;
  background-image: repeating-radial-gradient(
    ellipse at 55% 58%,
    transparent 0 5px,
    #52374b 5.6px 6.6px,
    transparent 7.5px 9px
  );
}
.count-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-top: 13px;
}
.metric {
  padding: 7px 5px 6px 9px;
  border-radius: 9px;
  color: white;
  text-decoration: none;
  background: #ffffff17;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  min-height: 45px;
  flex-wrap: wrap;
  align-content: center;
}
.metric .name {
  font-size: 0.76rem;
  line-height: 1.25;
  font-weight: 650;
}
.metric .num {
  font-size: 1.22rem;
  font-weight: 750;
  white-space: nowrap;
  line-height: 1.1;
}
.metric .num small {
  color: #eee9fa;
  font-size: 0.65rem;
  margin-left: 2px;
}
.ticket-card {
  display: block;
  text-decoration: none;
  color: var(--ink);
  overflow: hidden;
  padding: 13px 14px;
}
a.ticket-card:hover,
a.row-link:hover {
  background-color: #fcfaff;
}
.card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-top > div:last-child {
  min-width: 0;
  flex: 1;
}
.eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.03em;
  color: var(--muted);
}
.title {
  font-size: 1.18rem;
  font-weight: 820;
  letter-spacing: -0.035em;
  line-height: 1.4;
}
.tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 4px 0;
}
.chip {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.55;
  background: var(--mist);
  color: #4a3386;
}
.chip.lime {
  color: #31471b;
  background: var(--lime);
}
.chip.coral {
  color: #742f24;
  background: #ffdad0;
}
.ticket-data {
  display: grid;
  grid-template-columns: 4.8em minmax(0, 1fr);
  gap: 2px 6px;
  margin-top: 10px;
  font-size: 0.83rem;
}
.ticket-data dt,
.facts dt {
  color: var(--muted);
}
.ticket-data dd,
.facts dd {
  margin: 0;
  font-weight: 620;
}
.card-foot {
  margin: 11px -14px -13px;
  padding: 8px 14px;
  border-top: 1px dashed var(--line);
  display: flex;
  gap: 6px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.8rem;
}
.card-foot strong {
  font-size: 0.99rem;
}
.detail-cover {
  background: var(--deep);
  border-radius: var(--radius);
}
.detail-cover .stub {
  float: right;
  margin: 3px 0 6px 12px;
  width: 47px;
  height: 64px;
}
.detail-cover .eyebrow,
.detail-cover .ticket-data dt,
.detail-cover .quiet {
  color: #dfd4f2;
}
.detail-cover .ticket-data {
  border-top: 1px dashed #867399;
  padding-top: 9px;
}
.detail-cover .chip {
  background: var(--lime);
  color: #334226;
}
.main-action,
.button {
  border-radius: 10px;
  border: 1px solid var(--violet);
  min-height: 46px;
  padding: 10px 14px;
  font-weight: 750;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 7px;
  cursor: pointer;
}
.main-action {
  background: var(--violet);
  color: white;
}
.button {
  background: white;
  color: var(--violet);
  border-color: #cdc2e0;
}
.button.tone {
  background: var(--mist);
  border-color: transparent;
}
.button.danger {
  color: #873f39;
  border-color: #e3c5c2;
}
button:disabled {
  opacity: 0.56;
  cursor: wait;
}
.wide {
  width: 100%;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}
.actions > * {
  flex: 1 1 auto;
}
.filters {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}
.segment {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
  border-radius: 12px;
  background: #e9e3f0;
}
.segment button {
  min-height: 44px;
  border: 0;
  border-radius: 9px;
  font-weight: 700;
  background: transparent;
  color: var(--muted);
}
.segment button[aria-pressed='true'] {
  color: var(--violet);
  background: white;
  box-shadow: 0 1px 4px #30214714;
}
.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 7px;
  align-items: end;
}
input:not([type='radio']):not([type='checkbox']):not([type='file']),
select,
textarea {
  width: 100%;
  min-height: 45px;
  padding: 9px 11px;
  border: 1px solid #cbc2d8;
  background: white;
  color: var(--ink);
  border-radius: 9px;
  font-size: 1rem;
}
label {
  display: grid;
  gap: 5px;
  font-size: 0.86rem;
  font-weight: 690;
}
fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
legend {
  font-size: 0.86rem;
  font-weight: 690;
  padding: 0 0 5px;
}
.options {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.options label,
.check {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  cursor: pointer;
}
.options label {
  flex: 1;
  background: white;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
input[type='radio'],
input[type='checkbox'] {
  accent-color: var(--violet);
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}
textarea {
  resize: vertical;
  min-height: 76px;
}
.facts {
  display: grid;
  padding: 0 15px;
}
.facts > div {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr);
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
  font-size: 0.87rem;
}
.facts > div:last-child {
  border-bottom: 0;
}
.facts dd {
  text-align: right;
  white-space: pre-wrap;
}
.note,
.good,
.warning {
  border-radius: 11px;
  padding: 12px 14px;
  font-size: 0.87rem;
}
.note {
  background: var(--mist);
  color: #46356a;
}
.good {
  background: #e5f5c7;
  color: #33471d;
}
.warning {
  background: #ffebe4;
  color: #7d382a;
}
.pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.stat {
  padding: 12px;
  border-radius: 12px;
  background: var(--mist);
}
.stat small,
.stat strong {
  display: block;
}
.stat.good {
  background: #e4f4c9;
}
.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 13px;
  font-size: 0.8rem;
}
.timeline {
  list-style: none;
  margin: 0;
  padding: 3px 15px;
}
.timeline li {
  display: grid;
  grid-template-columns: 5.2em minmax(0, 1fr);
  gap: 13px;
  padding: 10px 0;
  font-size: 0.84rem;
}
.timeline time {
  color: var(--muted);
}
.timeline li > div {
  border-left: 2px solid #d9c9f4;
  padding-left: 12px;
  position: relative;
}
.timeline li > div::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--violet);
}
.pick {
  position: relative;
  min-height: 50px;
  cursor: pointer;
  border: 1px dashed #b5a3cd;
  border-radius: 10px;
  padding: 11px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--violet);
  background: #faf7ff;
  font-size: 0.86rem;
}
.pick input {
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.pick:focus-within {
  outline: 2px solid var(--violet);
}
.media-list {
  display: grid;
  gap: 9px;
}
.media-item {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}
.media-item img,
.media-item video {
  width: 68px;
  height: 63px;
  object-fit: cover;
  border-radius: 5px;
  background: var(--paper);
}
.media-item .button {
  font-size: 0.78rem;
  padding: 4px 10px;
  margin-top: 4px;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.gallery article {
  overflow: hidden;
  padding: 9px;
}
.gallery img,
.gallery video {
  display: block;
  width: 100%;
  height: 130px;
  object-fit: contain;
  background: #eee9f2;
  border-radius: 8px;
}
.gallery img {
  object-fit: cover;
}
.gallery p {
  margin: 7px 0 3px;
  font-size: 0.85rem;
  font-weight: 700;
}
.gallery button {
  margin-top: 6px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
#toast {
  position: fixed;
  z-index: 8;
  bottom: calc(75px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--deep);
  color: white;
  padding: 10px 15px;
  border-radius: 10px;
  font-size: 0.85rem;
  width: max-content;
  max-width: 90vw;
  pointer-events: none;
}
#toast:empty {
  display: none;
}
.error {
  color: #872e2c;
  font-size: 0.88rem;
}
.error:empty {
  display: none;
}
.source-excerpt {
  white-space: pre-wrap;
  padding: 12px;
  background: #f6f2fa;
  border-radius: 8px;
  font-size: 0.87rem;
}
details summary {
  min-height: 44px;
  display: list-item;
  padding: 10px 0;
  cursor: pointer;
  font-weight: 700;
}
@media (max-width: 360px) {
  main {
    padding-inline: 11px;
  }
  .hero {
    padding: 15px;
  }
  .metric {
    padding-left: 6px;
  }
  .count-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 700px) {
  main {
    padding-top: 28px;
  }
  .hero,
  .detail-cover {
    padding: 24px;
  }
}

.refresh-line {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.gallery .media-preview {
  display: block;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  width: 100%;
  cursor: zoom-in;
}
.photo-dialog {
  width: min(94vw, 660px);
  max-height: 90dvh;
  overflow: auto;
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 14px;
  color: var(--ink);
  background: var(--paper);
}
.photo-dialog::backdrop {
  background: #251a36aa;
}
.dialog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.photo-large {
  width: 100%;
  max-height: 52dvh;
  object-fit: contain;
  background: var(--deep);
  border-radius: 8px;
  margin-bottom: 8px;
}
