:root {
  --bg: #f4f7fb;
  --fg: #14202e;
  --muted: #5a6473;
  --accent: #0e75c9;
  --accent-dark: #0a5a9c;
  --accent-light: #e4f0fa;
  --card-bg: #fff;
  --border: #dde4ec;
  --pill-bg: #fff;
  --pill-border: #c8d3e0;
  --shadow: 0 1px 3px rgba(20, 32, 46, 0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.55;
}
.container { max-width: 1180px; margin: 0 auto; padding: 0.75rem 1.25rem; }

/* ===== Header ===== */
.site-header {
  background: linear-gradient(135deg, #0a2540 0%, #134b78 100%);
  color: #fff;
  padding: 0.7rem 0;
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.site-header h1 { margin: 0; font-size: 1.5rem; letter-spacing: 0.5px; }
.site-header h1 a { color: #fff; text-decoration: none; }
.site-header .tagline { margin: 0.2rem 0 0; opacity: 0.72; font-size: 0.85rem; }

.user-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}
.user-nav .btn-login,
.user-nav .btn-sell {
  background: #ffffff;
  color: #0a2540;
  padding: 0.45rem 0.95rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.15s;
}
.user-nav .btn-login:hover,
.user-nav .btn-sell:hover { background: #ffd84a; }
.user-nav .btn-sell { background: #ffd84a; }
.user-nav .nav-link { color: #c2d3e6; text-decoration: none; font-size: 0.85rem; }
.user-nav .nav-link:hover { color: #fff; }
.user-nav .user-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #fff;
  text-decoration: none;
  font-weight: 500;
}
.user-nav .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35);
}

.sub-nav {
  padding-top: 0.4rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.sub-nav .sub-link {
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  font-size: 0.82rem;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.18);
  transition: background 0.15s;
}
.sub-nav .sub-link:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* ===== Article pages (transport/license/transfer) ===== */
.article-page {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin-top: 1.5rem;
  box-shadow: var(--shadow);
}
.article-head {
  border-bottom: 2px solid var(--accent-light);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}
.article-head h2 { margin: 0.3rem 0 0.5rem; font-size: 1.7rem; }
.breadcrumb { margin: 0; color: var(--muted); font-size: 0.85rem; }
.breadcrumb a { color: var(--accent); text-decoration: none; }
.lede { color: var(--muted); margin: 0.5rem 0 0; font-size: 0.95rem; }
.article-section { margin: 2rem 0; }
.article-section h3 {
  font-size: 1.15rem;
  color: var(--accent-dark);
  border-left: 4px solid var(--accent);
  padding-left: 0.6rem;
  margin: 0 0 1rem;
}
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}
.info-card {
  background: var(--accent-light);
  padding: 0.95rem 1.1rem;
  border-radius: 8px;
}
.info-card.highlight {
  background: #fff7e0;
  border: 2px solid #f0c060;
}
.info-card h4 { margin: 0 0 0.5rem; color: var(--accent-dark); font-size: 1rem; }
.info-card.highlight h4 { color: #8a5a00; }
.info-card p { margin: 0; font-size: 0.92rem; }
.info-card .price {
  font-weight: 700;
  color: #c0392b;
  font-size: 1.15rem;
  margin: 0.3rem 0 !important;
}
.info-card .caption {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.3rem !important;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
.data-table th, .data-table td {
  border: 1px solid var(--border);
  padding: 0.55rem 0.75rem;
  text-align: left;
  font-size: 0.92rem;
}
.data-table th {
  background: var(--accent-light);
  color: var(--accent-dark);
  font-weight: 600;
}
.data-table tbody tr:nth-child(even) { background: #fafbfd; }
.note {
  background: #fff8e1;
  border-left: 3px solid #f0b400;
  padding: 0.6rem 0.85rem;
  margin: 0.8rem 0 0;
  font-size: 0.88rem;
  color: #6b5a00;
  border-radius: 4px;
}
.check-list, .warning-list, .step-list {
  padding-left: 1.3rem;
  margin: 0.5rem 0;
}
.check-list li, .step-list li { margin: 0.35rem 0; }
.warning-list { list-style: none; padding: 0; }
.warning-list li {
  background: #fff3f0;
  border-left: 3px solid #c0392b;
  padding: 0.5rem 0.8rem;
  margin: 0.4rem 0;
  border-radius: 4px;
  font-size: 0.92rem;
}
.related {
  margin: 2rem 0 0;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
  font-size: 0.9rem;
}
.related a { color: var(--accent); text-decoration: none; margin-right: 0.8rem; }
.related a:hover { color: var(--accent-dark); text-decoration: underline; }

/* ===== Ferry calculator ===== */
.ferry-tool { margin: 0.5rem 0 0; }
.ferry-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem;
  align-items: end;
  padding: 1rem;
  background: var(--accent-light);
  border-radius: 10px;
  margin-bottom: 0.85rem;
}
.ferry-form label {
  display: flex; flex-direction: column; gap: 0.25rem;
  font-size: 0.85rem; color: var(--muted);
}
.ferry-form select {
  padding: 0.55rem 0.7rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
  font-size: 0.95rem;
}
.ferry-form .btn-mini { align-self: end; padding: 0.5rem 0.85rem; }
.ferry-result {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.7rem;
}
.ferry-result .hint {
  grid-column: 1 / -1;
  color: var(--muted); font-size: 0.9rem; margin: 0.3rem 0;
}
.ferry-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  display: flex; flex-direction: column; gap: 0.45rem;
  box-shadow: var(--shadow);
}
.ferry-route {
  font-size: 1rem;
  display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
}
.ferry-route .arrow { color: var(--accent); font-weight: 700; }
.ferry-route small { color: var(--muted); font-weight: normal; }
.ferry-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.82rem; color: var(--muted);
  gap: 0.5rem; flex-wrap: wrap;
}
.ferry-meta a { color: var(--accent); text-decoration: none; }
.ferry-price {
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 0.5rem;
}
.ferry-price .price-num {
  color: #c0392b; font-weight: 700; font-size: 1.25rem;
}
.ferry-price .price-bucket {
  color: var(--muted); font-size: 0.78rem;
}
input[type=range] {
  width: 100%;
  accent-color: var(--accent);
}

/* Simulator box */
.sim-box {
  margin-top: 1rem;
  background: #fff;
  border: 2px solid var(--accent-light);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}
.sim-box summary {
  font-weight: 700;
  color: var(--accent-dark);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.3rem 0;
}
.sim-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.7rem;
  margin: 0.8rem 0;
}
.sim-form label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; color: var(--muted); }
.sim-form label.checkbox-label { flex-direction: row !important; align-items: center; gap: 0.4rem !important; }
.sim-form input[type=number] {
  padding: 0.5rem 0.7rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
}
.sim-table {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fafbfd;
}
.sim-row {
  display: flex;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.93rem;
}
.sim-row:last-child { border-bottom: none; }
.sim-row.total {
  background: var(--accent-light);
  font-size: 1.05rem;
}
.sim-row .amount { color: #c0392b; font-weight: 600; }
.sim-compare {
  margin: 0.85rem 0 0.3rem;
  padding: 0.6rem 0.85rem;
  background: #f0f7eb;
  border-radius: 6px;
  font-size: 0.92rem;
}

/* ===== 初心者向けボックス ===== */
.beginner-box {
  background: linear-gradient(135deg, #e6f4ff 0%, #f0f8ff 100%);
  border: 2px solid #b9d6f0;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin: 1rem 0 1.5rem;
}
.beginner-box h3 {
  margin: 0 0 0.6rem;
  color: var(--accent-dark);
  font-size: 1.05rem;
  border: none;
  padding: 0;
}
.beginner-box p, .beginner-box li { font-size: 0.92rem; }
.beginner-box .note { margin-top: 0.6rem; }

/* ===== タブUI ===== */
.tab-nav {
  display: flex;
  gap: 0.3rem;
  border-bottom: 2px solid var(--accent-light);
  margin: 1.5rem 0 0;
  flex-wrap: wrap;
}
.tab-link {
  padding: 0.7rem 1.2rem;
  background: #f4f7fb;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  position: relative;
  top: 2px;
  transition: all 0.15s;
}
.tab-link:hover { background: #fff; color: var(--accent); }
.tab-link.active {
  background: #fff;
  color: var(--accent-dark);
  border-color: var(--accent-light);
  border-bottom: 2px solid #fff;
}
.tab-pane {
  display: none;
  background: #fff;
  border: 1px solid var(--accent-light);
  border-top: none;
  border-radius: 0 0 10px 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}
.tab-pane.active { display: block; }

/* ===== Download cards (transfer.php) ===== */
.downloads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.7rem;
  margin: 0.8rem 0;
}
.download-card {
  display: flex; gap: 0.8rem;
  background: #fff;
  border: 1.5px solid var(--accent-light);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  text-decoration: none;
  color: var(--fg);
  transition: all 0.15s;
}
.download-card:hover {
  border-color: var(--accent);
  background: #f7fbfe;
  transform: translateY(-1px);
}
.download-card .dl-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}
.download-card .dl-title { font-weight: 700; color: var(--accent-dark); margin-bottom: 0.2rem; }
.download-card .dl-desc { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.3rem; }
.download-card .dl-host { font-size: 0.75rem; color: var(--accent); }
.tab-head { border-bottom: 1px solid var(--border); padding-bottom: 0.7rem; margin-bottom: 1rem; }
.tab-head h3 { margin: 0; font-size: 1.3rem; border: none; padding: 0; color: var(--fg); }
.tab-head.highlight h3 { color: #8a5a00; }
.tab-head .tab-lede { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.95rem; }
@media (max-width: 640px) {
  .tab-link { padding: 0.55rem 0.7rem; font-size: 0.82rem; }
  .tab-pane { padding: 1rem; }
}

/* Highlighted section (frame around method ④) */
.highlight-section {
  background: linear-gradient(180deg, #fffbe7 0%, transparent 80%);
  border: 2px solid #f0c060;
  border-radius: 10px;
  padding: 1rem 1.25rem;
}
.highlight-section h3 { color: #8a5a00; border-left-color: #f0c060; }
.highlight-row { background: #fffbe7 !important; font-weight: 600; }
.highlight-row strong { color: #c0392b; }

/* Article details (FAQ) */
.article-section details {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.85rem;
  margin: 0.45rem 0;
  background: #fafbfd;
}
.article-section details[open] { background: #fff; }
.article-section details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent-dark);
  font-size: 0.94rem;
}
.article-section details p { margin: 0.5rem 0 0; color: var(--fg); font-size: 0.93rem; }
.article-section h4 {
  margin: 1.1rem 0 0.5rem;
  color: var(--fg);
  font-size: 1rem;
  display: flex; align-items: center;
}
.article-section h4::before {
  content: "";
  width: 4px; height: 1em;
  background: var(--accent);
  margin-right: 0.45rem;
  border-radius: 2px;
}

/* ===== Search bar ===== */
.search-bar {
  padding-top: 1.5rem;
}
.search-bar input[type=search] {
  width: 100%;
  padding: 0.85rem 1.1rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 1.05rem;
  background: var(--card-bg);
  transition: border-color 0.15s;
}
.search-bar input[type=search]:focus {
  outline: none;
  border-color: var(--accent);
}

/* ===== Region pills ===== */
.region-filter {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.filter-label {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}
.region-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  flex: 1;
}
.pill {
  padding: 0.4rem 0.95rem;
  background: var(--pill-bg);
  border: 1.5px solid var(--pill-border);
  border-radius: 999px;
  font-size: 0.88rem;
  cursor: pointer;
  color: var(--fg);
  transition: all 0.15s;
  font-family: inherit;
}
.pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ===== Filter dropdowns row ===== */
.row-filters {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  align-items: flex-end;
}
.row-filters label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 110px;
}
.row-filters select {
  padding: 0.5rem 0.7rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  font-size: 0.92rem;
  cursor: pointer;
  font-family: inherit;
}
.row-filters select:focus {
  outline: none;
  border-color: var(--accent);
}
.row-filters .sort-label {
  margin-left: auto;
  min-width: 150px;
}
.row-filters .sort-label select {
  font-weight: 600;
  color: var(--accent-dark);
}

/* ===== External 4-site banner ===== */
.external-banner {
  background: var(--accent-light);
  border-radius: 10px;
  padding: 0.75rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.external-banner p { margin: 0; font-size: 0.88rem; color: var(--muted); }
.ext-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.ext-buttons a {
  padding: 0.4rem 0.85rem;
  background: #fff;
  border: 1.5px solid var(--pill-border);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  transition: all 0.15s;
}
.ext-buttons a:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ===== Result count ===== */
.result-count {
  margin: 1.5rem 0 0.5rem;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ===== Card grid ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.1rem;
}
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(20, 32, 46, 0.1);
}
.card .photo {
  aspect-ratio: 16/10;
  background: #e8edf3 center/cover no-repeat;
  display: block;
  position: relative;
}
.source-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.18rem 0.55rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.source-badge.personal { background: #1aa15a; }
.source-badge.scraped  { background: #0e75c9; }
.source-badge.manual   { background: #5a6473; }
.card .body {
  padding: 0.85rem 0.95rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}
.card .title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--fg);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  min-height: 2.4rem;
}
.card .title:hover { color: var(--accent); }
.card .maker-model {
  font-size: 0.82rem;
  color: var(--accent-dark);
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-top: -0.1rem;
}
.card .meta {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
}
.card .meta .badge {
  background: var(--accent-light);
  color: var(--accent-dark);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-weight: 600;
}
.card .features {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-top: 0.1rem;
}
.feat-badge {
  font-size: 0.72rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.feat-badge.trailer { background: #fff0d6; color: #a55a00; border: 1px solid #e8c180; }
.feat-badge.marina  { background: #e2f0ff; color: #0a5a9c; border: 1px solid #b9d6f0; }
.feat-badge.land    { background: #f0eee5; color: #6a5a30; border: 1px solid #d8d0bc; }
.card .price small { font-size: 0.72rem; color: var(--muted); font-weight: 500; }
.card .price {
  color: #c0392b;
  font-weight: 700;
  font-size: 1.05rem;
}
.card .price.tba { color: var(--muted); font-weight: 500; font-size: 0.92rem; }
.card .source-link {
  margin-top: auto;
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: none;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
}
.card .source-link::after { content: " ↗"; }
.card .source-link:hover { color: var(--accent-dark); }

/* ===== Detail page ===== */
.detail-page {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  margin-top: 1rem;
  box-shadow: var(--shadow);
}
.detail-head { margin-bottom: 1rem; }
.detail-head h2 { margin: 0 0 0.5rem; }
.detail-badges { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.detail-badges .source-badge {
  position: static; padding: 0.25rem 0.7rem; font-size: 0.78rem; box-shadow: none;
}
.detail-badges .price-tag {
  background: #fff5e5;
  color: #c0392b;
  font-weight: 700;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  font-size: 1.05rem;
}
.detail-badges .price-tag.tba { background: #eef1f6; color: var(--muted); }

.maker-line {
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 1rem;
  margin: 0.2rem 0 0.6rem;
  letter-spacing: 0.3px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.4fr);
  gap: 1.5rem;
  margin: 1.25rem 0;
}
@media (max-width: 760px) {
  .detail-grid { grid-template-columns: 1fr; }
}
.detail-grid .detail-info { display: flex; flex-direction: column; gap: 0.5rem; }
.detail-grid .detail-info .spec-section:first-child { margin-top: 0; }

.gallery { margin: 0; }
.gallery-main img { width: 100%; max-height: 320px; object-fit: cover; border-radius: 10px; }
.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.4rem;
  margin-top: 0.6rem;
}
.gallery-thumbs img {
  width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 6px;
  cursor: pointer; opacity: 0.85; transition: opacity 0.15s;
}
.gallery-thumbs img:hover { opacity: 1; }

.spec-section { margin: 1.5rem 0; }
.spec-section h3 {
  font-size: 1rem; color: var(--accent-dark); border-bottom: 2px solid var(--accent-light);
  padding-bottom: 0.3rem; margin-bottom: 0.7rem;
}
.spec {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 0.55rem 0.85rem;
}
.spec dt { color: var(--muted); font-weight: 500; }
.spec dd { margin: 0; }
.equipment-list {
  list-style: none; padding: 0; display: flex; gap: 0.4rem; flex-wrap: wrap;
}
.equipment-list li {
  background: var(--accent-light); color: var(--accent-dark);
  padding: 0.25rem 0.7rem; border-radius: 999px; font-size: 0.85rem;
}
.warning { color: #c0392b; background: #fff3f0; padding: 0.7rem 1rem; border-radius: 6px; }

.source-box, .seller-box, .owner-box {
  margin-top: 1.5rem;
  padding: 1rem 1.2rem;
  background: var(--accent-light);
  border-radius: 10px;
}
.seller-box { background: #eef9f1; }
.owner-box  { background: #fff7e0; }
.source-box a, .seller-box a { font-weight: 600; }
.seller-info { display: flex; gap: 0.75rem; align-items: center; margin: 0.75rem 0; }
.seller-name { font-weight: 600; margin: 0; }
.seller-bio  { color: var(--muted); margin: 0.25rem 0 0; font-size: 0.88rem; }
.avatar-lg { width: 56px; height: 56px; border-radius: 50%; }

/* ===== Flash messages ===== */
.flash { padding: 0.75rem 1rem; border-radius: 8px; margin: 1rem 0; }
.flash.success { background: #e7f7ec; color: #1a6b3a; }
.flash.error   { background: #fdecec; color: #a3242b; }
.flash.info    { background: #e8f0fb; color: #0a5a9c; }
.flash ul { margin: 0; padding-left: 1.2rem; }

/* ===== Forms (sell.php / mypage.php) ===== */
.sell-page, .mypage { padding-top: 1rem; }
.sell-page h2, .mypage h2 { margin-top: 0; }
.sell-form fieldset {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 1rem 1.25rem; margin-bottom: 1.25rem;
}
.sell-form legend {
  font-weight: 700; padding: 0 0.5rem; color: var(--fg);
  display: flex; align-items: center; gap: 0.5rem;
}
.sell-form .req { background: #c0392b; color: #fff; font-size: 0.7rem; padding: 0.1rem 0.45rem; border-radius: 4px; font-weight: 600; }
.sell-form .opt { background: var(--border); color: var(--muted); font-size: 0.7rem; padding: 0.1rem 0.45rem; border-radius: 4px; font-weight: 600; }
.sell-form label {
  display: flex; flex-direction: column; gap: 0.25rem;
  margin-bottom: 0.75rem;
}
.sell-form label span { font-size: 0.85rem; color: var(--muted); }
.sell-form label em { color: #c0392b; font-style: normal; }
.sell-form input, .sell-form select, .sell-form textarea {
  padding: 0.55rem 0.7rem; border: 1.5px solid var(--border); border-radius: 6px;
  font-size: 0.95rem; font-family: inherit; background: #fff;
}
.sell-form input:focus, .sell-form select:focus, .sell-form textarea:focus {
  outline: none; border-color: var(--accent);
}
.sell-form .row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem;
}
.sell-form .row label { margin-bottom: 0; }
.checkbox-label {
  flex-direction: row !important; align-items: center; gap: 0.5rem !important;
  cursor: pointer; padding: 0.4rem 0;
}
.checkbox-label input { width: auto !important; padding: 0 !important; margin: 0 !important; }
.checkbox-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.25rem 0.75rem; margin: 0.5rem 0;
}
.checkbox-grid.small { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.form-actions {
  display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.25rem; flex-wrap: wrap;
}
.btn-primary, .btn-secondary, .btn-mini {
  padding: 0.6rem 1.4rem; border: none; border-radius: 8px;
  font-size: 0.95rem; font-weight: 600; cursor: pointer; font-family: inherit;
  text-decoration: none; display: inline-block;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: #fff; color: var(--accent); border: 1.5px solid var(--accent); }
.btn-secondary:hover { background: var(--accent-light); }
.btn-mini { padding: 0.35rem 0.85rem; font-size: 0.82rem; background: #fff; color: var(--fg); border: 1px solid var(--border); }
.btn-mini.danger { color: #c0392b; border-color: #f0c0c0; }
.btn-mini.danger:hover { background: #fdecec; }
form.inline { display: inline-block; margin: 0; }
.photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.5rem; margin-top: 0.7rem;
}
.photo-thumb { position: relative; }
.photo-thumb img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 6px; }
.photo-thumb.main img { outline: 3px solid var(--accent); }
.photo-thumb span {
  position: absolute; top: 4px; left: 4px;
  background: var(--accent); color: #fff;
  padding: 0.1rem 0.4rem; border-radius: 3px; font-size: 0.7rem;
}

/* ===== My page ===== */
.profile-box {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 1rem 1.25rem; margin-bottom: 1.5rem;
}
.profile-head { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 0.75rem; }
.profile-head .name { margin: 0; font-weight: 700; font-size: 1.1rem; }
.profile-head .email { margin: 0; color: var(--muted); font-size: 0.85rem; }
.profile-form label { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 0.75rem; }
.profile-form span { font-size: 0.85rem; color: var(--muted); }
.profile-form textarea, .profile-form input, .profile-form select {
  padding: 0.5rem 0.7rem; border: 1.5px solid var(--border); border-radius: 6px;
  font-family: inherit; font-size: 0.95rem; background: #fff;
}
.profile-form input[type=file] {
  border: 1px dashed var(--border);
  padding: 0.5rem;
}
.profile-actions {
  display: flex; gap: 0.7rem; align-items: center; margin-top: 0.5rem;
  flex-wrap: wrap;
}
.my-boats-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem;
}
.my-boats-head h3 { margin: 0; }
.my-boat-row {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 1rem; align-items: center;
  padding: 0.75rem;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: 0.6rem;
}
.my-boat-row.status-draft { background: #fffbe7; }
.my-boat-row.status-sold  { opacity: 0.6; }
.my-boat-row .thumb img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; }
.my-boat-row .thumb .no-photo {
  width: 100%; aspect-ratio: 4/3;
  display: flex; align-items: center; justify-content: center;
  background: #e8edf3; color: var(--muted); border-radius: 6px; font-size: 0.75rem;
}
.my-boat-row .title { font-weight: 600; margin: 0 0 0.25rem; }
.my-boat-row .title a { color: var(--fg); text-decoration: none; }
.my-boat-row .meta { color: var(--muted); font-size: 0.85rem; margin: 0; }
.status-pill {
  display: inline-block; padding: 0.1rem 0.45rem; border-radius: 4px;
  font-size: 0.72rem; font-weight: 700; margin-right: 0.4rem;
}
.status-pill.status-draft  { background: #ffeaa3; color: #7a5500; }
.status-pill.status-active { background: #d5f0dc; color: #1a6b3a; }
.status-pill.status-sold   { background: #e1e6ec; color: var(--muted); }
.my-boat-row .actions { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; }

/* ===== Footer ===== */
.site-footer {
  margin-top: 2.5rem;
  padding: 1.5rem 0;
  background: #0a2540;
  color: #c2cad6;
  font-size: 0.85rem;
}
.site-footer a { color: #fff; }

/* ===== Mobile ===== */
@media (max-width: 640px) {
  .site-header h1 { font-size: 1.25rem; }
  .row-filters label { min-width: 47%; flex: 1 1 47%; }
  .row-filters .sort-label { margin-left: 0; min-width: 100%; }
  .cards { gap: 0.85rem; }
  .pill { font-size: 0.8rem; padding: 0.35rem 0.7rem; }
}
