:root {
  color-scheme: light;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: #f6f7f8;
  color: #17202a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.shell {
  align-items: center;
  display: flex;
  min-height: 100vh;
  padding: 24px;
}

.panel {
  background: #fff;
  border: 1px solid #d8dde3;
  border-radius: 8px;
  box-shadow: 0 10px 32px rgb(24 35 46 / 10%);
  margin: 0 auto;
  max-width: 560px;
  padding: 28px;
  width: 100%;
}

h1 {
  font-size: 1.45rem;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.35;
  margin: 0 0 22px;
}

h2 {
  color: #465563;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.35;
  margin: 0 0 10px;
}

.user-summary {
  background: #eef5f3;
  border: 1px solid #c9ded9;
  border-radius: 6px;
  color: #31546d;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.45;
  margin: -10px 0 18px;
  padding: 10px 12px;
}

label {
  display: block;
  font-size: 0.94rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.field-row {
  display: flex;
  gap: 8px;
}

input,
textarea {
  border: 1px solid #aab3bd;
  border-radius: 6px;
  flex: 1;
  font: inherit;
  min-width: 0;
  padding: 12px;
}

textarea {
  display: block;
  line-height: 1.6;
  min-height: 132px;
  resize: vertical;
  width: 100%;
}

button {
  background: #126d62;
  border: 0;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  padding: 0 18px;
}

.button-link {
  align-items: center;
  background: #126d62;
  border-radius: 6px;
  color: #fff;
  display: flex;
  font-weight: 650;
  justify-content: center;
  min-height: 48px;
  padding: 12px 16px;
  text-align: center;
  text-decoration: none;
}

.button-link.app-link {
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
  min-height: 68px;
  padding: 14px 16px;
  text-align: left;
}

.button-link.app-link small {
  color: rgb(255 255 255 / 78%);
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.25;
}

.button-link.secondary {
  background: #31546d;
}

.button-secondary {
  background: #eef2f4;
  border: 1px solid #c8d0d8;
  color: #31546d;
}

.action-list,
.action-grid {
  display: grid;
  gap: 10px;
}

.feedback-panel {
  border-top: 1px solid #e1e6eb;
  margin-top: 18px;
  padding-top: 18px;
}

.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
}

.feedback-list {
  display: grid;
  gap: 10px;
}

.feedback-item {
  background: #f7f9fa;
  border: 1px solid #dde4ea;
  border-radius: 6px;
  padding: 12px;
}

.feedback-item time {
  color: #657482;
  display: block;
  font-size: 0.82rem;
  font-weight: 650;
  margin-bottom: 6px;
}

.feedback-item p {
  line-height: 1.6;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

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

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.button-link:focus-visible {
  outline: 3px solid #8ac4ff;
  outline-offset: 2px;
}

.message {
  line-height: 1.6;
  margin: 18px 0 0;
  min-height: 1.6em;
}

.message[data-kind="error"] {
  color: #b3261e;
}

.message[data-kind="success"] {
  color: #126d62;
}

.is-hidden {
  display: none;
}

@media (max-width: 560px) {
  .field-row {
    flex-direction: column;
  }

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

  button {
    min-height: 44px;
  }

  .form-actions {
    flex-direction: column;
  }
}

/* ログイン後の職員ポータルを広く見やすくする */
#home-panel.panel {
  max-width: 900px;
}

/* ヘッダー周りのレイアウト */
.home-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e1e6eb;
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.home-header h1 {
  margin: 0;
}

.button-logout {
  background: #ffffff;
  border: 1px solid #cfd8df;
  color: #40505e;
  padding: 8px 16px;
  font-size: 0.88rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s;
}

.button-logout:hover {
  background: #f7f9fa;
}

/* アプリケーションカードのグリッドレイアウト */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

@media (max-width: 480px) {
  .apps-grid {
    grid-template-columns: 1fr;
  }
}

.app-card {
  border: 1px solid #d8dde3;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.app-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgb(24 35 46 / 8%);
}

.app-card h3 {
  font-size: 1.1rem;
  margin: 0 0 10px 0;
  color: #126d62;
  font-weight: 700;
}

.app-card-desc {
  font-size: 0.88rem;
  color: #465563;
  line-height: 1.5;
  margin: 0 0 12px 0;
  flex-grow: 1;
}

.app-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.meta-badge {
  background: #f0f4f8;
  color: #475d73;
  font-size: 0.76rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.app-card-use {
  font-size: 0.84rem;
  color: #31546d;
  background: #f0f7f5;
  border-left: 3px solid #126d62;
  padding: 8px 10px;
  margin: 0 0 16px 0;
  border-radius: 0 4px 4px 0;
}

.app-card-actions {
  margin-top: auto;
}

.app-card-actions .button-link {
  min-height: 40px;
  padding: 10px 14px;
  font-size: 0.94rem;
}

/* 準備中のカードスタイル */
.app-card--disabled {
  opacity: 0.85;
  background: #fafbfc;
  border-style: dashed;
}

.app-card--disabled h3 {
  color: #617282;
}

.app-card--disabled .app-card-use {
  border-left-color: #617282;
  background: #f1f4f6;
  color: #617282;
}

.app-card--disabled button.button-link {
  background: #cfd8df;
  color: #ffffff;
  cursor: not-allowed;
  width: 100%;
}

.card-status-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #e28743;
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}

/* フィードバックセクション */
.feedback-section {
  border-top: 1px solid #e1e6eb;
  padding-top: 24px;
  margin-top: 24px;
}

.feedback-section h2 {
  font-size: 1.15rem;
  color: #17202a;
}

.section-desc {
  font-size: 0.88rem;
  color: #5d6d7e;
  margin-top: -6px;
  margin-bottom: 14px;
}

/* フッター部 */
.home-footer-info {
  border-top: 1px solid #e1e6eb;
  padding-top: 16px;
  margin-top: 32px;
}

.disclaimer {
  font-size: 0.8rem;
  color: #657482;
  line-height: 1.5;
  margin: 0 0 12px 0;
}

.message-footer {
  font-size: 0.82rem;
  color: #8c9ba5;
  text-align: center;
  margin: 0;
}

/* Work Badges Styles */
.work-badges-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
}

.work-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 12px;
  color: white;
}

.work-badge--water {
  background-color: #1e90ff; /* DodgerBlue */
}

.work-badge--irrigation {
  background-color: #00bfff; /* DeepSkyBlue */
}

.work-badge--farmland {
  background-color: #2e8b57; /* SeaGreen */
}

.work-badge-desc {
  font-size: 0.85rem;
  color: #555;
  font-weight: normal;
}

/* Legend Panel Styles */
.legend-panel {
  background: #f7f9fa;
  border: 1px solid #dde4ea;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 15px;
}

.legend-panel h3 {
  font-size: 0.82rem;
  color: #5d6d7e;
  margin: 0 0 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.legend-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.legend-list li {
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: #2c3e50;
}

.legend-color {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  margin-right: 6px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

/* ── 筆境界読み込み中スピナー ── */
@keyframes parcel-spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.parcel-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(2, 136, 209, 0.25);
  border-top-color: #0288D1;
  border-radius: 50%;
  animation: parcel-spin 0.75s linear infinite;
  flex-shrink: 0;
  vertical-align: middle;
}

.parcel-spinner.is-hidden {
  display: none;
}

/* Account Warning Banner */
.account-warning-banner {
  background: #fdf2f2;
  border: 1px solid #f5c2c2;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.warning-title {
  color: #b3261e;
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.warning-desc {
  color: #2b1d1d;
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0;
}

.warning-highlight {
  color: #b3261e;
  font-weight: 700;
  display: block;
  margin-top: 8px;
}
