/* /public_html/assets/app.css */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --dw-primary: #F7CF23;
  --dw-primary-hover: #E3B500;
  --dw-primary-soft: #FFF6CC;

  --dw-sub: #8FB5D6;
  --dw-sub-strong: #5F7FA7;

  --dw-bg: #ffffff;
  --dw-card: #ffffff;
  --dw-line: #e6eaf0;
  --dw-text: #111827;
  --dw-muted: #6b7280;
  --dw-radius: 16px;

  /* 互換 */
  --dw-blue: var(--dw-sub-strong);
  --dw-blue-dark: #46668F;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  color: var(--dw-text);
  background: var(--dw-bg);
}

a {
  color: inherit;
  text-decoration: none;
}

.dw-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}

/* Header */
.dw-header {
  background: #fff;
  color: var(--dw-text);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--dw-line);
}

.dw-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
}

/* Brand */
.dw-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
  color: var(--dw-text);
  font-weight: 900;
  letter-spacing: .3px;
}

.dw-brand-logo {
  height: 40px;
  width: auto;
  border-radius: 10px;
  display: block;
}

.dw-brand-name {
  font-weight: 900;
}

/* Nav toggle (mobile) */
.dw-nav-toggle {
  margin-left: auto;
  display: none;
  background: var(--dw-primary-soft);
  border: 1px solid var(--dw-line);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 900;
  color: var(--dw-sub-strong);
}

/* Nav (未ログイン時用) */
.dw-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dw-nav a {
  padding: 8px 10px;
  border-radius: 12px;
  color: var(--dw-sub-strong);
  font-weight: 800;
}

.dw-nav a:hover {
  background: var(--dw-primary-soft);
}

/* Buttons */
.dw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--dw-primary);
  color: #1b1b1b;
  border: 1px solid rgba(0, 0, 0, .05);
  font-weight: 900;
  cursor: pointer;
}

.dw-btn:hover {
  background: var(--dw-primary-hover);
}

.dw-btn-outline {
  background: transparent;
  color: var(--dw-sub-strong);
  border-color: rgba(95, 127, 167, .45);
}

.dw-btn-outline:hover {
  background: rgba(255, 246, 204, .7);
}

.dw-btn-small {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
}

/* Top actions (ログイン時ヘッダー右側) */
.dw-top-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.dw-user-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--dw-primary-soft);
  border: 1px solid var(--dw-line);
  font-weight: 900;
  color: var(--dw-text);
}

/* Card */
.dw-card {
  background: var(--dw-card);
  border: 1px solid var(--dw-line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 10px 24px rgba(10, 20, 30, .06);
}

.dw-title {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 900;
}

.dw-label {
  font-weight: 900;
  color: var(--dw-muted);
  font-size: 12px;
  margin-top: 2px;
}

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

.dw-input {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--dw-line);
  background: #fff;
  min-height: 48px;
  font-size: 16px;
}

.dw-select {
  width: auto;
  min-width: 230px;
}

.dw-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.dw-help {
  color: var(--dw-muted);
  font-size: 12px;
  margin: 10px 0 0;
}

.dw-help a {
  color: var(--dw-sub-strong);
  text-decoration: underline;
}

/* Alerts */
.dw-alert {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 14px;
  padding: 12px;
}

.dw-alert-ok {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.dw-hr {
  border: 0;
  border-top: 1px solid var(--dw-line);
  margin: 16px 0;
}

/* Logged-in shell (sidebar + main) */
.dw-shell {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  gap: 16px;
  padding: 16px;
}

.dw-sidebar {
  width: 240px;
  flex: 0 0 240px;
}

.dw-side-item {
  display: block;
  background: #fff;
  border: 1px solid var(--dw-line);
  border-radius: 14px;
  padding: 12px 12px;
  margin-bottom: 10px;
  font-weight: 900;
  color: var(--dw-text);
}

.dw-side-item:hover {
  background: var(--dw-primary-soft);
  border-color: rgba(95, 127, 167, .25);
}

.dw-side-item.is-active {
  background: var(--dw-primary-soft);
  border-color: rgba(95, 127, 167, .25);
}

.dw-side-sep {
  height: 10px;
}

.dw-main {
  flex: 1;
  min-width: 0;
}

/* Dashboard tiles */
.dw-welcome {
  margin: 12px 0 10px;
  font-weight: 900;
}

.dw-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.dw-tile {
  display: block;
  background: #fff;
  border: 1px solid var(--dw-line);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 10px 22px rgba(10, 20, 30, .06);
}

.dw-tile:hover {
  background: var(--dw-primary-soft);
  border-color: rgba(95, 127, 167, .25);
}

.dw-tile-title {
  font-weight: 900;
  color: var(--dw-sub-strong);
}

.dw-tile-desc {
  margin-top: 6px;
  color: var(--dw-muted);
  font-weight: 800;
  font-size: 12px;
}

/* Domains: badges */
.dw-badge {
  display: inline-block;
  margin: 2px 6px 2px 0;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--dw-line);
  background: #eef2ff;
  color: #1e3a8a;
  font-size: 12px;
  white-space: nowrap;
}

.dw-badge-ok {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.dw-badge-info {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #1e3a8a;
}

.dw-badge-warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.dw-badge-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.dw-badge-legend {
  margin: 6px 0 12px;
}

/* JP notice */
.dw-jp-notice {
  margin: 6px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  font-weight: 900;
  font-size: 12px;
}

/* mini tag */
.dw-mini-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--dw-primary-soft);
  border: 1px solid var(--dw-line);
  font-size: 12px;
  font-weight: 900;
  color: var(--dw-text);
}

.dw-domain-line {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.dw-domain-name {
  font-weight: 900;
}

/* days */
.dw-days {
  font-weight: 900;
  color: #1e3a8a;
}

.dw-days.is-soon {
  color: #b45309;
}

.dw-days.is-expired {
  color: #991b1b;
}

/* pill */
.dw-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--dw-line);
  font-weight: 900;
  font-size: 12px;
  white-space: nowrap;
}

.dw-pill.is-on {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.dw-pill.is-off {
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #374151;
}

/* table */
.dw-table-wrap {
  overflow: auto;
  border-radius: 16px;
  border: 1px solid var(--dw-line);
}

.dw-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1100px;
  /* 横スクロールで崩れない */
  background: #fff;
}

.dw-th {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--dw-line);
  font-size: 12px;
  color: var(--dw-muted);
  white-space: nowrap;
}

.dw-td {
  padding: 10px;
  border-bottom: 1px solid #f0f3f8;
  vertical-align: top;
}

.dw-tr:last-child .dw-td {
  border-bottom: none;
}

.dw-inline {
  display: inline;
}

.dw-inline-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.dw-inline-form {
  gap: 6px;
}

/* Footer */
.dw-footer {
  border-top: 1px solid var(--dw-line);
  background: #fff;
  margin-top: 24px;
}

.dw-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 16px;
  color: var(--dw-muted);
  font-size: 12px;
}

/* Mobile */
@media (max-width: 900px) {
  .dw-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 840px) {
  .dw-nav-toggle {
    display: inline-flex;
  }

  /* 未ログイン nav */
  .dw-nav {
    position: fixed;
    top: 58px;
    right: 12px;
    left: 12px;
    background: #fff;
    border: 1px solid rgba(95, 127, 167, .22);
    border-radius: 16px;
    padding: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    display: none;
    box-shadow: 0 18px 40px rgba(17, 24, 39, .10);
  }

  .dw-nav.is-open {
    display: flex;
  }

  .dw-nav a {
    background: var(--dw-primary-soft);
  }

  /* logged-in shell */
  .dw-shell {
    flex-direction: column;
  }

  .dw-sidebar {
    width: auto;
    flex: 0 0 auto;
    display: none;
    /* ★スマホは閉じた状態 */
    position: fixed;
    top: 58px;
    left: 12px;
    right: 12px;
    z-index: 60;
    background: #fff;
    border: 1px solid rgba(95, 127, 167, .22);
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 18px 40px rgba(17, 24, 39, .10);
  }

  .dw-sidebar.is-open {
    display: block;
  }
}

/* notify_email page */
.dw-email-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dw-email-text {
  font-weight: 900;
}

/* verified / unverified pill */
.dw-pill.is-verified {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.dw-pill.is-unverified {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

/* table width for email */
.dw-table-email {
  min-width: 720px;
}

/* account page */
.dw-account-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 6px 0 10px;
}

.dw-account-id {
  font-weight: 900;
  font-size: 18px;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--dw-primary-soft);
  border: 1px solid var(--dw-line);
  display: inline-block;
}

.dw-h2 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 900;
  color: var(--dw-sub-strong);
}

/* ===== Header override (mobile tidy) ===== */
.dw-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dw-header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dw-brand {
  min-width: auto;
}

.dw-brand-logo {
  height: 40px;
  width: auto;
  border-radius: 10px;
  display: block;
}

/* PC：法務リンク */
.dw-nav-desktop {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dw-nav-desktop a {
  padding: 8px 10px;
  border-radius: 12px;
  color: var(--dw-sub-strong);
  font-weight: 800;
}

.dw-nav-desktop a:hover {
  background: var(--dw-primary-soft);
}

.dw-header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

/* スマホ：ヘッダーは ☰ + ロゴのみ（右ボタンとdesktopリンクを隠す） */
@media (max-width: 840px) {
  .dw-nav-desktop {
    display: none;
  }

  .dw-header-right {
    display: none;
  }
}

/* モバイルメニュー（ハンバーガー内） */
.dw-nav {
  display: none;
}

.dw-nav.is-open {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: fixed;
  top: 58px;
  left: 12px;
  right: 12px;
  z-index: 60;
  background: #fff;
  border: 1px solid rgba(95, 127, 167, .22);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 18px 40px rgba(17, 24, 39, .10);
}

.dw-nav a {
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--dw-primary-soft);
  font-weight: 900;
  color: var(--dw-text);
}

.dw-nav a:hover {
  background: rgba(255, 246, 204, .7);
}

.dw-nav .dw-nav-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.dw-nav .dw-nav-danger:hover {
  background: #fee2e2;
}

.dw-nav-sep {
  height: 1px;
  background: var(--dw-line);
  margin: 6px 0;
}

/* ハンバーガーボタンはスマホだけ表示（既存がある場合は上書き） */
.dw-nav-toggle {
  display: none;
}

@media (max-width: 840px) {
  .dw-nav-toggle {
    display: inline-flex;
    margin-left: 0;
  }
}

/* ===== /Header override ===== */

/* ===== APP header mobile fix ===== */
.dw-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dw-nav-desktop {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}

.dw-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  white-space: nowrap;
}

.dw-nav {
  display: none;
}

.dw-nav.is-open {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: fixed;
  top: 58px;
  left: 12px;
  right: 12px;
  z-index: 60;
  background: #fff;
  border: 1px solid rgba(95, 127, 167, .22);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 18px 40px rgba(17, 24, 39, .10);
  max-height: calc(100vh - 80px);
  overflow: auto;
}

.dw-nav a {
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--dw-primary-soft);
  font-weight: 900;
  color: var(--dw-text);
}

.dw-nav-danger {
  background: #fef2f2 !important;
  border: 1px solid #fecaca;
  color: #991b1b !important;
}

.dw-nav-sep {
  height: 1px;
  background: var(--dw-line);
  margin: 6px 0;
}

@media (max-width: 840px) {
  .dw-nav-desktop {
    display: none;
  }

  .dw-header-right {
    display: none;
  }

  /* スマホはログアウト含め全部ハンバーガーへ */
  .dw-nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }
}

/* ===== /APP ===== */