:root {
  color-scheme: light;
  --bg: #fff8ec;
  --surface: #ffffff;
  --surface-soft: #fff1d6;
  --ink: #1f1f1f;
  --muted: #665f55;
  --line: #ecdcc6;
  --brand: #f25a18;
  --brand-dark: #1f1f1f;
  --accent: #f9b91f;
  --danger: #b8442f;
  --info: #1f1f1f;
  --shadow: 0 14px 34px rgba(242, 90, 24, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 248, 236, 0.97)),
    var(--bg);
  color: var(--ink);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Hiragino Sans",
    "Yu Gothic",
    sans-serif;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 1100px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 14px 92px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 2px 20px;
}

.brand-lockup {
  display: flex;
  min-width: 0;
  flex-direction: column-reverse;
  align-items: flex-start;
  gap: 4px;
}

.brand-copy {
  min-width: 0;
}

.brand-home {
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
}

.brand-home:focus-visible {
  outline: 3px solid rgba(242, 90, 24, 0.35);
  outline-offset: 6px;
  border-radius: 8px;
}

.brand-logo {
  display: block;
  width: min(46vw, 330px);
  height: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
}

h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.status-button {
  min-height: 48px;
  border: 1px solid rgba(242, 90, 24, 0.25);
  border-radius: 8px;
  background: var(--surface);
  color: var(--brand-dark);
  padding: 10px 12px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(242, 90, 24, 0.12);
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
  border-radius: 999px;
  background: var(--accent);
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.login-panel {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid rgba(242, 90, 24, 0.22);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.server-warning {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 14px;
  border: 2px solid rgba(242, 90, 24, 0.4);
  border-radius: 8px;
  background: #fff0e8;
  box-shadow: var(--shadow);
}

.server-warning p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.server-warning a {
  width: fit-content;
}

.login-heading {
  margin-bottom: 0;
}

.login-badge {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border-radius: 999px;
  background: #fff0e8;
  color: #a2390b;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.login-form {
  display: grid;
  gap: 10px;
}

.register-form {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.login-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.login-help,
.notification-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.account-create-link {
  width: fit-content;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--brand);
  padding: 4px 0;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.notification-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff8ec;
}

.notification-card strong {
  font-size: 15px;
}

.setup-card,
.locked-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(242, 90, 24, 0.32);
  border-radius: 8px;
  background: #fff0e8;
  color: var(--ink);
}

.setup-card p,
.locked-panel {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
}

.heading-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.contractor-cta {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  margin: -4px 0 16px;
  padding: 14px;
  border: 2px solid rgba(249, 185, 31, 0.55);
  border-radius: 8px;
  background: #fff8dd;
}

.contractor-cta strong,
.contractor-cta p {
  margin: 0;
}

.contractor-cta p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.primary-button,
.accent-button,
.secondary-button,
.danger-button,
.ghost-button,
.line-button,
.icon-button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 12px 16px;
  border: 0;
  font-weight: 800;
  text-decoration: none;
}

.primary-button {
  background: var(--brand);
  color: #ffffff;
}

.accent-button {
  background: var(--accent);
  color: #1f1f1f;
  box-shadow: 0 8px 18px rgba(249, 185, 31, 0.2);
}

.primary-button:active {
  background: var(--brand-dark);
}

.secondary-button,
.ghost-button,
.icon-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.line-button {
  background: #06c755;
  color: #ffffff;
}

.danger-button {
  background: var(--danger);
  color: #ffffff;
}

.compact {
  min-height: 44px;
  padding: 10px 12px;
  white-space: nowrap;
}

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

.summary-tile {
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 18px rgba(55, 45, 28, 0.06);
}

.summary-value {
  display: block;
  font-size: 26px;
  line-height: 1;
  font-weight: 900;
}

.summary-label {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.filter-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(242, 90, 24, 0.15);
}

input[readonly] {
  background: #f6f1eb;
  color: var(--muted);
}

button:disabled,
input:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.field-help {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.job-list,
.contractor-list,
.admin-list {
  display: grid;
  gap: 12px;
}

.job-card,
.contractor-card,
.admin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.job-card {
  display: block;
}

.job-photo {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 150px;
  max-height: 280px;
  background:
    linear-gradient(145deg, rgba(249, 185, 31, 0.95), rgba(242, 90, 24, 0.94)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.23) 0 9px, transparent 9px 18px);
  color: #1f1f1f;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 900;
}

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

.job-body,
.contractor-card,
.admin-card {
  padding: 14px;
}

.job-meta,
.contractor-meta,
.admin-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 8px 0 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #fff3df;
  color: #8a320d;
  font-size: 12px;
  font-weight: 900;
}

.pill.warn {
  background: #fff8dc;
  color: #6e4a00;
}

.pill.info {
  background: #f4f4f4;
  color: #1f1f1f;
}

.pill.status-open {
  background: #e7f8ed;
  color: #145c2b;
}

.pill.status-talking {
  background: #eaf3ff;
  color: #164d84;
}

.pill.status-matched {
  background: #fff0e8;
  color: #a2390b;
}

.pill.status-closed,
.pill.status-suspended {
  background: #f0ece8;
  color: #5f5147;
}

.pill.lock,
.private-badge {
  background: #fff0e8;
  color: #a2390b;
}

.private-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 26px;
  align-items: center;
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.job-detail-box {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf3;
}

.job-detail-box.is-locked {
  border-color: #f6c46b;
  background: #fff7e8;
}

.login-detail-note {
  display: grid !important;
  gap: 5px;
  margin: 0 0 12px;
  padding: 12px;
  border: 2px solid #f6c46b;
  border-radius: 8px;
  background: #fff7e8;
  color: var(--ink);
}

.login-detail-note-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.login-detail-note strong {
  color: var(--orange);
  font-size: 16px;
  font-weight: 900;
}

.login-detail-note span:last-child {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.job-detail-label {
  display: block;
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.job-detail-locked-title {
  margin: 0 0 4px;
  color: var(--orange);
  font-size: 16px;
  font-weight: 900;
}

.job-memo,
.contractor-copy,
.admin-copy {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.job-detail-box .job-memo {
  margin-bottom: 0;
  line-height: 1.75;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.job-detail-box .job-memo.is-collapsed {
  display: block;
  max-height: 7em;
  overflow: hidden;
}

.job-detail-box .job-memo.is-expanded {
  display: block;
  max-height: none;
}

.job-detail-toggle {
  min-height: 42px;
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(242, 90, 24, 0.28);
  border-radius: 8px;
  background: #fff;
  color: var(--orange);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.owner-line {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.policy-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid rgba(242, 90, 24, 0.22);
  border-radius: 8px;
  background: #fff7e8;
  padding: 12px;
}

.policy-check input {
  width: 22px;
  min-height: 22px;
  margin-top: 2px;
  flex: 0 0 auto;
}

.policy-check span {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.warning-note {
  color: var(--danger);
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.single-action {
  grid-template-columns: 1fr;
}

.job-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.contractor-owner-actions {
  grid-template-columns: 1fr 1fr;
}

.admin-lock,
.admin-content,
.admin-login-panel,
.admin-manager {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-lock {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.admin-content {
  padding: 14px;
}

.admin-manager {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
}

.admin-manager-heading {
  margin-bottom: 0;
}

.admin-login-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  box-shadow: none;
}

.admin-content {
  display: grid;
  gap: 16px;
}

.admin-section {
  display: grid;
  gap: 10px;
}

.admin-section h3,
.admin-help {
  margin: 0;
}

.admin-help {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.admin-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.admin-card-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.admin-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: end;
  margin-top: 12px;
}

.admin-controls.single-action {
  grid-template-columns: 1fr;
}

.mypage-layout {
  display: grid;
  gap: 12px;
}

.mypage-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.mypage-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mypage-profile h3,
.mypage-profile p {
  margin: 0;
}

.mypage-profile p {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.compact-card {
  box-shadow: none;
}

.profile-summary {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff8ec;
}

.profile-summary strong {
  font-size: 14px;
}

.profile-summary p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 14px;
}

.mypage-logout {
  display: grid;
  margin-top: 12px;
}

.mypage-logout .danger-button {
  width: 100%;
}

.profile-summary .job-meta {
  margin: 0;
}

.account-form {
  margin: 0;
}

.is-hidden,
.is-locked {
  display: none;
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(32, 31, 29, 0.45);
}


.confirm-overlay.is-hidden {
  display: none;
}
.confirm-dialog {
  width: min(460px, 100%);
  padding: 20px;
  border: 1px solid rgba(242, 90, 24, 0.22);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 60px rgba(32, 31, 29, 0.22);
}

.confirm-kicker {
  margin: 0 0 6px;
  color: var(--orange);
  font-size: 13px;
  font-weight: 900;
}

.confirm-dialog h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 22px;
}

.confirm-dialog p {
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.7;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ebe5d8;
  margin-bottom: 14px;
}

.segment {
  min-height: 46px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.segment.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 5px 12px rgba(55, 45, 28, 0.12);
}

.form-panel {
  display: none;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.form-panel.is-active {
  display: grid;
  gap: 14px;
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.check-grid label {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
  font-weight: 800;
}

.check-grid input {
  width: 20px;
  min-height: 20px;
}

.file-drop {
  display: block;
  border: 1px dashed #e28436;
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
  text-align: center;
}

.file-drop input {
  display: none;
}

.person-photo-drop {
  text-align: left;
}

.person-photo-drop input {
  display: block;
  margin: 10px 0 8px;
  padding: 10px;
}

.file-drop span {
  color: var(--ink);
  font-size: 17px;
}

.file-drop small {
  display: block;
  color: var(--muted);
}

.form-note {
  min-height: 24px;
  margin: 0;
  color: var(--brand);
  font-weight: 800;
}

.form-note.warning-note {
  color: var(--danger);
}

.contractor-card {
  display: grid;
  gap: 10px;
}

.contractor-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.profile-avatar {
  flex: 0 0 62px;
  width: 62px;
  height: 62px;
  overflow: hidden;
  border: 2px solid #f9b91f;
  border-radius: 50%;
  background: #fff3df;
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
}

.profile-avatar.large {
  flex-basis: 76px;
  width: 76px;
  height: 76px;
  font-size: 28px;
}

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

.profile-preview {
  width: 112px;
  height: 112px;
  margin-top: 10px;
  border: 3px solid #f9b91f;
  border-radius: 50%;
  background: #ffffff;
}

.logo-preview {
  width: min(220px, 100%);
  height: 96px;
  margin-top: 10px;
  border: 2px solid #f9b91f;
  border-radius: 8px;
  background: #ffffff;
  object-fit: contain;
}

.message-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 12px;
}

.thread-list {
  display: grid;
  align-content: start;
  gap: 8px;
}

.thread-button {
  width: 100%;
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
  text-align: left;
}

.thread-person {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 9px;
}

.thread-avatar {
  width: 42px;
  height: 42px;
  border: 2px solid #f9b91f;
  border-radius: 50%;
  overflow: hidden;
  background: #fff3df;
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 900;
}

.thread-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thread-button.is-active {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(242, 90, 24, 0.14);
}

.thread-button strong,
.thread-button small {
  display: block;
}

.thread-button small {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-panel {
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #fff3df;
}

.chat-header-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.chat-header span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.chat-partner-button {
  display: inline-grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  min-width: min(360px, 100%);
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(242, 90, 24, 0.24);
  border-radius: 8px;
  background: #ffffff;
  padding: 7px 9px;
  color: var(--ink);
  text-align: left;
}

.chat-partner-button strong,
.chat-partner-button small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-partner-button small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.chat-partner-button em {
  color: var(--brand);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.chat-peer-avatar {
  width: 54px;
  height: 54px;
  flex-basis: 54px;
  font-size: 20px;
}

.message-partner-profile {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #fffaf1;
}

.partner-profile-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.partner-profile-head h3,
.partner-profile-head p {
  margin: 0;
}

.partner-profile-head p,
.partner-profile-body p {
  color: var(--muted);
  font-size: 14px;
}

.partner-logo {
  width: min(220px, 100%);
  height: 86px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.partner-profile-body {
  display: grid;
  gap: 6px;
}

.partner-profile-body strong {
  font-size: 14px;
}

.partner-profile-body p {
  margin: 0 0 4px;
}

.chat-messages {
  display: grid;
  align-content: end;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
  padding: 14px;
  background: #f7f7f4;
}

.bubble {
  width: min(82%, 460px);
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.bubble.mine {
  justify-self: end;
  background: #fff2df;
  border-color: rgba(242, 90, 24, 0.24);
}

.bubble p {
  margin: 0;
  overflow-wrap: anywhere;
}

.bubble time {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bubble img {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 6px;
}

.photo-message svg {
  display: block;
  width: 100%;
  border-radius: 6px;
}

.link-card {
  display: block;
  margin-top: 8px;
  border: 1px solid rgba(242, 90, 24, 0.22);
  border-radius: 8px;
  padding: 10px;
  background: #fff3df;
  color: var(--info);
  font-weight: 900;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.message-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.message-form textarea {
  min-height: 74px;
}

.message-attachment-preview {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 96px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff8ec;
  color: var(--muted);
  font-weight: 800;
}

.message-attachment-preview img {
  width: 96px;
  height: 62px;
  border-radius: 6px;
  object-fit: cover;
}

.icon-button input {
  display: none;
}

.send-button {
  min-width: 76px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  width: min(100%, 1100px);
  transform: translateX(-50%);
  padding: 8px 10px max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.nav-item {
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.nav-item.is-active {
  background: var(--brand-dark);
  color: #ffffff;
}

@media (max-width: 760px) {
  .app-shell {
    padding-inline: 12px;
  }

  .brand-lockup .eyebrow {
    margin: 0;
    font-size: 11px;
    line-height: 1.2;
  }

  .brand-logo {
    width: min(58vw, 260px);
  }

  h1 {
    font-size: 28px;
  }

  h2 {
    font-size: 21px;
  }

  .section-heading {
    align-items: stretch;
  }

  .heading-actions {
    width: 100%;
    justify-content: stretch;
  }

  .heading-actions .compact {
    flex: 1 1 170px;
  }

  .contractor-cta {
    grid-template-columns: 1fr;
  }

  .contractor-cta .compact {
    width: 100%;
  }

  .section-heading > .compact {
    align-self: flex-start;
  }

  .primary-button,
  .accent-button,
  .secondary-button,
  .danger-button,
  .line-button,
  .icon-button {
    min-height: 56px;
    font-size: 16px;
  }

  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .summary-tile {
    padding: 10px;
  }

  .summary-value {
    font-size: 23px;
  }

  .job-card {
    grid-template-columns: 82px 1fr;
  }

  .action-row {
    grid-template-columns: 1fr;
  }

  .job-actions {
    grid-template-columns: 1fr;
  }

  .message-layout {
    grid-template-columns: 1fr;
  }

  .thread-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .thread-button {
    min-width: 230px;
  }

  .chat-panel {
    min-height: 520px;
  }

  .chat-header {
    display: grid;
  }

  .chat-header-main {
    display: grid;
  }

  .chat-partner-button {
    width: 100%;
    grid-template-columns: 48px minmax(0, 1fr) auto;
  }

  .chat-peer-avatar {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }

  .message-form {
    grid-template-columns: 1fr 86px;
  }

  .message-form .send-button {
    grid-column: 1 / -1;
  }

  .message-attachment-preview {
    grid-template-columns: 82px 1fr;
  }

  .message-attachment-preview .compact {
    grid-column: 1 / -1;
  }

  .admin-card-head,
  .admin-controls {
    grid-template-columns: 1fr;
  }

  .admin-card-head {
    display: grid;
  }
}

@media (max-width: 460px) {
  body {
    font-size: 16px;
  }

  .topbar {
    gap: 8px;
  }

  .brand-logo {
    width: min(58vw, 220px);
  }

  .status-button {
    padding-inline: 10px;
    font-size: 14px;
  }

  .filter-bar,
  .two-column,
  .check-grid {
    grid-template-columns: 1fr;
  }

  .job-photo {
    min-height: 138px;
    max-height: none;
  }

  .bottom-nav {
    padding-inline: 6px;
  }

  .nav-item {
    min-height: 52px;
    font-size: 14px;
  }
}
