/* app.css — 残材市場 (デザイン言語: TORIAI Mobile 1b。白基調、Murecho、緑 #00A67E、角丸 14〜18px) */
:root {
  --ink: #15242B; --mute: #5B6B73; --faint: #93A2AB; --line: #E1E8EE; --sf: #F2F6FA; --sf2: #EEF3F7; --sf3: #E8EEF3;
  --green: #00A67E; --green-d: #00795C; --green-l: #E3F5EF; --orange: #E0731D; --red: #b91c1c;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: #fff; color: var(--ink); font-family: 'Murecho', 'Noto Sans JP', system-ui, -apple-system, sans-serif; font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
.mk :where(button) { border: none; background: none; padding: 0; margin: 0; cursor: pointer; text-align: inherit; -webkit-tap-highlight-color: transparent; }
.mk :where(button):active { opacity: .75; }
.mk :where(button):disabled { cursor: default; opacity: .6; }

.mk { max-width: 720px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; position: relative; }
.mk-top { position: sticky; top: 0; z-index: 10; background: #fff; padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 8px; display: flex; flex-direction: column; gap: 8px; }
.mk-top-row { display: flex; align-items: center; justify-content: space-between; }
.mk-brand { font-size: 18px; font-weight: 900; letter-spacing: .14em; min-height: 40px; display: flex; align-items: center; }
.mk-brand span { font-weight: 500; letter-spacing: .02em; margin-left: 6px; color: var(--green-d); }
.mk-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.mk-tabs { display: flex; background: var(--sf2); border-radius: 999px; padding: 4px; gap: 2px; }
.mk-tabs a { flex: 1; height: 40px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--mute); font-size: 13px; }
.mk-tabs a.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.mk-banner { margin: 0 16px 8px; background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 12px; padding: 8px 12px; font-size: 12px; line-height: 1.6; }
.mk-view { flex: 1; padding: 6px 16px calc(env(safe-area-inset-bottom, 0px) + 32px); display: flex; flex-direction: column; gap: 10px; }
.mk-view > * { flex: none; }

.mk-label { font-size: 11px; color: var(--mute); font-weight: 500; display: block; }
.mk-sub { font-size: 12px; color: var(--mute); }
.mk-hint { font-size: 13px; color: var(--faint); min-height: 36px; display: flex; align-items: center; }
.mk-note { font-size: 12px; color: var(--mute); line-height: 1.6; }
.mk-empty { padding: 28px 16px; text-align: center; color: var(--faint); font-size: 14px; line-height: 1.7; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.mk-empty span { font-size: 12px; }
.mk-section-title { font-size: 12px; color: var(--mute); font-weight: 700; padding: 8px 2px 2px; }
.mk-count { font-size: 12px; color: var(--faint); padding: 0 2px; }
.mk-back { font-size: 13px; color: var(--mute); font-weight: 700; padding: 4px 0; }

.mk-search input { width: 100%; height: 46px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; padding: 0 14px; font-size: 16px; outline: none; -webkit-appearance: none; appearance: none; }
.mk-search input:focus { border-color: var(--green); }
.mk-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: none; }
.mk-chips::-webkit-scrollbar { display: none; }
.mk-chip { flex: none; height: 38px; padding: 0 14px; border-radius: 999px; background: #fff; border: 1.5px solid var(--line); font-weight: 700; font-size: 13px; white-space: nowrap; }
.mk-chip.on { background: var(--green); border-color: var(--green); color: #fff; }
.mk-filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.mk-field-inline { flex: 1 1 96px; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--mute); }
.mk-field-inline > select, .mk-field-inline > input { min-width: 0; width: 100%; }
.mk-field-inline select, .mk-field-inline input { height: 40px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; padding: 0 10px; font-size: 16px; }

.mk-list { display: flex; flex-direction: column; gap: 10px; }
.mk-card { display: grid; grid-template-columns: 84px 1fr auto; gap: 12px; align-items: center; background: #fff; border: 1.5px solid var(--line); border-radius: 18px; padding: 12px; }
.mk-card-photo { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; background: var(--sf); }
.mk-card-photo-empty { display: flex; align-items: center; justify-content: center; color: var(--faint); font-weight: 700; font-size: 12px; }
.mk-card-main { min-width: 0; }
.mk-card-title { font-weight: 900; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-card-kind { font-size: 11px; font-weight: 500; color: var(--mute); margin-left: 4px; }
.mk-card-dims { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mk-card-meta { font-size: 11px; color: var(--mute); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-card-tags { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.mk-tag { font-size: 10px; font-weight: 700; background: var(--sf3); color: var(--mute); border-radius: 6px; padding: 1px 6px; }
.mk-tag-warn { background: #fff7ed; color: var(--orange); }
.mk-tag-ok { background: var(--green-l); color: var(--green-d); }
.mk-card-price { font-weight: 900; font-size: 15px; color: var(--ink); text-align: right; white-space: nowrap; }
.mk-card-price.is-free { color: var(--green-d); }

.mk-photos { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.mk-photos img { height: 220px; border-radius: 16px; object-fit: cover; flex: none; max-width: 100%; }
.mk-photos-small img { height: 96px; }
.mk-photo-empty { height: 140px; border-radius: 16px; background: repeating-linear-gradient(45deg, var(--sf) 0 8px, var(--sf3) 8px 16px); display: flex; align-items: center; justify-content: center; color: var(--mute); font-size: 12px; width: 100%; }
.mk-detail { display: flex; flex-direction: column; gap: 10px; }
.mk-detail-title { font-size: 22px; font-weight: 900; }
.mk-detail-price { font-size: 22px; font-weight: 900; }
.mk-detail-price.is-free { color: var(--green-d); }
.mk-detail-est { font-size: 12px; font-weight: 500; color: var(--mute); margin-left: 6px; }
.mk-spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mk-spec-grid > div { background: var(--sf); border-radius: 14px; padding: 10px 12px; }
.mk-spec-grid b { font-size: 15px; display: block; }
.mk-note-box { background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; font-size: 13px; line-height: 1.7; }
.mk-seller { background: var(--sf); border-radius: 14px; padding: 10px 12px; }
.mk-seller-name { font-weight: 900; font-size: 16px; }
.mk-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }

.mk-btn { min-height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; padding: 0 16px; text-align: center; }
.mk-btn-primary { background: var(--green); color: #fff; box-shadow: 0 8px 20px rgba(0,166,126,.24); }
.mk-btn-secondary { background: var(--sf); color: var(--ink); }
.mk-btn-big { min-height: 60px; font-size: 18px; font-weight: 900; }
.mk-link { color: var(--mute); font-weight: 700; font-size: 12px; padding: 8px 0; text-align: center; }

.mk-form { display: flex; flex-direction: column; gap: 10px; }
.mk-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mk-field { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--mute); font-weight: 500; }
.mk-field input, .mk-field select, .mk-field textarea { width: 100%; min-height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; padding: 8px 12px; font-size: 16px; color: var(--ink); font-weight: 700; }
.mk-field textarea { font-weight: 500; resize: vertical; }
.mk-field input:focus, .mk-field textarea:focus, .mk-field select:focus { outline: none; border-color: var(--green); }
.mk-check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; min-height: 40px; }
.mk-check input { width: 20px; height: 20px; accent-color: var(--green); }
.mk-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.mk-seg-btn { flex: 1; min-height: 44px; border-radius: 12px; background: #fff; border: 1.5px solid var(--line); font-weight: 700; font-size: 13px; padding: 0 10px; display: flex; align-items: center; justify-content: center; }
.mk-seg-btn.on { background: var(--green-l); border-color: var(--green); color: var(--green-d); }
.mk-spec-list { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; }
.mk-spec { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: 12px; background: #fff; border: 1.5px solid var(--line); font-weight: 700; font-size: 15px; }
.mk-spec.on { background: var(--green); border-color: var(--green); color: #fff; }
.mk-spec-kgm { font-size: 13px; font-weight: 700; }

.mk-want { background: #fff; border: 1.5px solid var(--line); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.mk-want-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mk-want-head .mk-link { margin-left: auto; }

.mk-thread { display: flex; align-items: center; gap: 10px; background: #fff; border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.mk-thread-main { flex: 1; min-width: 0; }
.mk-thread-title { font-weight: 900; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.mk-thread-head { padding: 4px 2px; }
.mk-messages { display: flex; flex-direction: column; gap: 8px; background: var(--sf); border-radius: 16px; padding: 12px; min-height: 160px; }
.mk-msg { max-width: 85%; align-self: flex-start; }
.mk-msg.is-mine { align-self: flex-end; }
.mk-msg-body { background: #fff; border-radius: 14px; padding: 8px 12px; font-size: 14px; line-height: 1.6; border: 1px solid var(--line); }
.mk-msg.is-mine .mk-msg-body { background: var(--green-l); border-color: var(--green-l); }
.mk-msg-meta { font-size: 10px; color: var(--faint); margin-top: 2px; }
.mk-msg-system { align-self: center; font-size: 11px; color: var(--mute); background: var(--sf3); border-radius: 999px; padding: 3px 10px; }
.mk-composer { display: flex; gap: 8px; align-items: flex-end; }
.mk-composer textarea { flex: 1; min-height: 48px; border-radius: 14px; border: 1.5px solid var(--line); padding: 10px 12px; font-size: 16px; resize: none; }
.mk-composer .mk-btn { min-height: 48px; min-width: 76px; }
.mk-rate { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mk-rate-btn { width: 44px; height: 44px; border-radius: 12px; background: #fff; border: 1.5px solid var(--line); font-weight: 900; display: flex; align-items: center; justify-content: center; }
.mk-profile { background: var(--sf); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }

.mk-dim { position: fixed; inset: 0; background: rgba(21,36,43,.35); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 20; }
.mk-dim.is-on { opacity: 1; pointer-events: auto; }
.mk-sheet { position: fixed; left: 0; right: 0; bottom: 0; max-width: 720px; margin: 0 auto; background: var(--sf); border-radius: 28px 28px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.15); transform: translateY(110%); transition: transform .35s cubic-bezier(.2,.8,.2,1); z-index: 21; }
.mk-sheet.is-open { transform: translateY(0); }
.mk-grip { width: 40px; height: 5px; border-radius: 3px; background: #D5DEE6; margin: 10px auto 4px; }
.mk-sheet-body { padding: 8px 20px calc(env(safe-area-inset-bottom, 0px) + 28px); display: flex; flex-direction: column; gap: 12px; }
.mk-sheet-head { display: flex; align-items: center; justify-content: space-between; }
.mk-sheet-title { font-weight: 900; font-size: 20px; }
.mk-ver { font-size: 12px; font-weight: 500; color: var(--mute); margin-left: 6px; }
.mk-close { width: 36px; height: 36px; border-radius: 50%; background: var(--sf3); display: flex; align-items: center; justify-content: center; color: var(--mute); font-size: 18px; }
.mk-menu { display: flex; flex-direction: column; gap: 8px; }
.mk-menu-row { display: flex; flex-direction: column; justify-content: center; min-height: 52px; padding: 10px 16px; border-radius: 14px; background: #fff; border: 1.5px solid var(--line); font-weight: 700; font-size: 15px; width: 100%; }
.mk-menu-sub { font-size: 11px; font-weight: 500; color: var(--mute); margin-top: 2px; }
.mk-toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); transform: translate(-50%, 10px); opacity: 0; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 13px; font-weight: 700; max-width: 88%; text-align: center; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 30; }
.mk-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 721px) {
  .mk-card { grid-template-columns: 110px 1fr auto; }
  .mk-card-photo { width: 110px; height: 110px; }
}

/* v0.2.0: ログインシート / 通知バッジ / 会社情報フォーム */
.mk-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--orange); color: #fff; font-size: 10px; font-weight: 900; margin-left: 4px; line-height: 1; vertical-align: middle; }
.mk-login-tabs { display: flex; background: var(--sf3); border-radius: 999px; padding: 4px; gap: 2px; }
.mk-login-tab { flex: 1; min-height: 38px; border-radius: 999px; font-weight: 700; font-size: 13px; color: var(--mute); display: flex; align-items: center; justify-content: center; }
.mk-login-tab.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.mk-err { background: #fef2f2; color: var(--red); border: 1px solid #fecaca; border-radius: 12px; padding: 8px 12px; font-size: 13px; font-weight: 700; line-height: 1.5; }
.mk-banner-inline { background: var(--green-l); color: var(--green-d); border-radius: 12px; padding: 8px 12px; font-size: 12px; line-height: 1.6; font-weight: 700; }
.mk-thread.is-unread { border-color: var(--green); }
.mk-thread.is-unread .mk-thread-title::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); margin-right: 6px; vertical-align: middle; }
.mk-menu-row.is-danger { color: var(--red); }
.mk-sheet .mk-form { max-height: 70vh; overflow: auto; }

/* v0.3.2: 更新履歴シート / 似た出品 */
.mk-changelog { display: flex; flex-direction: column; gap: 12px; max-height: 60vh; overflow: auto; }
.mk-changelog-entry { background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.mk-changelog-head { display: flex; align-items: baseline; gap: 8px; font-size: 14px; }
.mk-changelog ul { margin: 6px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.6; color: var(--ink); }
.mk-similar { margin-top: 6px; }

/* v0.4.0: 欲しい登録の地域チップ (折り返し) */
.mk-chips-wrap { flex-wrap: wrap; overflow: visible; max-height: 132px; overflow-y: auto; }
.mk-chips-wrap .mk-chip { height: 34px; font-size: 12px; padding: 0 12px; }
