:root{
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #2563eb;
  --primary-contrast: #ffffff;
  --danger: #b91c1c;
  --shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
  --radius: 12px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color:var(--text);
  background:var(--bg);
  line-height:1.5;
}

a{color:var(--primary); text-decoration:none}
a:hover{text-decoration:underline}

.rh-container{
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
}

.rh-shell{
  min-height: 100%;
  display:flex;
  flex-direction:column;
}

.rh-topbar{
  background: #a9c4e2;
  border-bottom: 1px solid #96b6d9;
  box-shadow: 0 8px 18px rgba(97, 132, 173, 0.14);
  position: sticky;
  top: 0;
  z-index: 50;
}

.rh-topbar__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 4px 0;
}

.rh-brand{
  display:flex;
  align-items:baseline;
  gap:10px;
}

.rh-brand--link{
  color:inherit;
  text-decoration:none;
}

.rh-brand--link:hover{
  text-decoration:none;
}

.rh-brand--logo{align-items:center;}

.rh-brand__logo{
  height: 28px;
  width: auto;
  max-width: 220px;
  display:block;
}

.rh-brand__name{
  font-weight:700;
  letter-spacing:0.2px;
  color:#f8fbff;
}

.rh-brand__meta{color:rgba(246, 250, 253, 0.9); font-size: 13px;}

.rh-user{position:relative;}

.rh-user__button{
  list-style:none;
  display:flex;
  align-items:center;
  gap:10px;
  cursor:pointer;
  user-select:none;
  padding: 4px 6px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.rh-user[open] .rh-user__button{
  background:rgba(255, 255, 255, 0.2);
  border-color:rgba(245, 249, 253, 0.46);
}

.rh-user__button:hover{
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(245, 249, 253, 0.46);
}

.rh-user__button::-webkit-details-marker{display:none;}

.rh-user__label{display:flex; flex-direction:column; line-height:1.1; text-align:right;}
.rh-user__company{font-size: 13px; font-weight: 700; color: #34506f;}
.rh-user__email{font-size: 12px; color: rgba(52, 80, 111, 0.82);}

.rh-avatar{
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display:grid;
  place-items:center;
  background: rgba(255, 255, 255, 0.94);
  color: #6f94bf;
  font-weight: 800;
  letter-spacing: 0.4px;
  border:1px solid rgba(255, 255, 255, 0.82);
}

.rh-user__menu{
  position:absolute;
  right:0;
  top: calc(100% + 8px);
  min-width: 268px;
  background: var(--surface);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.10);
  padding: 10px;
  text-align: left;
}

.rh-user:not([open]) .rh-user__menu{display:none;}

.rh-user__menu-head{
  display:grid;
  gap:2px;
  padding:4px 4px 10px;
  margin-bottom:6px;
  border-bottom:1px solid #eef2f7;
}

.rh-user__menu-company{
  color:#0f172a;
  font-size:12px;
  font-weight:800;
}

.rh-user__menu-name{
  color:#334155;
  font-size:13px;
  font-weight:700;
}

.rh-user__menu-mail{
  color:#64748b;
  font-size:11px;
}

.rh-user__item{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 10px;
  border-radius: 12px;
  color: var(--text);
  text-decoration:none;
  font-size: 13px;
  text-align:left;
}

.rh-user__item:hover{
  background: #f8fbff;
  text-decoration:none;
}

.rh-user__item + .rh-user__item{margin-top:2px;}

.rh-user__item-icon{
  width:30px;
  min-width:30px;
  height:30px;
  border-radius:10px;
  display:grid;
  place-items:center;
  background:#f1f5f9;
  color:#1d4ed8;
  font-size:13px;
}

.rh-user__item-label{
  min-width:0;
  flex:1 1 auto;
  color:#0f172a;
  font-weight:700;
}

.rh-user__item-arrow{
  color:#94a3b8;
  font-size:11px;
}

.rh-main{flex:1; padding: 28px 0 42px;}

.rh-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.rh-card__body{padding: 22px;}

.rh-login__logo{
  height: 44px;
  width: auto;
  max-width: 100%;
  display:block;
  margin: 2px auto 22px;
}

.rh-login__help{
  text-align: center;
}

.rh-title{
  margin:0 0 14px;
  font-size: 20px;
}

.rh-help{color:var(--muted); font-size: 13px; margin: 0 0 18px;}

.rh-alert{
  border-radius: 10px;
  border: 1px solid rgba(185, 28, 28, 0.25);
  background: rgba(185, 28, 28, 0.06);
  color: var(--danger);
  padding: 10px 12px;
  margin: 12px 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.rh-alert--success{
  border-color: rgba(22, 101, 52, 0.18);
  background: rgba(22, 163, 74, 0.08);
  color: #166534;
}

.rh-alert--closing{
  opacity: 0;
  transform: translateY(-4px);
}

.rh-form{display:flex; flex-direction:column; gap: 14px;}

.rh-field label{
  display:block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.rh-input{
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  background: #fff;
}

.rh-input:focus{
  outline: none;
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.rh-actions{display:flex; justify-content:flex-end; margin-top: 2px;}

.rh-button{
  appearance:none;
  border: 1px solid rgba(37, 99, 235, 0.2);
  background: var(--primary);
  color: var(--primary-contrast);
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.rh-button--small{
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 13px;
}

.rh-button--danger{
  background: rgba(185, 28, 28, 0.06);
  border-color: rgba(185, 28, 28, 0.18);
  color: #b91c1c;
}

.rh-button--danger:hover{
  background: rgba(185, 28, 28, 0.10);
  border-color: rgba(185, 28, 28, 0.26);
  color: #b91c1c;
}

.rh-input--compact{
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 13px;
}

.rh-button:hover{filter: brightness(0.98)}

.rh-debug details{
  margin: 12px 0;
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

.rh-debug pre{
  margin: 10px 0 0;
  overflow:auto;
  max-height: 260px;
  font-size: 12px;
  color: #0f172a;
}

.rh-tablewrap{overflow:auto; border-radius: var(--radius);}

.rh-table{
  width:100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
}

.rh-table th,
.rh-table td{
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  white-space: nowrap;
}

.rh-table th{
  position: sticky;
  top: 0;
  background: #fafafa;
  text-align:left;
  font-size: 12px;
  color: var(--muted);
}

.rh-table tbody tr:nth-child(even){background: #fcfcfd;}

.rh-table tbody tr:hover{background: #f8fafc;}

.rh-row--selected{
  background: rgba(37, 99, 235, 0.06);
}

.rh-split{
  display:grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 14px;
  align-items:start;
}

.rh-empty{
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.rh-modal{
  border: none;
  padding: 0;
  background: transparent;
}

.rh-modal::backdrop{
  background: rgba(17, 24, 39, 0.35);
}

.rh-modal__panel{
  width: min(560px, calc(100vw - 32px));
}

.rh-modal__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.rh-modal__title{
  font-weight: 800;
}

.rh-button--ghost{
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.rh-button--ghost:hover{
  background: #f8fafc;
}

.rh-page-head{position:relative; margin-bottom:4px;}

.rh-page-return{
  position:absolute;
  top:calc(50% + 8px);
  right:0;
  transform:translateY(-50%);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:auto;
  padding:7px 10px;
  font-size:13px;
  font-weight:600;
  border-radius:9px;
  border-color:rgba(15, 23, 42, 0.18);
  background:rgba(15, 23, 42, 0.06);
  color:#111827;
  box-shadow:none;
  z-index:1;
}

.rh-page-return:hover{
  filter:none;
  background:rgba(15, 23, 42, 0.10);
  border-color:rgba(15, 23, 42, 0.28);
  transform:translateY(-50%) translateX(-1px);
}

.rh-icon-button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:32px;
  min-width:32px;
  height:32px;
  padding:0;
}

.rh-section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin:-14px -16px 10px;
  height:44px;
  min-height:44px;
  padding:0 16px;
  background:var(--rh-card-tint);
  border-bottom:1px solid color-mix(in srgb, var(--rh-card-accent) 18%, #dbe2ea);
}

.rh-section-head-title{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:24px;
  color:var(--rh-card-pill-fg);
  font-weight:800;
  line-height:1.15;
  letter-spacing:.01em;
}

.rh-section-head-group{display:flex; align-items:center; gap:8px; min-width:0;}

.rh-section-head-actions{display:flex; align-items:center; gap:6px; flex-wrap:wrap;}

.rh-section-head .rh-button,
.rh-card-title .rh-button{
  border-color:color-mix(in srgb, var(--rh-card-accent) 24%, #cbd5e1);
  background:color-mix(in srgb, var(--rh-card-accent) 10%, #ffffff);
  color:var(--rh-card-pill-fg);
  box-shadow:none;
}

.rh-section-head .rh-button:hover,
.rh-card-title .rh-button:hover{
  background:color-mix(in srgb, var(--rh-card-accent) 16%, #ffffff);
  border-color:color-mix(in srgb, var(--rh-card-accent) 34%, #cbd5e1);
  filter:none;
}

.rh-section-head .rh-button:focus-visible,
.rh-card-title .rh-button:focus-visible{
  outline:none;
  border-color:color-mix(in srgb, var(--rh-card-accent) 46%, #94a3b8);
  box-shadow:0 0 0 3px color-mix(in srgb, var(--rh-card-accent) 18%, transparent);
}

.rh-detail-card{
  position:relative;
  overflow:hidden;
  border:1px solid #dbe2ea;
  box-shadow:0 8px 20px rgba(15, 23, 42, 0.04);
  background:#fff;
  --rh-card-accent:#94a3b8;
  --rh-card-tint:#f8fafc;
  --rh-card-pill-bg:#e2e8f0;
  --rh-card-pill-fg:#334155;
}

.rh-detail-card::before{display:none;}

.rh-detail-card .rh-card__body{padding:14px 16px 16px; background:#fff;}

 .rh-detail-card--candidate{--rh-card-accent:#2563eb; --rh-card-tint:#dbeafe; --rh-card-pill-bg:#dbeafe; --rh-card-pill-fg:#1d4ed8;}

.rh-detail-card--application{--rh-card-accent:#2563eb; --rh-card-tint:#dbeafe; --rh-card-pill-bg:#dbeafe; --rh-card-pill-fg:#1d4ed8;}

.rh-detail-card--tasks{--rh-card-accent:#d97706; --rh-card-tint:#fef3c7; --rh-card-pill-bg:#fef3c7; --rh-card-pill-fg:#92400e;}

.rh-detail-card--attachments{--rh-card-accent:#475569; --rh-card-tint:#e2e8f0; --rh-card-pill-bg:#e2e8f0; --rh-card-pill-fg:#334155;}

.rh-detail-card--onboarding{--rh-card-accent:#be185d; --rh-card-tint:#ffe4e6; --rh-card-pill-bg:#ffe4e6; --rh-card-pill-fg:#9f1239;}

.rh-card-title{
  display:flex;
  align-items:center;
  gap:8px;
  height:44px;
  min-height:44px;
  margin:-14px -16px 10px;
  padding:0 16px;
  background:var(--rh-card-tint);
  border-bottom:1px solid color-mix(in srgb, var(--rh-card-accent) 18%, #dbe2ea);
  color:var(--rh-card-pill-fg);
  font-weight:800;
  line-height:1.15;
  letter-spacing:.01em;
}

.rh-head-icon{width:14px; color:currentColor; text-align:center; flex:0 0 14px;}

.rh-detail-grid{display:grid; grid-template-columns:1fr; gap:12px; align-items:start;}

.rh-detail-section{display:grid; gap:12px;}

.rh-detail-list{display:grid; grid-template-columns:124px minmax(0, 1fr); gap:8px 12px; margin:0;}

.rh-detail-list dt{margin:0; color:var(--muted); font-size:11px;}

.rh-detail-list dd{margin:0; font-size:12px;}

.rh-detail-tags{display:flex; flex-wrap:wrap; gap:6px;}

.rh-detail-tag{
  display:inline-flex;
  align-items:center;
  min-height:20px;
  padding:0 8px;
  border-radius:999px;
  background:#f3f4f6;
  font-size:11px;
}

.rh-status-chip{
  display:inline-flex;
  align-items:center;
  min-height:20px;
  padding:0 8px;
  border-radius:999px;
  background:#eef2ff;
  color:#3730a3;
  font-size:11px;
  font-weight:700;
}

/* 変更履歴のコメントバッジ（応募詳細・ダッシュボード共通） */
.rh-history-comment-badge{
  display:inline-flex;
  align-items:center;
  padding:0 6px;
  border-radius:999px;
  background:#dbeafe;
  color:#1d4ed8;
  font-size:9px;
  font-weight:800;
  line-height:1.7;
  white-space:nowrap;
}

.rh-status-chip--blue{background:#bfdbfe; color:#1d4ed8;}
.rh-status-chip--sky{background:#bae6fd; color:#0369a1;}
.rh-status-chip--indigo{background:#c7d2fe; color:#3730a3;}
.rh-status-chip--violet{background:#ddd6fe; color:#7c3aed;}
.rh-status-chip--teal{background:#99f6e4; color:#0f766e;}
.rh-status-chip--emerald{background:#bbf7d0; color:#15803d;}
.rh-status-chip--amber{background:#fde68a; color:#b45309;}
.rh-status-chip--orange{background:#fdba74; color:#c2410c;}
.rh-status-chip--rose{background:#fda4af; color:#be123c;}
.rh-status-chip--slate{background:#cbd5e1; color:#334155;}

.rh-timeline{display:grid; gap:8px;}

.rh-timeline__item{
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px;
  background:#fff;
  font-size:12px;
}

.rh-timeline__meta{font-size:11px; color:var(--muted); margin-bottom:4px;}

.rh-candidate-meta{display:block; font-size:10px; color:var(--muted); margin-top:1px; line-height:1.3;}

.rh-form-note{margin-top:4px; color:var(--muted); font-size:10px; line-height:1.3;}

.rh-inline-form{
  display:grid;
  gap:10px;
  margin-bottom:12px;
  padding-bottom:12px;
  border-bottom:1px solid var(--border);
}

.rh-inline-form__grid{display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px;}

.rh-inline-form .rh-field{margin:0;}

.rh-inline-form .rh-field label{font-size:10px; margin-bottom:3px;}

.rh-inline-form .rh-field--full{grid-column:1 / -1;}

.rh-inline-form .rh-input{padding:6px 8px; font-size:12px; min-height:34px;}

.rh-inline-form textarea.rh-input{min-height:72px; resize:vertical;}

.rh-inline-form .rh-button{padding:7px 10px; font-size:12px;}

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

.rh-candidate-form__grid{display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px;}

.rh-candidate-form .rh-field{margin:0;}

.rh-candidate-form .rh-field label{font-size:10px; margin-bottom:3px;}

.rh-candidate-form .rh-field--full{grid-column:1 / -1;}

.rh-candidate-form .rh-input{padding:6px 8px; font-size:12px; min-height:34px;}

.rh-candidate-form textarea.rh-input{min-height:72px; resize:vertical;}

.rh-candidate-form .rh-button{padding:7px 10px; font-size:12px;}

.rh-candidate-form--structured{gap:12px;}

.rh-candidate-form--structured .rh-person-row{padding:0 0 6px;}

.rh-candidate-form--structured .rh-person-value{padding-left:0; border-left:none;}

.rh-candidate-form--structured .rh-input{width:100%;}

.rh-candidate-form--structured textarea.rh-input{min-height:64px;}

.rh-zip-note{margin-top:4px; color:var(--muted); font-size:10px; line-height:1.3;}

.rh-person-static{display:flex; align-items:center; min-height:34px; color:#334155; font-size:12px; font-weight:600;}

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

.rh-history-form textarea.rh-input{width:100%; min-height:120px; resize:vertical; overflow:hidden;}

@media (max-width: 640px){
  .rh-topbar__inner{align-items:flex-start; flex-direction:column;}
  .rh-brand__logo{height:20px; max-width: 160px;}
  .rh-login__logo{height: 38px;}
  .rh-user__label{text-align:left;}
  .rh-actions{justify-content:stretch;}
  .rh-button{width:100%;}
}

@media (max-width: 980px){
  .rh-split{grid-template-columns: 1fr;}
  .rh-page-head{padding-top:54px;}
  .rh-page-return{top:8px; transform:none;}
  .rh-page-return:hover{transform:translateX(-1px);}
  .rh-section-head,
  .rh-card-title{height:auto; min-height:24px; padding:10px 16px 8px;}
  .rh-detail-grid{grid-template-columns:1fr;}
  .rh-detail-list{grid-template-columns:1fr;}
  .rh-inline-form__grid{grid-template-columns:1fr;}
  .rh-candidate-form__grid{grid-template-columns:1fr;}
}
