:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #5f625d;
  --paper: #f8f5ef;
  --surface: #ffffff;
  --line: #d9d4ca;
  --action: #0f5b4c;
  --action-2: #273f7a;
  --brand-gold: #c99a2e;
  --brand-red: #9a2f24;
  --warning: #8a4d0f;
  --danger: #8d2929;
  font-family: Inter, "Hiragino Sans", "Noto Sans CJK SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

.time-field-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.time-field-pair .field {
  margin: 0;
}

.pay-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.duration-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 8px;
}

.pay-picker span {
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
  white-space: nowrap;
}

button {
  min-height: 48px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #f1b84b;
  outline-offset: 2px;
}

.app-shell {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: 14px;
}

.app-loading {
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 4px;
  color: var(--muted);
  font-size: 15px;
}

.app-loading strong {
  color: var(--ink);
  font-size: 20px;
}

.board-skeleton {
  display: grid;
  gap: 10px;
}

.board-skeleton i {
  display: block;
  height: 164px;
  border: 1px solid var(--line);
  border-left: 7px solid var(--action);
  border-radius: 8px;
  background: var(--surface);
}

.listing-examples {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 2px solid var(--line);
}

.listing-examples h2,
.listing-examples p {
  margin: 0;
}

.listing-examples > p:not(.kicker) {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.example-card {
  border-left-style: dashed;
  background: #fffcf3;
}

.availability-card.example-card {
  background: #f1f8f5;
}

.example-avatar {
  pointer-events: none;
}

.example-card-note {
  margin: 0;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.contact-sharing {
  display: grid;
  gap: 8px;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid var(--line);
}

.contact-sharing label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.account-bar {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.language-switcher {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.language-button {
  min-height: 32px;
  padding: 0 8px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.language-button.selected {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.account-controls,
.header-message-actions {
  display: flex;
  gap: 0;
}

.header-message-actions {
  gap: 8px;
  margin-top: 8px;
}

.header-message-actions button {
  min-height: 40px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
  font-size: 14px;
}

.header-message-actions button:first-child {
  color: var(--ink);
  border-color: var(--line);
}

.header-message-actions button:nth-child(2) {
  color: var(--action);
  border-color: var(--action);
}

.header-message-actions button:last-child {
  color: var(--action-2);
  border-color: var(--action-2);
}

.account-button {
  min-height: 36px;
  padding: 0 10px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
}

.hero-panel {
  min-height: 24vh;
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 14px 6px 12px;
}

.hero-note,
.auth-note {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
}

.kicker {
  margin: 0;
  color: var(--action);
  font-size: 14px;
  font-weight: 900;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 6px;
  font-size: clamp(34px, 12vw, 72px);
  line-height: 1.04;
  letter-spacing: 0;
}

.brand-title {
  display: inline-grid;
  grid-template-columns: 54px auto;
  align-items: center;
  gap: 12px;
  width: fit-content;
  margin-bottom: 2px;
  color: var(--ink);
  line-height: 1.1;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  aspect-ratio: 1;
  border: 2px solid #b78929;
  border-radius: 10px 4px 10px 4px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 44%),
    var(--brand-red);
  color: #fff8df;
  box-shadow: inset 0 0 0 3px rgba(255, 248, 223, 0.12);
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif CJK SC", serif;
  font-size: 28px;
  font-weight: 900;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-name {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif CJK SC", serif;
  font-size: clamp(25px, 7vw, 36px);
  font-weight: 900;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h2 {
  font-size: clamp(24px, 7vw, 40px);
  line-height: 1.12;
  margin-bottom: 10px;
}

h3 {
  font-size: 24px;
  margin-bottom: 4px;
}

.browse-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.browse-action {
  display: grid;
  gap: 5px;
  min-height: 94px;
  place-content: center;
  border-radius: 8px;
  color: white;
}

.browse-action strong {
  font-size: clamp(26px, 7vw, 38px);
}

.browse-action span {
  font-size: 17px;
  font-weight: 900;
}

.browse-action.find-worker {
  background: var(--action);
  border-color: var(--action);
}

.browse-action.find-job {
  background: var(--action-2);
  border-color: var(--action-2);
}

.browse-action.selected {
  box-shadow: inset 0 0 0 3px white, 0 0 0 3px var(--ink);
}

.auth-primary {
  flex-basis: 100%;
  background: #06c755;
  border-color: #06c755;
  font-size: 21px;
}

.board,
.flow-card {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.industry-groups {
  display: grid;
  gap: 16px;
}

.listing-phase {
  display: grid;
  gap: 12px;
}

.listing-phase + .listing-phase {
  padding-top: 16px;
  border-top: 2px solid var(--line);
}

.listing-phase-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.listing-phase-heading h2,
.listing-phase-heading p {
  margin: 0;
}

.listing-phase-heading h2 {
  font-size: 23px;
}

.listing-phase-heading p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  text-align: right;
}

.industry-group {
  display: grid;
  gap: 7px;
}

.industry-group > h3 {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 950;
  line-height: 1.1;
}

.industry-group > h3 span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.industry-list {
  display: grid;
  gap: 8px;
}

.board-hint {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
}

.updated {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

label {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.field {
  display: grid;
  gap: 6px;
}

.field-invalid label,
.field-error {
  color: #b42318;
}

.field-invalid input,
.field-invalid select,
.field-invalid textarea {
  border: 2px solid #d92d20;
  background: #fff8f7;
}

.field-error {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 10px 12px;
  font-size: 18px;
}

select[multiple] {
  min-height: 124px;
}

textarea {
  resize: vertical;
}

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

.status-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 7px solid var(--action);
  border-radius: 8px;
  background: #fffdfa;
}

.status-card.compact {
  position: relative;
  grid-template-columns: 68px 1fr;
  align-items: start;
  gap: 9px;
  padding: 9px;
}

/* The worker board is green all the way through: avatar, tab, border, and card. */
.availability-card {
  background: #f1f8f5;
}

.status-card.compact .card-main {
  display: contents;
}

.status-card.compact .card-top {
  grid-column: 2;
}

.status-card.compact .card-main > :not(.card-top) {
  grid-column: 1 / -1;
}

.status-card[data-state="paused"] {
  border-left-color: var(--warning);
}

.status-card[data-state="matched"],
.status-card[data-state="ended"] {
  border-left-color: var(--action-2);
}

.status-card[data-state="expired"] {
  border-left-color: var(--danger);
}

.job-card {
  border-left-color: var(--action-2);
  background: #f5f7ff;
}

.status-card.compact.job-card {
  grid-template-columns: minmax(0, 1fr);
}

.status-card.compact.job-card .card-top {
  grid-column: 1;
}

.job-card[data-state="paused"] {
  border-left-color: var(--warning);
}

.job-card[data-state="expired"] {
  border-left-color: var(--danger);
}

.historical-card {
  background: #f4f2ed;
  opacity: 0.82;
}

.historical-card .latest-case-preview,
.historical-card .more-actions {
  display: none;
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.card-top h3 {
  color: var(--ink);
  font-size: 21px;
  line-height: 1.2;
  margin-bottom: 3px;
}

.card-top p,
.note,
.card-facts,
.card-note {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.32;
}

.job-card .card-top h3 {
  font-size: 21px;
}

.card-facts strong,
.card-note strong {
  margin-right: 3px;
  color: var(--ink);
  font-weight: 900;
}

.structured-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 10px;
  margin: 0;
  padding: 8px 0 2px;
  border-top: 1px solid var(--line);
}

.structured-facts div {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
}

.structured-facts .structured-facts-priority {
  grid-column: auto;
}

.structured-facts .structured-facts-priority dd {
  font-size: 15px;
}

.structured-facts dt {
  flex: 0 0 auto;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.structured-facts dd {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.job-card .structured-facts {
  border-top-color: #cbd3ee;
}

.message-history {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.message-history summary {
  padding: 7px 0;
  color: var(--ink);
  cursor: pointer;
}

.message-history ul {
  display: grid;
  gap: 5px;
  margin: 0 0 7px;
  padding: 0;
  list-style: none;
}

.message-history li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}

.message-history li span {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.message-history li strong {
  color: var(--ink);
  font-size: 14px;
}

.message-history li small {
  color: var(--muted);
  font-size: 12px;
}

.listing-details {
  margin-top: 4px;
  border-top: 1px solid var(--line);
}

.listing-details summary {
  padding: 7px 0;
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 850;
}

.listing-details .structured-facts {
  margin-bottom: 6px;
}

.history-contact {
  display: grid;
  gap: 5px;
  padding-top: 4px;
}

.history-contact button {
  min-height: 42px;
  border-color: #c7c7c7;
  background: #e5e5e5;
  color: #858585;
  cursor: not-allowed;
}

.history-contact span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-align: center;
}

.state {
  align-self: start;
  min-width: max-content;
  padding: 5px 9px;
  border: 1px solid currentColor;
  font-size: 14px;
  font-weight: 900;
}

.time-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.time-row span {
  padding: 4px 7px;
  border: 1px solid var(--line);
  background: white;
}

.card-note {
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

.card-conditions {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.card-pay {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.3;
}

.card-pay strong {
  margin-right: 3px;
  font-weight: 950;
}

.form-section-title {
  margin: 16px 0 4px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
}

.card-conditions strong {
  margin-right: 3px;
  color: var(--ink);
  font-weight: 900;
}

.facts dt {
  color: var(--muted);
  font-weight: 800;
}

.facts dd {
  margin: 0;
  font-weight: 700;
}

.flag-row,
.card-actions,
.flow-actions,
.choice-grid,
.toggle-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.flag-row span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  background: white;
  font-size: 14px;
  font-weight: 800;
}

.card-actions button,
.flow-actions button,
.choice-grid button {
  flex: 1 1 132px;
  border-radius: 6px;
}

.card-actions button {
  min-height: 48px;
  background: var(--action);
  border-color: var(--action);
  color: white;
}

.job-card .card-actions button {
  background: var(--action-2);
  border-color: var(--action-2);
}

.card-actions button[disabled] {
  background: #ece8de;
  border-color: var(--line);
  color: var(--muted);
  cursor: default;
}

.case-thumb {
  width: 92px;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  background: var(--action-2);
}

.case-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.case-thumb:hover {
  border-color: var(--action);
}

label.case-thumb {
  display: block;
  cursor: pointer;
}

.case-thumb-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.profile-avatar {
  width: 68px;
  aspect-ratio: 1;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 6px;
  background: var(--action);
}

.profile-avatar img,
.profile-avatar-large {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.latest-case-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 38px;
  padding: 3px 8px 3px 3px;
  border-color: var(--line);
  background: white;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.latest-case-preview img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 3px;
}

.detail-map-panel {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fffdfa;
}

.detail-map-note {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.detail-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.detail-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.map-dot {
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--ink);
}

.map-dot.viewer { background: #273f7a; }
.map-dot.target { background: #c44d24; }

.detail-map {
  min-height: 220px;
  border: 1px solid var(--line);
  background: #e6edf0;
}

.leaflet-container {
  font: inherit;
}

.leaflet-popup-content {
  margin: 12px;
  color: var(--ink);
  font: inherit;
}

.card-main {
  display: grid;
  gap: 7px;
}

.card-title-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  justify-content: space-between;
}

.card-title-row h3 {
  margin: 0;
}

.sample-inline {
  display: inline;
  margin-left: 5px;
  color: var(--muted);
  font-size: 0.68em;
  font-weight: 800;
  line-height: 1.28;
}

.more-actions {
  flex: 1 1 120px;
  position: relative;
}

.more-menu {
  display: grid;
  gap: 6px;
  padding-top: 8px;
}

.more-menu button {
  min-height: 40px;
  background: white;
  border-color: var(--line);
  color: var(--ink);
  font-size: 14px;
}

.more-actions summary {
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 6px;
  font-weight: 900;
  cursor: pointer;
}

.more-actions > div {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.match-inline,
.cooperation-card {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--action-2);
  background: #f3f5fb;
}

.match-inline strong,
.cooperation-card strong {
  font-size: 16px;
}

.match-inline span,
.cooperation-card span,
.cooperation-card em {
  color: var(--muted);
  font-weight: 700;
}

.cooperation-card {
  border-color: var(--action);
  background: #f0f7f4;
}

.inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-actions button {
  flex: 1 1 120px;
  min-height: 42px;
}

.flow-card {
  display: grid;
  gap: 16px;
}

.home-mark-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif CJK SC", serif;
  font-size: 16px;
  font-weight: 900;
}

.home-mark-symbol {
  display: grid;
  width: 30px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid #b78929;
  border-radius: 6px 3px 6px 3px;
  background: var(--brand-red);
  color: #fff8df;
  font-size: 17px;
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.choice-grid button {
  min-height: 76px;
  background: white;
  color: var(--ink);
  border-color: var(--line);
  font-size: 22px;
}

.choice-grid button.selected {
  background: var(--action);
  color: white;
  border-color: var(--action);
}

.toggle-list label {
  flex: 1 1 180px;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  color: var(--ink);
}

.optional-fields {
  border: 1px solid var(--line);
  padding: 10px;
  background: #fffdfa;
}

.optional-fields summary {
  color: var(--action);
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
}

.toggle-list input {
  width: 22px;
  min-height: 22px;
}

.summary-box,
.empty {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #f2f6f3;
}

.public-proof {
  display: grid;
  gap: 3px;
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.proof-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.proof-summary strong {
  font-size: 17px;
  font-weight: 900;
}

.proof-summary span,
.proof-latest,
.admin-row span {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.proof-summary span {
  flex: 0 0 auto;
  font-size: 14px;
}

.proof-latest {
  overflow: hidden;
  font-size: 14px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-row {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  background: #fffdfa;
}

.admin-row button {
  min-height: 40px;
}

.worker-portfolio {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fffdfa;
}

.worker-portfolio-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.worker-portfolio-heading h3,
.worker-project-list {
  margin: 0;
}

.worker-portfolio-heading span,
.worker-portfolio-project-heading span,
.worker-portfolio-project-heading small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.worker-portfolio-embedded {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.worker-portfolio-projects {
  display: grid;
  gap: 10px;
}

.worker-portfolio-embedded .worker-portfolio-projects {
  gap: 6px;
}

.worker-portfolio-project {
  display: grid;
  gap: 6px;
}

.worker-portfolio-project + .worker-portfolio-project {
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.worker-portfolio-project-heading {
  display: grid;
  gap: 1px;
}

.worker-portfolio-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.worker-portfolio-embedded .worker-portfolio-gallery {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

.worker-portfolio-photo {
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
}

.worker-portfolio-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
}

.media-upload-button,
.case-media-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.media-upload-button input,
.case-media-add input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.case-media-add {
  min-height: 36px;
  margin-top: 4px;
  padding: 0 10px;
  border-color: var(--line);
  font-size: 14px;
}

.profile-heading,
.profile-editor-avatar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-image-picker {
  position: relative;
  display: block;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  color: var(--ink);
  cursor: pointer;
}

.avatar-image-picker::after {
  content: "更换";
  position: absolute;
  inset: auto 4px 4px;
  display: grid;
  min-height: 22px;
  place-items: center;
  border-radius: 4px;
  background: rgb(0 0 0 / 70%);
  color: white;
  font-size: 12px;
  font-weight: 900;
}

.avatar-image-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.profile-avatar-large {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.profile-editor {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.photo-manager {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
}

.photo-manager-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.photo-manager-heading h3 {
  margin: 0;
}

.photo-manager-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.photo-manager-heading button {
  min-height: 36px;
  padding: 0 10px;
  font-size: 14px;
}

.my-publications {
  display: grid;
  gap: 4px;
  margin: 0;
}

.my-publications h3,
.my-publications h4 {
  margin: 0;
}

.my-publications h4 {
  font-size: 15px;
}

.my-publication {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 4px 8px;
  padding: 7px 8px;
  border: 1px solid var(--line);
}

.my-publication > div:first-child {
  display: grid;
  gap: 3px;
}

.my-publication > div:first-child span {
  color: var(--muted);
  font-size: 14px;
}

.publication-actions summary {
  cursor: pointer;
  font-weight: 800;
}

.publication-actions {
  grid-column: 1 / -1;
}

.publication-actions .inline-actions {
  margin-top: 6px;
}

.my-dashboard {
  gap: 8px;
  padding: 10px;
}

.my-dashboard > h3 {
  margin: 0;
  font-size: 17px;
}

.my-dashboard .flow-actions {
  gap: 6px;
}

.my-dashboard .flow-actions button {
  min-height: 40px;
}

.my-dashboard .field {
  gap: 4px;
}

.my-dashboard .field label,
.my-dashboard .field-label {
  font-size: 13px;
}

.account-mismatch {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  padding: 10px;
  border: 1px solid var(--warning);
  background: #fff8e7;
}

.account-mismatch span {
  color: var(--muted);
  font-weight: 700;
}

.account-mismatch button {
  min-height: 42px;
  background: var(--action);
  border-color: var(--action);
}

.avatar-upload-button {
  min-height: 44px;
  display: inline-grid;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

.avatar-upload-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.avatar-upload-controls {
  display: grid;
  gap: 8px;
  align-content: center;
}

.selected-file {
  max-width: 220px;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-summary {
  display: grid;
  gap: 4px;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid var(--line);
  background: #fff;
}

.location-summary strong {
  font-size: 16px;
}

.location-summary span {
  color: var(--muted);
  font-weight: 700;
}

.image-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgb(0 0 0 / 78%);
}

.image-preview-panel {
  width: min(100%, 760px);
  max-height: 90vh;
  display: grid;
  gap: 10px;
}

.image-preview-panel img {
  width: 100%;
  max-height: calc(90vh - 58px);
  object-fit: contain;
  background: black;
}

.image-preview-close {
  justify-self: end;
  min-height: 40px;
  padding: 0 12px;
}

.detail-page h3 {
  margin-top: 10px;
}

.toast {
  margin: 8px 0 12px;
  padding: 9px 10px;
  border: 1px solid var(--action);
  border-radius: 6px;
  background: #e9f3ee;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.media-selection {
  margin: -4px 0 10px;
  color: var(--action);
  font-size: 15px;
  font-weight: 800;
}

@media (min-width: 720px) {
  .primary-actions {
    grid-template-columns: 1fr 1fr;
  }

  .filters {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 420px) {
  .app-shell {
    padding: 10px;
  }

  .board,
  .flow-card,
  .public-proof {
    padding: 12px;
  }

  .status-card.compact {
    grid-template-columns: 68px 1fr;
  }

  .case-thumb {
    width: 78px;
  }

  .profile-avatar {
    width: 68px;
  }

  .card-top {
    gap: 6px;
  }

  .card-top h3 {
    font-size: 20px;
  }

  .state {
    font-size: 12px;
    padding: 4px 6px;
  }

  .time-row {
    font-size: 13px;
  }

  /* One readable fact per row beats a two-column grid that breaks foreign-language text into letters. */
  .structured-facts {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }

  .structured-facts div {
    display: grid;
    grid-template-columns: minmax(104px, 42%) minmax(0, 1fr);
    align-items: start;
    gap: 8px;
  }

  .structured-facts dt,
  .structured-facts dd,
  .structured-facts .structured-facts-priority dd {
    font-size: 14px;
    line-height: 1.35;
    overflow-wrap: normal;
    word-break: normal;
  }
}
