/* ============================================================
   studio.css - フォトリミ 写真館管理画面
   ============================================================ */

/* ------------------------------------------------------------
   Variables
   ------------------------------------------------------------ */
:root {
    --primary:        #1a365d;
    --primary-light:  #2c5282;
    --accent:         #2b6cb0;
    --accent-hover:   #2c5282;
    --bg:             #eef3f9;
    --surface:        #ffffff;
    --text:           #2d3748;
    --text-light:     #718096;
    --border:         #b0c4d8;
    --input-border:   #94a3b8;
    --error:          #c53030;
    --error-bg:       #fff5f5;
    --success:        #276749;
    --sidebar-w:      220px;
    --header-h:       60px;
    --radius:         6px;
    --shadow:         0 1px 4px rgba(0,0,0,.12);
    --shadow-card:    0 2px 12px rgba(0,0,0,.14);
}

/* ------------------------------------------------------------
   Reset & Base
   ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "Noto Sans JP", "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; vertical-align: middle; }
ul { list-style: none; }

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */
.btn {
    display: inline-block;
    padding: 8px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background .18s, opacity .18s;
    text-align: center;
    line-height: 1.4;
}
.btn:hover { text-decoration: none; opacity: .88; }

.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}
.btn-outline:hover { background: var(--accent); color: #fff; }
/* モーダルの「閉じる」等に使われていたが定義が無く、色の付かないボタンになっていた */
.btn-secondary {
    background: #edf2f7;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: #e2e8f0; color: var(--text); text-decoration: none; }

/* ------------------------------------------------------------
   Alert
   ------------------------------------------------------------ */
/* 通知の共通レイアウト。左にアイコン、右に本文の2カラム。
   エラー＝赤／注意＝アンバー／成功＝緑 で、帯とアイコンの色だけ変える */
.alert {
    position: relative;
    padding: 12px 14px 12px 40px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.8;
}
/* アイコンは絶対配置。中身が <br> や <strong> を含んでいても崩れない
   （flex や grid にすると、それらが別の要素として並んでしまう） */
.alert::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 14px;
    width: 18px;
    height: 18px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.alert-err {
    background: var(--error-bg);
    color: #9b2c2c;
    border: 1px solid #fbb6b6;
    border-left: 4px solid var(--error);
    font-weight: 700;
}
.alert-err::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c53030' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><line x1='12' y1='7' x2='12' y2='13'/><line x1='12' y1='17' x2='12.01' y2='17'/></svg>");
}
.alert-err a { color: #9b2c2c; text-decoration: underline; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.page-login {
    background: #dde3ea;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-wrap {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    text-align: center;
}

.login-card {
    background: var(--surface);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,.22);
    padding: 40px 36px 36px;
    text-align: left;
}

.login-logo {
    text-align: center;
    background: var(--primary);
    margin: -40px -36px 24px;
    padding: 28px 36px;
    border-radius: 10px 10px 0 0;
}
.login-logo img {
    height: 48px;
    width: auto;
}

.login-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    margin-bottom: 24px;
    letter-spacing: .04em;
}

/* フォーム */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 5px;
    letter-spacing: 0;
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select,
.form-group textarea,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
select {
    padding: 7px 12px;
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text);
    background: #fff;
    transition: border-color .18s, box-shadow .18s;
    outline: none;
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
input:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(43,108,176,.15);
}
.form-group input.iserr,
.form-group select.iserr,
.form-group textarea.iserr {
    border-color: var(--error);
    border-width: 2px;
    background: #fff5f5;
}
.form-group input.iserr:focus,
.form-group select.iserr:focus,
.form-group textarea.iserr:focus {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(197,48,48,.14);
}
.form-group .err {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    color: #c53030;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.6;
    margin-top: 5px;
}
.form-group .err::before {
    content: "";
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    margin-top: 2px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c53030' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><line x1='12' y1='7' x2='12' y2='13'/><line x1='12' y1='17' x2='12.01' y2='17'/></svg>") no-repeat center / contain;
}

.btn-login {
    display: block;
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 24px;
    letter-spacing: .04em;
    transition: background .18s;
}
.btn-login:hover { background: var(--accent-hover); }

.login-copy {
    color: rgba(255,255,255,.55);
    font-size: 12px;
    margin-top: 20px;
}

/* 規約表示時はカードを広げる */
.login-wrap.has-terms {
    max-width: 680px;
}

.terms-box {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    max-height: 260px;
    overflow-y: auto;
    background: #f7fafc;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text);
}
.terms-box h2 {
    font-size: 15px;
    margin-bottom: 12px;
    color: var(--primary);
}
.terms-box h3 {
    font-size: 13px;
    margin: 12px 0 4px;
    color: var(--primary-light);
}
.terms-box ul {
    list-style: disc;
    padding-left: 20px;
}
.terms-version {
    text-align: right;
    font-size: 11px;
    color: var(--text-light);
    margin-bottom: 8px;
}
.terms-check label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
}
.terms-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ============================================================
   STUDIO PAGE (ログイン後)
   ============================================================ */
.page-studio {
    background: var(--bg);
}

/* ---- Header ---- */
.studio-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 0 16px;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

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

.header-brand {
    display: flex;
    align-items: center;
    gap: 0;
    text-decoration: none;
}
.header-brand:hover { text-decoration: none; }
.header-logo {
    height: 30px;
    width: auto;
    filter: none;
}
.header-sitename {
    font-size: 14px;
    font-weight: 700;
    color: #c6ddf1;
    letter-spacing: .20em;
    text-transform: uppercase;
    padding-left: 14px;
    margin-left: 14px;
    border-left: 1px solid rgba(198, 221, 241, 0.35);
    line-height: 1;
}
.header-sitename-pro {
    background: linear-gradient(90deg, #f6e27a 0%, #c99728 50%, #f6e27a 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gold-shine 3s linear infinite;
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
}
@keyframes gold-shine {
    0%   { background-position: 0% center; }
    100% { background-position: 200% center; }
}
.header-pro-badge {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    background: linear-gradient(90deg, #f6ad55, #c05621);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    vertical-align: super;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.header-studio-name {
    color: rgba(255,255,255,.8);
    font-size: 13px;
    font-weight: 600;
}
.btn-logout {
    padding: 6px 14px;
    background: rgba(255,255,255,.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s;
}
.btn-logout:hover {
    background: rgba(255,255,255,.28);
    text-decoration: none;
}

/* ハンバーガー */
.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.sidebar-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: rgba(255,255,255,.85);
    border-radius: 2px;
    transition: transform .22s, opacity .22s;
}

/* ---- Layout ---- */
.studio-body {
    display: flex;
    padding-top: var(--header-h);
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.studio-sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    width: var(--sidebar-w);
    height: calc(100vh - var(--header-h));
    background: var(--primary-light);
    overflow-y: auto;
    z-index: 90;
    transition: transform .24s;
}

.nav-list {
    padding: 12px 0;
}
.nav-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    color: rgba(255,255,255,.75);
    font-size: 13px;
    font-weight: 500;
    transition: background .15s, color .15s;
    text-decoration: none;
}
.nav-item a:hover,
.nav-item.active a {
    background: rgba(255,255,255,.12);
    color: #fff;
}
.nav-item.active a {
    border-left: 3px solid #63b3ed;
    padding-left: 17px;
}
.nav-icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    opacity: .8;
}
.nav-item.active .nav-icon,
.nav-item a:hover .nav-icon { opacity: 1; }

/* ---- サイドバー：容量リング ---- */
.sidebar-storage {
    padding: 20px 18px;
    border-top: 1px solid rgba(255,255,255,.15);
}
.sidebar-storage-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    color: rgba(255,255,255,.6);
    text-transform: uppercase;
    margin-bottom: 16px;
    text-align: center;
}
.storage-ring-wrap {
    --pct: 0%;
    width: 144px;
    height: 144px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: conic-gradient(var(--accent) 0 var(--pct), rgba(255,255,255,.25) var(--pct) 100%);
    display: grid;
    place-items: center;
}
.storage-ring-inner {
    width: 108px;
    height: 108px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.storage-ring-pct { font-size: 32px; font-weight: 800; line-height: 1; color: #fff; }
.storage-ring-unit { font-size: 12px; color: rgba(255,255,255,.65); margin-top: 4px; }
.sidebar-storage-text {
    text-align: center;
    font-size: 13px;
    color: rgba(255,255,255,.7);
}
.sidebar-storage-text strong { color: #fff; font-weight: 700; }

/* ---- Main ---- */
.studio-main {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 28px 28px 40px;
    min-width: 0;
}

.page-heading {
    margin-bottom: 22px;
}
.page-heading h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

/* ---- Card ---- */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    margin-bottom: 20px;
    overflow: hidden;
}
.card-head {
    padding: 12px 20px;
    background: #f7fafc;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-head h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0;
}
.card-head-link {
    font-size: .82rem;
    color: var(--accent);
    text-decoration: none;
}
.card-head-link:hover {
    text-decoration: underline;
}
.card-body {
    padding: 20px;
}

/* 使用容量 */
.storage-info {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 10px;
}
.storage-used-label {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}
.storage-sep, .storage-limit-label {
    font-size: 15px;
    color: var(--text-light);
}
.storage-bar-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}
.storage-bar {
    flex: 1;
    height: 8px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
}
.storage-bar-used {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, #63b3ed 100%);
    border-radius: 99px;
    transition: width .4s;
}
.storage-pct {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-light);
    width: 36px;
    text-align: right;
}
.storage-bar-warn  { background: linear-gradient(90deg, #f6ad55 0%, #ed8936 100%) !important; }
.storage-bar-danger{ background: linear-gradient(90deg, #fc8181 0%, #e53e3e 100%) !important; }
.storage-text-warn  { color: #c05621; font-weight: 700; }
.storage-text-danger{ color: #c53030; font-weight: 700; }
.alert-warn {
    background: #fffbeb;
    color: #7b341e;
    border: 1px solid #f6ad55;
    border-left: 4px solid #ed8936;
    line-height: 1.6;
}
.alert-warn a { color: #c05621; text-decoration: underline; }
.alert-warn::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d97706' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/><line x1='12' y1='9' x2='12' y2='13'/><line x1='12' y1='17' x2='12.01' y2='17'/></svg>");
}

/* 成功時の通知。.alert-warn と対になるものが無く、素のテキストで出ていた */
.alert-success {
    background: #f0fff4;
    color: #22543d;
    border: 1px solid #9ae6b4;
    border-left: 4px solid #38a169;
}
.alert-success::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2338a169' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6 9 17l-5-5'/></svg>");
}
/* プロジェクト一覧のフラッシュ。上と同じ見た目にする */
.flash-message {
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.6;
}
/* .alert と併用されたときは、こちらの padding でアイコンの居場所を潰してしまうので戻す
   （.flash-message は単体でも使われるため、padding 自体は残す） */
.alert.flash-message {
    padding: 12px 14px 12px 40px;
    line-height: 1.8;
}

/* .alert を伴わない単体の成功フラッシュにも、同じチェックアイコンを出す */
.flash-success {
    position: relative;
    padding: 12px 14px 12px 40px;
    background: #f0fff4;
    color: #22543d;
    border: 1px solid #9ae6b4;
    border-left: 4px solid #38a169;
}
.flash-success::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 14px;
    width: 18px;
    height: 18px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2338a169' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6 9 17l-5-5'/></svg>") no-repeat center / contain;
}
.drop-zone-disabled {
    opacity: 0.45;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* アップロード画面：コンパクト容量バー */
.storage-bar-compact {
    margin-bottom: 16px;
}
.storage-bar-compact-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 4px;
}

/* カードグリッド */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}
.card-grid .card { margin-bottom: 0; }

/* お知らせ（ダッシュボード） */
.notice-badge {
    display: inline-block;
    min-width: 20px;
    padding: 1px 7px;
    margin-left: 6px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    vertical-align: 1px;
}
.notice-body { padding: 0; }
.notice-list { list-style: none; margin: 0; padding: 0; }
.notice-item { border-bottom: 1px solid #eef1f5; }
.notice-item:last-child { border-bottom: none; }
.notice-item a {
    display: block;
    padding: 12px 16px 12px 42px;
    position: relative;
    color: var(--text);
    font-size: 13.5px;
    line-height: 1.7;
    text-decoration: none;
}
.notice-item a:hover { background: #f7fafc; }
/* 重要度を左のドットで示す（色だけに頼らないよう文面にも状況を書く） */
.notice-item a::before {
    content: "";
    position: absolute;
    left: 18px;
    top: 19px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
}
.notice-danger a::before { background: #e53e3e; }
.notice-warn   a::before { background: #ed8936; }
.notice-info   a::before { background: #3182ce; }
.notice-danger a { background: #fff5f5; }
.notice-danger a:hover { background: #ffecec; }
.notice-more a { color: var(--text-light); font-size: 12.5px; }
.notice-more a::before { background: #cbd5e0; }
.notice-empty { color: var(--text-light); font-size: 13px; }

/* アクションカード */
.card-action .card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.card-count {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}
.card-count span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    margin-left: 4px;
}
.card-desc {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.6;
}

/* ============================================================
   Form styles（プロジェクト登録等）
   ============================================================ */

/*.form-wrap { max-width: 680px; }*/

.form-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    margin-bottom: 20px;
}

/* ラベル内バッジ */
.required {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: var(--error);
    border-radius: 3px;
    padding: 1px 5px;
    margin-left: 6px;
    vertical-align: middle;
    letter-spacing: 0;
}
.optional {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-light);
    background: var(--border);
    border-radius: 3px;
    padding: 1px 5px;
    margin-left: 6px;
    vertical-align: middle;
    letter-spacing: 0;
}

/* テキストエリア */
.form-group textarea {
    width: 100%;
    padding: 7px 12px;
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text);
    background: #fff;
    resize: vertical;
    line-height: 1.6;
    font-family: inherit;
    outline: none;
    transition: border-color .18s, box-shadow .18s;
}
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(43,108,176,.15);
}
.form-group textarea.iserr { border-color: var(--error); background: #ffe8e8; }

/* input + unit inline */
.form-unit {
    display: inline-block;
    margin-left: 8px;
    font-size: 13px;
    color: var(--text-light);
}

/* input-meta（エラー + 文字カウント 同一行） */
.input-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 20px;
    margin-top: 4px;
}
.input-meta .err { margin-top: 0; }

/* 文字カウンター */
.char-count {
    font-size: 11px;
    color: var(--text-light);
    margin-left: auto;
}
.char-count.warn { color: var(--error); font-weight: 700; }

/* フォームノート */
.form-note {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 5px;
}

/* ラジオグループ */
.mode-radio-label {
    display: inline-flex; align-items: center; gap: 8px;
    cursor: pointer; font-size: 14px;
}
.mode-radio-label input[type="radio"] { accent-color: var(--accent); }

.expires-row {
    display: flex; align-items: center; gap: 14px;
    flex-wrap: wrap; margin-top: 6px;
}
.form-group input[type="date"].expires-date-input {
    width: auto; padding: 7px 12px;
    border: 1.5px solid var(--input-border); border-radius: var(--radius);
    font-size: 14px;
}
.form-group input[type="date"].expires-date-input:disabled {
    background: #f7f7f7; color: #aaa; cursor: not-allowed;
}

.radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 4px;
}

/* プロジェクト種別：アイコン＋名称のみのタイル。説明は下の固定エリアへ出すので伸縮させない */
.type-tile-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.type-tile-group .radio-item {
    flex: 1 1 0;
    min-width: 100px;
    padding: 10px 6px;
    align-items: center;
    position: relative;
}
/* ラジオの丸は隠す（選択状態は枠と背景で示す）。キーボード操作は残すため非表示にはしない */
.type-tile-group .radio-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    pointer-events: none;
}
.type-tile-group .radio-item:focus-within {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.type-tile-group .radio-label { gap: 2px; }
.type-tile-group .radio-label strong { font-size: 12.5px; line-height: 1.35; }
/* 説明文はタイルからは消し、JSが下の説明エリアへ転記する */
.type-tile-group .radio-label small { display: none; }
.type-tile-group .type-icon { width: 28px; height: 28px; margin-bottom: 0; }

/* 選択中の種別の説明。高さを固定して、切り替えでレイアウトが動かないようにする */
.type-desc {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: 10px;
    padding: 10px 14px;
    min-height: 44px;
    background: #fffbeb;
    border: 1px solid #f6ad55;
    border-left: 4px solid #ed8936;
    border-radius: var(--radius);
    box-sizing: border-box;
}
.type-desc-title { font-size: 13px; font-weight: 700; color: #7b341e; white-space: nowrap; }
.type-desc-text  { font-size: 12.5px; color: #8a4b1f; line-height: 1.6; }
.radio-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    background: #f7fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    flex: 1;
    min-width: 180px;
    transition: border-color .15s, background .15s;
}
.radio-item:hover { border-color: var(--accent); background: #ebf4ff; }
.radio-item input[type="radio"] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: var(--accent);
    flex-shrink: 0;
}
.radio-item:has(input:checked) {
    border-color: var(--accent);
    border-width: 2px;
    background: #dbeafe;
    box-shadow: 0 0 0 3px rgba(43,108,176,.12);
}
.radio-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
    width: 100%;
}
.radio-label strong { font-size: 14px; color: var(--text); }
.radio-label small  { font-size: 12px; color: var(--text-light); }
.type-icon {
    width: 36px; height: 36px;
    margin-bottom: 2px;
    opacity: .85;
}

/* 目的カード（2段階種別選択のStep1） */
.purpose-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.purpose-card {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    background: #f7fafc;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    flex: 1;
    min-width: 200px;
    transition: border-color .15s, background .15s;
}
.purpose-card input[type="radio"] { display: none; }
.purpose-card:hover { border-color: var(--accent); background: #ebf4ff; }
.purpose-card.is-active {
    border-color: var(--accent);
    background: #dbeafe;
    box-shadow: 0 0 0 3px rgba(43,108,176,.12);
}
.purpose-card-pro:hover         { border-color: #f6ad55; background: #fffaf0; }
.purpose-card-pro.is-active     { border-color: #f6ad55; background: #fef3c7; box-shadow: 0 0 0 3px rgba(246,173,85,.18); }
.purpose-card-icon svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    stroke: var(--accent);
    opacity: .75;
}
.purpose-card-pro .purpose-card-icon svg { stroke: #dd6b20; }
.purpose-card-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.purpose-card-text strong { font-size: 14px; color: var(--text); }
.purpose-card-text small  { font-size: 12px; color: var(--text-light); }

/* Step2 種別グループ */
.type-sub-group {
    margin-top: 10px;
    padding: 12px 14px;
    background: #f0f4f8;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.radio-group-sub { margin-top: 0; }

/* 選択枚数入力行 */
.select-count-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.select-count-label { font-size: 13px; color: var(--text-light); }
.select-count-input {
    width: 64px;
    padding: 7px 8px;
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius);
    font-size: 14px;
    text-align: center;
}
.select-count-input.iserr { border-color: var(--danger); }

/* 条件付きフィールド */
.cond-field { display: none; }
.cond-field.is-show { display: block; }
div.cond-field.is-show { display: block; }

/* フォームアクション */
.form-actions {
    padding-top: 24px;
    border-top: 1px solid var(--border);
    margin-top: 24px;
}
.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    align-items: center;
    margin-top: 20px;
    padding-top: 0;
    border-top: none;
}

.btn-lg { padding: 11px 28px; font-size: 15px; }

/* ページ見出しサブテキスト */
.page-heading-sub {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
}

/* 確認テーブル */
.confirm-table {
    width: 100%;
    border-collapse: collapse;
}
.confirm-table th,
.confirm-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    vertical-align: top;
}
.confirm-table th {
    width: 180px;
    font-weight: 600;
    color: var(--text-light);
    background: #f7fafc;
    white-space: nowrap;
}
.confirm-table tr:last-child th,
.confirm-table tr:last-child td { border-bottom: none; }
.pretext { white-space: pre-wrap; line-height: 1.7; }
.text-muted { color: var(--text-light); }

/* ---- インフォボックス ---- */
.info-box {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: var(--radius);
    padding: 9px 12px;
    font-size: 12.5px;
    color: #822727;
    line-height: 1.6;
}

/* info-box 警告バリエーション */
.info-box-warn {
    background: #fffbeb;
    border-color: #f6ad55;
    color: #7b341e;
}

/* 編集画面：読み取り専用フィールド */
.readonly-field {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    background: #f7f8fa;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: #555;
}

/* ---- PROバッジ ---- */
.badge-pro {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(90deg, #f6ad55, #c05621);
    border-radius: 3px;
    padding: 1px 6px;
    margin-left: 6px;
    vertical-align: middle;
    letter-spacing: 1px;
}

/* Proラジオ選択肢（ノーマル時の見た目） */
.radio-item-pro { opacity: .80; }
.radio-item-pro:hover { border-color: #f6ad55; background: #fffaf0; }
.radio-item-pro:has(input:checked) { border-color: #f6ad55; border-width: 2px; background: #fef3c7; box-shadow: 0 0 0 3px rgba(246,173,85,.18); }

/* 種別ごとのラジオボタン色 */
.radio-item--portrait           { background: #f0f7ff; border-color: #bfd4f6; }
.radio-item--portrait:hover     { background: #e4effe; border-color: #93b4ef; }
.radio-item--portrait:has(input:checked) { background: #dbeafe; border-color: #93b4ef; border-width: 2px; box-shadow: 0 0 0 3px rgba(30,64,175,.10); }
.radio-item--portrait input[type="radio"] { accent-color: #1e40af; }

.radio-item--tether             { background: #f0fdfb; border-color: #a7f0e8; }
.radio-item--tether:hover       { background: #e0faf5; border-color: #5eead4; }
.radio-item--tether:has(input:checked) { background: #ccfbf1; border-color: #5eead4; border-width: 2px; box-shadow: 0 0 0 3px rgba(15,118,110,.10); }
.radio-item--tether input[type="radio"] { accent-color: #0f766e; }

/* テザーアルバム選択。バッジ(.type-tether-select)と同じ紫系に揃える。
   他の種別には色分けがあるのに、この型だけ定義漏れで無色だった */
.radio-item--tether-select      { background: #fdf4ff; border-color: #f0abfc; }
.radio-item--tether-select:hover { background: #fae8ff; border-color: #e879f9; }
.radio-item--tether-select:has(input:checked) { background: #fae8ff; border-color: #e879f9; border-width: 2px; box-shadow: 0 0 0 3px rgba(134,25,143,.10); }
.radio-item--tether-select input[type="radio"] { accent-color: #86198f; }

.radio-item--portrait-select    { background: #fff8f2; border-color: #fdd5b0; }
.radio-item--portrait-select:hover { background: #fff0e4; border-color: #fdba74; }
.radio-item--portrait-select:has(input:checked) { background: #ffedd5; border-color: #fdba74; border-width: 2px; box-shadow: 0 0 0 3px rgba(194,65,12,.10); }
.radio-item--portrait-select input[type="radio"] { accent-color: #c2410c; }

.radio-item--album-select       { background: #fffdf0; border-color: #fde99a; }
.radio-item--album-select:hover { background: #fffbe0; border-color: #fcd34d; }
.radio-item--album-select:has(input:checked) { background: #fef3c7; border-color: #fcd34d; border-width: 2px; box-shadow: 0 0 0 3px rgba(146,64,14,.10); }
.radio-item--album-select input[type="radio"] { accent-color: #92400e; }

.radio-item--file-transfer      { background: #f8f6ff; border-color: #d8cffa; }
.radio-item--file-transfer:hover { background: #f0ecfe; border-color: #c4b5fd; }
.radio-item--file-transfer:has(input:checked) { background: #ede9fe; border-color: #c4b5fd; border-width: 2px; box-shadow: 0 0 0 3px rgba(91,33,182,.10); }
.radio-item--file-transfer input[type="radio"] { accent-color: #5b21b6; }

/* ---- モーダル ---- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
}
.modal-overlay.is-show { display: flex; }

.modal {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,.22);
    width: 100%;
    max-width: 440px;
    margin: 20px;
    overflow: hidden;
}
.modal-head {
    padding: 18px 24px;
    background: var(--primary);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}
.modal-head .badge-pro {
    font-size: 11px;
    vertical-align: baseline;
}
.modal-body {
    padding: 24px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text);
}
.modal-body p + p { margin-top: 10px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ---- Proバナー ---- */
.banner-pro {
    margin-bottom: 20px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}
.banner-pro a {
    display: block;
    line-height: 0;
    transition: opacity .18s;
}
.banner-pro a:hover { opacity: .92; }
.banner-pro img {
    width: 100%;
    height: auto;
    display: block;
}

/* ---- Pro バナー HTML版 ---- */
.banner-pro-html {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 20px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    background: linear-gradient(120deg, #1a2f4e 0%, #1e5799 100%);
    text-decoration: none;
    transition: opacity .18s;
    position: relative;
}
.banner-pro-html:hover { opacity: .93; }
/* 装飾円 */
.banner-pro-html::before,
.banner-pro-html::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.banner-pro-html::before {
    width: 320px; height: 320px;
    right: 80px; top: -120px;
    background: rgba(255,255,255,.03);
}
.banner-pro-html::after {
    width: 180px; height: 180px;
    right: -30px; bottom: -80px;
    background: rgba(255,255,255,.04);
}
.bph-body {
    flex: 1;
    padding: 22px 28px;
    position: relative;
    z-index: 1;
}
.bph-badge {
    display: inline-block;
    background: linear-gradient(90deg, #f6ad55, #c05621);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
    padding: 3px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}
.bph-headline {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
}
.bph-features {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px 24px;
}
.bph-features li {
    color: rgba(255,255,255,.88);
    font-size: 13px;
    line-height: 1.5;
    padding-left: 22px;
    position: relative;
}
.bph-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #f6ad55;
    font-weight: 700;
    font-size: 12px;
}
.bph-cta {
    display: inline-block;
    background: linear-gradient(90deg, #f6ad55, #c05621);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 22px;
    border-radius: 99px;
}
.bph-deco {
    width: 180px;
    flex-shrink: 0;
    padding: 16px 20px 16px 0;
    opacity: .13;
    position: relative;
    z-index: 1;
}
.bph-deco svg {
    width: 100%;
    height: auto;
    display: block;
}
@media (max-width: 600px) {
    .bph-deco { display: none; }
    .bph-features { grid-template-columns: 1fr; }
    .bph-headline { font-size: 14px; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
    .studio-sidebar {
        transform: translateX(-100%);
    }
    .studio-sidebar.is-open {
        transform: translateX(0);
    }
    .studio-main {
        margin-left: 0;
        padding: 20px 16px 32px;
    }
    .header-sitename { display: none; }
    .card-grid {
        grid-template-columns: 1fr;
    }
}


/* ============================================================
   Upload / Project Detail Page
   ============================================================ */

/* セクションタイトル（カード外の見出し） */
.section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--border);
}
.section-desc {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 10px;
}

/* フラッシュメッセージ */
.alert-flash {
    background: #fed7d7;
    border: 1px solid #fc8181;
    color: #742a2a;
    padding: 10px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-weight: 600;
}

/* 概要カード（薄青系） */
.card-info {
    background: #ebf8ff;
    border: 1px solid #bee3f8;
}

/* 概要テーブル */
.detail-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}
.detail-table th,
.detail-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #bee3f8;
    vertical-align: middle;
}
.detail-table th {
    width: 160px;
    color: var(--text-light);
    font-weight: 500;
    white-space: nowrap;
}
.detail-table tr:last-child th,
.detail-table tr:last-child td {
    border-bottom: none;
}
.detail-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 4px 14px 0;
}
.upload-key-display {
    display: inline-block;
    font-family: monospace;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .08em;
    background: #f1f5f9;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px 10px;
    color: var(--text);
    word-break: break-all;
}
.card-head-count {
    font-size: 13px;
    color: var(--text-light);
    margin-left: auto;
}

/* ドラッグ＆ドロップ */
@keyframes drop-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(124,58,237,.35); }
    60%  { box-shadow: 0 0 0 10px rgba(124,58,237,.0); }
    100% { box-shadow: 0 0 0 0   rgba(124,58,237,.0); }
}
.drop-zone {
    background: #f3f0ff;
    border: 2px dashed #a78bfa;
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .15s;
}
.drop-zone.dragover {
    background: #ddd6fe;
    border: 2px solid #7c3aed;
    transform: scale(1.015);
    animation: drop-pulse .6s ease-out infinite;
}
.drop-zone.dragover .drop-icon {
    color: #5b21b6;
    transform: translateY(-4px);
}
.drop-zone.dragover .drop-text {
    color: #4c1d95;
}
.drop-zone.dragover .drop-release {
    display: block;
}
.drop-zone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}
.drop-icon {
    width: 40px;
    height: 40px;
    color: #7c3aed;
    transition: transform .15s, color .15s;
}
.drop-text {
    font-size: 15px;
    color: #5b21b6;
    font-weight: 600;
}
.drop-release {
    display: none;
    font-size: 14px;
    font-weight: 700;
    color: #5b21b6;
    background: #ede9fe;
    border: 1px solid #7c3aed;
    border-radius: 4px;
    padding: 4px 14px;
    margin-top: 4px;
    letter-spacing: .03em;
}
.drop-sub {
    font-size: 13px;
    color: var(--text-light);
    pointer-events: auto;
}
.drop-browse {
    color: var(--accent);
    text-decoration: underline;
    cursor: pointer;
}

/* ━━━ 証明写真リスト表形式 ━━━ */
.portrait-list-card {
    overflow: visible; /* ホバープレビューがカード外にはみ出せるように */
}
.portrait-list-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.portrait-list-table thead th {
    background: #f7f9fc;
    color: var(--text-light);
    font-weight: 600;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 8px 12px;
    border-bottom: 2px solid var(--border);
    text-align: left;
    white-space: nowrap;
}
.portrait-list-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background .12s;
}
.portrait-list-table tbody tr:last-child { border-bottom: none; }
.portrait-list-table tbody tr:hover { background: #f7faff; }
.portrait-list-table tbody td { padding: 5px 12px; vertical-align: middle; }

.plt-col-thumb  { width: 52px; }
.plt-col-date   { width: 150px; }
.plt-col-action { width: 210px; white-space: nowrap; }

.plt-thumb-cell { padding: 4px 8px !important; }
.plt-thumb-wrap {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 40px;
}
/* .thumb-img の width:100%;height:100% を上書き */
table.portrait-list-table .plt-thumb-sq {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 3px;
    cursor: pointer;
    display: block;
    border: 1px solid var(--border);
}
/* JS制御のグローバルホバープレビュー */
.plt-hover-preview {
    display: none;
    position: absolute;
    z-index: 9999;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 6px 24px rgba(0,0,0,.22);
    padding: 4px;
    pointer-events: none;
}
.plt-hover-preview img {
    width: 180px;
    height: auto;
    display: block;
    border-radius: 3px;
}
.plt-thumb-empty {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f2f5;
    border-radius: 3px;
    font-size: 13px;
    color: var(--text-light);
    border: 1px solid var(--border);
}
.plt-name-cell { font-weight: 500; }
.plt-date-cell { color: var(--text-light); font-size: 12px; white-space: nowrap; }

/* アップロード進捗 */
.upload-status {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text);
}

/* 検索フォーム */
.search-form { margin: 0; }
.search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.search-label {
    font-size: 13px;
    color: var(--text);
    white-space: nowrap;
    font-weight: 500;
}
.search-input {
    flex: 1;
    min-width: 160px;
    padding: 7px 10px;
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius);
    font-size: 14px;
}
.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(43,108,176,.15);
}

/* 絞り込み中カード */
.card-filtering {
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 3px rgba(43,108,176,.1);
}
.btn-clear-filter {
    background: #fff;
    border: 1px solid #fc8181;
    color: #c53030;
    white-space: nowrap;
}
.btn-clear-filter:hover {
    background: #fff5f5;
}
.filter-active-label {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 6px;
}
.filter-active-badge {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 99px;
}

/* 件数表示 */
.result-count {
    font-size: 13px;
    color: var(--text-light);
    margin: 10px 0 6px;
}

/* データテーブル */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.data-table thead th {
    background: #4299e1;
    color: #fff;
    font-weight: 600;
    padding: 10px 14px;
    text-align: left;
    font-size: 13px;
}
.data-table tbody td {
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    vertical-align: middle;
}
.data-table tbody tr:nth-child(odd)  { background: #ffffff; }
.data-table tbody tr:nth-child(even) { background: #f3f4f6; }
.data-table tbody tr:last-child td   { border-bottom: none; }
.data-table tbody tr:hover           { background: #dbeafe !important; }
.col-info     { width: auto; }
.col-datetime { width: 160px; white-space: nowrap; }
.col-action   { width: 180px; white-space: nowrap; }
.col-action .inline-form { display: inline; }
.plt-action-cell { white-space: nowrap; }
.plt-action-cell .inline-form { display: contents; }
.plt-action-cell .btn { white-space: nowrap; flex-shrink: 0; }

/* ボタンサイズバリアント */
.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}
.btn-danger {
    background: #e53e3e;
    color: #fff;
    border: 1px solid #e53e3e;
}
.btn-danger:hover {
    background: #c53030;
    border-color: #c53030;
    color: #fff;
    text-decoration: none;
}

/* 小さい削除ボタン。以前は定義が無く、ブラウザ既定の見た目に頼っていた
   （brands.php の削除ボタンで隣のボタンとサイズが揃わない原因になっていた） */
.btn-danger-sm {
    padding: 4px 10px;
    font-size: 12px;
    background: #e53e3e;
    color: #fff;
    border: 1px solid #e53e3e;
}
.btn-danger-sm:hover {
    background: #c53030;
    border-color: #c53030;
    color: #fff;
    text-decoration: none;
}

/* フォームをボタンの並びに混ぜるときの打ち消し（複数テンプレートで重複定義されていた） */
.inline-form { display: inline; margin: 0; padding: 0; }

/* ── 汎用モーダル ──────────────────────────────────────────────
   以前は .rename-modal-* が studio_project_tether_slots.html の
   インラインstyleにしか無く、他画面で使うとオーバーレイの display:none が
   効かず「常時表示」になる事故が起きた。ここへ移して全画面で使えるようにする。
   .rename-modal-* は既存マークアップ互換のため併記して残す。 */
.ui-modal-overlay,
.rename-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 9998;
    align-items: center;
    justify-content: center;
}
.ui-modal-overlay.is-open,
.rename-modal-overlay.is-open { display: flex; }

.ui-modal-box,
.rename-modal-box {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    width: 360px;
    max-width: 90vw;
}
.ui-modal-title,
.rename-modal-title { font-weight: 700; font-size: 1rem; margin-bottom: 14px; }
.ui-modal-input,
.rename-modal-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: .95rem;
    margin-bottom: 8px;
}
.ui-modal-error,
.rename-modal-error { color: #c00; font-size: .82rem; margin-bottom: 8px; }
.ui-modal-actions,
.rename-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

/* ヘルプボタン */
.help-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
    transition: background .15s;
}
.help-btn:hover { background: var(--accent-hover); }

/* ヘルプモーダル */
.modal-help {
    max-width: 560px;
    width: 95%;
}
.modal-close-x {
    background: none;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    margin-left: auto;
    opacity: .8;
    line-height: 1;
}
.modal-close-x:hover { opacity: 1; }
.modal-head {
    display: flex;
    align-items: center;
}
.help-lead {
    font-size: 13px;
    color: var(--text);
    line-height: 1.7;
    margin-bottom: 16px;
}
.help-diagram {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 14px;
    overflow-x: auto;
}
.help-svg {
    width: 100%;
    height: auto;
    display: block;
}
.help-note {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    font-size: 12px;
    color: var(--text-light);
    background: #f7fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
}

/* ページング */
.paging {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 16px 0 8px;
    flex-wrap: wrap;
}
.paging-btn {
    display: inline-block;
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--accent);
    background: var(--surface);
    text-decoration: none;
    transition: background .15s;
}
.paging-btn:hover {
    background: #ebf8ff;
    text-decoration: none;
}
.paging-disabled {
    color: var(--text-light);
    cursor: default;
    pointer-events: none;
}
.paging-current {
    display: inline-block;
    padding: 5px 12px;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 700;
    background: var(--accent);
    color: #fff;
    min-width: 34px;
    text-align: center;
}

/* 容量不足モーダル */
.modal-capacity {
    max-width: 460px;
    width: 92%;
    text-align: center;
    padding: 40px 36px 32px;
    border-radius: 16px;
}
.modal-capacity-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
}
.modal-capacity-icon svg {
    width: 100%;
    height: 100%;
}
.modal-capacity-title {
    font-size: 22px;
    font-weight: 700;
    color: #c53030;
    margin-bottom: 10px;
}
.modal-capacity-body {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 16px;
    line-height: 1.6;
}
.modal-capacity-bar {
    margin-bottom: 24px;
}
.modal-capacity-bar-track {
    height: 10px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 6px;
}
.modal-capacity-bar-fill {
    height: 100%;
    border-radius: 99px;
}
.modal-capacity-bar-label {
    font-size: 12px;
    color: var(--text-light);
}
.modal-capacity-pro {
    display: block;
    background: linear-gradient(135deg, #1a2f4e 0%, #1e5799 100%);
    border-radius: 10px;
    padding: 18px 20px 16px;
    margin-bottom: 20px;
    text-decoration: none;
    transition: opacity .18s;
    position: relative;
    overflow: hidden;
}
.modal-capacity-pro:hover { opacity: .92; }
/* 右側装飾円 */
.modal-capacity-pro::after {
    content: '';
    position: absolute;
    right: -40px; top: -40px;
    width: 160px; height: 160px;
    border-radius: 50%;
    background: rgba(255,255,255,.04);
    pointer-events: none;
}
.mcp-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.mcp-badge {
    display: inline-block;
    background: linear-gradient(90deg, #f6ad55, #c05621);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
    padding: 3px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}
.mcp-title {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}
.mcp-features {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px 12px;
}
.mcp-features li {
    color: rgba(255,255,255,.88);
    font-size: 12px;
    line-height: 1.4;
    padding-left: 18px;
    position: relative;
}
.mcp-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #f6ad55;
    font-weight: 700;
    font-size: 11px;
}
.mcp-cta {
    display: inline-block;
    background: linear-gradient(90deg, #f6ad55, #c05621);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 18px;
    border-radius: 99px;
}
.modal-capacity-foot { }

/* アップロード進捗モーダル */
.modal-upload {
    max-width: 400px;
    width: 92%;
    text-align: center;
    padding: 40px 32px 32px;
    border-radius: 16px;
}
.modal-upload-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 20px;
}
.modal-upload-icon svg {
    width: 100%;
    height: 100%;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.upload-spinner {
    animation: spin 1.1s linear infinite;
    transform-origin: center;
}
.modal-upload-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.modal-upload-count {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 16px;
}
.modal-upload-bar-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.modal-upload-bar-track {
    flex: 1;
    height: 10px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
}
.modal-upload-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #63b3ed);
    border-radius: 99px;
    transition: width .25s ease;
}
.modal-upload-bar-fill.upload-bar-success {
    background: linear-gradient(90deg, #48bb78, #38a169);
}
.modal-upload-pct {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-light);
    width: 36px;
    text-align: right;
}
/* 現在アップロード中のファイル */
.modal-upload-current {
    text-align: left;
    background: var(--bg, #f7fafc);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 16px;
}
.modal-upload-current-name {
    font-size: 12px;
    color: var(--text);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.modal-upload-current-bar-track {
    height: 5px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
}
.modal-upload-current-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 99px;
    transition: width .1s linear;
}
.modal-upload-current-size {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 4px;
}
.modal-upload-errors {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    text-align: left;
    max-height: 120px;
    overflow-y: auto;
}
.modal-upload-errors li {
    font-size: 12px;
    color: #c53030;
    padding: 3px 0;
    border-bottom: 1px solid #fff5f5;
}
.modal-upload-foot { }

/* モードバナー */
.mode-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    border-radius: 10px;
    padding: 14px 20px;
    margin-bottom: 14px;
}
.mode-banner-portrait {
    background: #ebf8ff;
    border: 1.5px solid #90cdf4;
}
.mode-banner-snap {
    background: #fffaf0;
    border: 1.5px solid #fbd38d;
}
.mode-banner-icon {
    width: 56px;
    height: 44px;
    flex-shrink: 0;
}
.mode-banner-icon svg {
    width: 100%;
    height: 100%;
}
.mode-banner-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.mode-banner-label {
    font-size: 15px;
    font-weight: 700;
}
/* 選択系の2種はバナー色の定義が無く、枠も背景も付いていなかった */
.mode-banner-portrait-select {
    background: #fff8f2;
    border: 1.5px solid #fdba74;
}
.mode-banner-snap-select {
    background: #fdf4ff;
    border: 1.5px solid #f0abfc;
}
.mode-banner-portrait-select .mode-banner-label { color: #c2410c; }
.mode-banner-snap-select .mode-banner-label     { color: #86198f; }

.mode-banner-portrait .mode-banner-label { color: #2b6cb0; }
.mode-banner-snap    .mode-banner-label { color: #c05621; }
.mode-banner-desc {
    font-size: 12px;
    color: var(--text-light);
}

/* サムネイル・トークン情報 */
/* トークングリッド */
.token-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 16px;
}
.token-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: box-shadow .15s;
}
.token-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.14);
}
.token-card-thumb {
    position: relative;
    background: #f0f2f5;
    aspect-ratio: 3 / 4;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.token-card-thumb .thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    display: block;
    border-radius: 0;
    border: none;
}
.token-card-thumb .thumb-img:hover {
    transform: scale(1.04);
}
.token-card-thumb .thumb-strip-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px;
    align-content: flex-start;
}
.token-card-thumb .thumb-strip-wrap .thumb-img {
    width: calc(50% - 2px);
    height: auto;
    aspect-ratio: 1;
    border-radius: 3px;
    border: 1px solid var(--border);
}
.thumb-empty {
    font-size: 11px;
    color: var(--text-light);
}
.thumb-count-badge {
    position: absolute;
    top: 6px; right: 6px;
    background: rgba(0,0,0,.6);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 999px;
}
.token-card-body {
    padding: 9px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}
.token-card-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    word-break: break-all;
    line-height: 1.4;
}
.token-card-date {
    font-size: 11px;
    color: var(--text-light);
}
.token-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

/* スナップ：フォルダ横一列リスト */
.snap-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}
.snap-row {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.snap-row-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f3f4f6;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.snap-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
}
.snap-count {
    font-size: 11px;
    background: var(--accent);
    color: #fff;
    padding: 1px 8px;
    border-radius: 999px;
    font-weight: 600;
}
.snap-date {
    font-size: 11px;
    color: var(--text-light);
    margin-left: auto;
}
.snap-actions {
    display: flex;
    gap: 6px;
}
.snap-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px;
    align-items: flex-start;
}
.snap-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    flex-shrink: 0;
}
.snap-thumb:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

/* ━━━ 顔写真選択：候補サムネイルのハイライト ━━━ */
.sel-thumb-wrap {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    border-radius: 4px;
}
/* 候補はすべて同じ明るさで出す。写真そのものを見比べたいため、
   未選択を暗くする表示はしない（選択済みは枠とチェックで示す） */
.sel-thumb-wrap .snap-thumb {
    transition: transform .15s, box-shadow .15s;
}
/* 選択済みは緑のinset枠（overflow:hiddenに隠されない） */
.sel-thumb-wrap.sel-chosen .snap-thumb {
    box-shadow: inset 0 0 0 3px #38a169;
}
/* 選択済みチェックバッジ */
.sel-check-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    background: #38a169;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
/* 選択状態バッジ（行メタ） */
.sel-badge {
    display: inline-block;
    font-size: .75rem;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 99px;
    flex-shrink: 0;
    white-space: nowrap;
}
.sel-badge-done {
    background: #c6f6d5;
    color: #276749;
}
.sel-badge-none {
    background: #f7f9fc;
    color: #a0aec0;
    border: 1px solid #e2e8f0;
}

/* 旧テーブル用スタイル（他画面で使う可能性があるため残す） */
.token-info-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.token-info-name {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.thumb-strip-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.thumb-img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    display: block;
}
.thumb-img:hover {
    transform: scale(1.06);
    box-shadow: 0 4px 12px rgba(0,0,0,.18);
}
.thumb-count {
    font-size: 11px;
    color: var(--text-light);
}

/* 写真ライトボックス */
.modal-photo {
    position: relative;
    background: #111;
    border-radius: 12px;
    width: min(92vw, 860px);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.photo-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 10px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    flex-shrink: 0;
    min-height: 44px;
}
.photo-modal-title {
    color: rgba(255,255,255,.85);
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: calc(100% - 48px);
}
.photo-modal-close {
    background: rgba(255,255,255,.12);
    border: none;
    color: #fff;
    font-size: 16px;
    line-height: 1;
    padding: 5px 10px;
    border-radius: 99px;
    cursor: pointer;
    transition: background .15s;
    flex-shrink: 0;
}
.photo-modal-close:hover { background: rgba(255,255,255,.28); }
/* 証明写真：単枚 */
.photo-single-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    flex: 1;
    min-height: 0;
}
.photo-single-wrap img {
    max-width: 100%;
    max-height: calc(92vh - 60px);
    object-fit: contain;
    border-radius: 4px;
    display: block;
}
/* スナップ：横スライダー */
.photo-gallery-wrap {
    position: relative;
    overflow: hidden;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.photo-slider-track {
    display: flex;
    flex: 1;
    min-height: 0;
    transition: transform .3s ease;
}
.photo-slide {
    min-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 56px;
    gap: 8px;
    box-sizing: border-box;
}
.photo-slide img {
    max-width: 100%;
    max-height: calc(92vh - 130px);
    object-fit: contain;
    border-radius: 4px;
    display: block;
}
/* 拡大表示：お客様が選んだ1枚（テザーアルバム選択の拡大表示と同じ見せ方） */
.photo-slide-imgbox { position: relative; display: inline-block; line-height: 0; }
.photo-slide.is-selected .photo-slide-imgbox img { outline: 3px solid #2f855a; outline-offset: -3px; }
.photo-slide-sel-mark {
    position: absolute; top: 12px; left: 12px;
    background: #2f855a; color: #fff;
    font-size: .78rem; font-weight: 700; letter-spacing: .02em; line-height: 1;
    padding: 6px 12px; border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0,0,0,.35);
    pointer-events: none;
}
.photo-slide-sel-badge {
    position: absolute; top: 10px; right: 10px;
    width: 40px; height: 40px; border-radius: 50%;
    background: #2f855a; color: #fff;
    font-size: 22px; font-weight: 700; line-height: 40px; text-align: center;
    border: 2px solid #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,.45);
    pointer-events: none;
}
.photo-slide-name {
    font-size: 12px;
    color: rgba(255,255,255,.45);
    text-align: center;
    word-break: break-all;
}
.photo-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,.45);
    border: none;
    color: #fff;
    font-size: 36px;
    line-height: 1;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s;
    z-index: 2;
}
.photo-slider-btn:hover { background: rgba(0,0,0,.75); }
.photo-slider-prev      { left: 8px; }
.photo-slider-next      { right: 8px; }
.photo-slider-count {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,.65);
    font-size: 13px;
    background: rgba(0,0,0,.35);
    padding: 2px 12px;
    border-radius: 99px;
    pointer-events: none;
}
/* ファイル名リンク風ボタン */
.token-label-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--accent);
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-align: left;
}

/* ------------------------------------------------------------
   プロジェクト一覧テーブル
   ------------------------------------------------------------ */
.proj-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .93rem;
}
.proj-table thead th {
    background: #f7f9fc;
    color: var(--text-light);
    font-weight: 600;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
/* 並び替え可能な見出し */
.proj-table thead th.sortable { padding: 0; }
.proj-table thead th.sortable a {
    display: block;
    padding: 10px 16px;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}
.proj-table thead th.sortable a:hover { background: #eef2f8; color: var(--text); }
.proj-table thead th.is-sorted a { color: var(--primary); }
.sort-mark { margin-left: 5px; font-size: .8em; opacity: .35; }
.proj-table thead th.is-sorted .sort-mark { opacity: 1; }
.proj-created-cell { white-space: nowrap; color: var(--text-light); }
.proj-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background .12s;
}
.proj-table tbody tr:last-child {
    border-bottom: none;
}
.proj-table tbody tr:hover {
    background: #f7faff;
}
.proj-table td {
    padding: 12px 16px;
    vertical-align: middle;
}
.proj-name-cell a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
}
.proj-name-cell a:hover {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.proj-count-cell {
    font-weight: 600;
    color: var(--text);
}
.count-unit {
    font-size: .8rem;
    font-weight: 400;
    color: var(--text-light);
    margin-left: 1px;
}
.proj-storage-cell {
    color: var(--text-light);
    font-size: .88rem;
    white-space: nowrap;
}
.proj-expires-cell {
    color: var(--text);
    white-space: nowrap;
}
.expires-none {
    color: var(--text-light);
    font-size: .88rem;
}
.proj-actions-cell {
    white-space: nowrap;
    display: flex;
    gap: 6px;
    align-items: center;
}

/* 種別バッジ */
.type-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 99px;
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
}
.type-portrait {
    background: #f0f7ff;
    border-color: #bfd4f6;
    color: #2c5282;
}
.type-snap {
    background: #f0f9ff;
    border-color: #bae6fd;
    color: #0369a1;
}
/* 種別カラーは「新規プロジェクト登録」のタイル（.radio-item--xxx）に合わせる。
   タイルの背景・枠・アイコン色をそのまま使う */
.type-portrait-select {
    background: #fff8f2;
    border-color: #fdd5b0;
    color: #c2410c;
}
.type-snap-select {
    background: #fffdf0;
    border-color: #fde99a;
    color: #b45309;
}
.type-album-select {
    background: #fffdf0;
    border-color: #fde99a;
    color: #92400e;
}
.type-file-send {
    background: #f8f6ff;
    border-color: #d8cffa;
    color: #7c3aed;
}
.type-file-receive {
    background: #f8f6ff;
    border-color: #d8cffa;
    color: #7c3aed;
}
.type-tether {
    background: #f0fdfb;
    border-color: #a7f0e8;
    color: #0f766e;
}
.type-tether-select {
    background: #fdf4ff;
    border-color: #f0abfc;
    color: #86198f;
}

/* 小ボタン */
.btn-sm {
    padding: 4px 10px;
    font-size: .82rem;
}
.btn-danger {
    background: #fff5f5;
    color: #c53030;
    border: 1px solid #feb2b2;
}
.btn-danger:hover {
    background: #fed7d7;
    border-color: #fc8181;
}

/* 空ステート */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}
.empty-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
    opacity: .4;
}
.empty-state p {
    margin-bottom: 20px;
    font-size: 1rem;
}
.token-label-link:hover { color: var(--accent-dark, #1d4ed8); }



/* ━━━ リサイズ設定 ━━━ */
.resize-setting {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 8px 14px;
    margin-bottom: 10px;
    font-size: .88rem;
}
.resize-check-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 600;
    color: #166534;
}
.resize-check-label input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; }
.resize-off-note {
    margin-left: 12px;
    color: #b45309;
    font-size: .83rem;
    font-weight: 600;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 4px;
    padding: 2px 10px;
}

/* ━━━ 顔検出ステータス ━━━ */
.face-crop-status {
    margin-top: 6px;
    width: 100%;
}
.face-crop-msg {
    display: block;
    font-size: .8rem;
    color: #374151;
    margin-bottom: 4px;
}
.face-crop-bar-wrap {
    height: 4px;
    background: #d1fae5;
    border-radius: 2px;
    overflow: hidden;
    max-width: 280px;
}
.face-crop-bar {
    height: 100%;
    background: #10b981;
    border-radius: 2px;
    transition: width 0.4s ease;
}
.face-crop-bar-done { background: #059669; }

/* ------------------------------------------------------------
   プロジェクト一覧ツールバー（種別バッジ・検索）
   ------------------------------------------------------------ */
.proj-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-bottom: 12px;
}
.proj-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.proj-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
    background: #f1f3f5;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s, opacity .15s;
    white-space: nowrap;
}
.proj-tab:hover {
    background: #e9edf2;
    color: var(--text);
    border-color: var(--input-border);
}
.proj-tab.is-active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 700;
}
/* 種別を示す色ドット（未選択でも種別が分かるよう色は残す） */
.proj-tab-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    opacity: .35;
}
.proj-tab.is-active .proj-tab-dot { opacity: 1; }
.proj-tab-cnt {
    font-size: 11px;
    font-weight: 600;
    opacity: .75;
}
.proj-tab.is-active .proj-tab-cnt {
    opacity: .85;
}

/* 種別ごとのバッジカラー（未選択はグレー／選択時は登録画面のタイルと同じ色） */
.proj-tab--portrait .proj-tab-dot        { background: #2c5282; }
.proj-tab--portrait.is-active            { background: #f0f7ff; color: #2c5282; border-color: #bfd4f6; box-shadow: 0 0 0 2px rgba(44,82,130,.10); }

.proj-tab--tether .proj-tab-dot          { background: #0f766e; }
.proj-tab--tether.is-active              { background: #f0fdfb; color: #0f766e; border-color: #a7f0e8; box-shadow: 0 0 0 2px rgba(15,118,110,.10); }

.proj-tab--tether-select .proj-tab-dot   { background: #86198f; }
.proj-tab--tether-select.is-active       { background: #fdf4ff; color: #86198f; border-color: #f0abfc; box-shadow: 0 0 0 2px rgba(134,25,143,.10); }

.proj-tab--portrait-select .proj-tab-dot { background: #c2410c; }
.proj-tab--portrait-select.is-active     { background: #fff8f2; color: #c2410c; border-color: #fdd5b0; box-shadow: 0 0 0 2px rgba(194,65,12,.10); }

.proj-tab--album-select .proj-tab-dot    { background: #92400e; }
.proj-tab--album-select.is-active        { background: #fffdf0; color: #92400e; border-color: #fde99a; box-shadow: 0 0 0 2px rgba(146,64,14,.10); }

.proj-tab--file-send .proj-tab-dot       { background: #7c3aed; }
.proj-tab--file-send.is-active           { background: #f8f6ff; color: #7c3aed; border-color: #d8cffa; box-shadow: 0 0 0 2px rgba(124,58,237,.10); }

.proj-tab--file-receive .proj-tab-dot    { background: #7c3aed; }
.proj-tab--file-receive.is-active        { background: #f8f6ff; color: #7c3aed; border-color: #d8cffa; box-shadow: 0 0 0 2px rgba(124,58,237,.10); }

/* 検索ボックス */
.proj-search {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-light);
}
.proj-search:focus-within {
    border-color: var(--accent);
}
.proj-search input[type="text"] {
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    color: var(--text);
    width: 200px;
    padding: 3px 0;
}
.proj-search .btn {
    padding: 3px 12px;
    font-size: 12px;
}
.proj-count-badge {
    font-size: 12px;
    color: var(--text-light);
}
.proj-count-badge strong { color: var(--text); }
.proj-filter-clear {
    margin-left: 8px;
    color: var(--accent);
    text-decoration: none;
}
.proj-filter-clear:hover { text-decoration: underline; }

@media (max-width: 640px) {
    .proj-search { width: 100%; }
    .proj-search input[type="text"] { flex: 1; width: auto; min-width: 0; }
}

/* ------------------------------------------------------------
   ページネーション
   ------------------------------------------------------------ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px;
    border-top: 1px solid var(--border);
}
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: background .15s, border-color .15s;
    cursor: pointer;
}
a.page-btn:hover {
    background: #f1f5f9;
    border-color: var(--input-border);
}
.page-btn.is-current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    cursor: default;
}
.page-btn.is-disabled {
    color: var(--border);
    cursor: default;
    pointer-events: none;
}
.page-btn.is-ellipsis {
    border-color: transparent;
    background: transparent;
    cursor: default;
    letter-spacing: .05em;
}

/* ===== 屋号ロゴ選択タイル（プロジェクト登録/編集） ===== */
.brand-pick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 4px;
}
.brand-pick-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.brand-pick-tile:hover { border-color: #cbd5e0; }
.brand-pick-tile:has(input:checked) {
    border-color: #1a6fcf;
    background: #ebf2fb;
    box-shadow: inset 0 0 0 1px #1a6fcf, 0 0 0 4px rgba(26,111,207,.18);
}
.brand-pick-tile input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.brand-pick-logo {
    width: 100%;
    height: 70px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: repeating-conic-gradient(#f0f0f0 0% 25%,#fff 0% 50%) 0 0/12px 12px;
    border: 1px solid #edf2f7;
    margin-bottom: 8px;
}
.brand-pick-logo img { max-width: 90%; max-height: 88%; object-fit: contain; }
.brand-pick-noimg { font-size: 11px; color: #a0aec0; font-weight: 600; }
.brand-pick-name {
    font-size: 13px;
    font-weight: 700;
    color: #2d3748;
    text-align: center;
    word-break: break-word;
    line-height: 1.3;
}
.brand-pick-name-sub { font-size: 11px; color: #718096; font-weight: 600; }
.brand-pick-check {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #1a6fcf;
    display: none;
    align-items: center;
    justify-content: center;
}
.brand-pick-check svg { width: 14px; height: 14px; }
.brand-pick-tile:has(input:checked) .brand-pick-check { display: inline-flex; }

/* ─── セレクト表示枠：現在値サマリ＋控えめ変更ボタン ─── */
.crop-current {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .92rem;
    color: #2d3748;
}
.crop-edit-btn {
    background: none;
    border: none;
    color: #1a6fcf;
    font-size: .82rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 2px 4px;
    flex-shrink: 0;
}
.crop-edit-btn:hover { color: #12508f; }
.crop-edit-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin: 6px 0;
}
.crop-edit-row label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .9rem;
}
.crop-edit-row input { width: 80px; }

/* ZIP一括ダウンロード不可の案内（データ納品／データ受領） */
.zip-limit-notice {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 14px;
    padding: 12px 14px;
    background: #fffaf0;
    border: 1px solid #f6ad55;
    border-radius: 8px;
}
.zip-limit-notice svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #dd6b20;
    margin-top: 1px;
}
.zip-limit-notice strong {
    display: block;
    font-size: 13px;
    color: #9c4221;
    margin-bottom: 3px;
}
.zip-limit-notice p {
    font-size: 12px;
    color: #7b341e;
    line-height: 1.6;
    margin: 0;
}

/* 概要：アップロード先フォルダ一覧（データ受領） */
.rcv-folder-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.rcv-folder-list li {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 3px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12px;
}
.rcv-folder-name {
    font-weight: 600;
    color: var(--text);
}
.rcv-folder-name.is-unsorted {
    font-weight: 400;
    color: var(--text-light);
}
.rcv-folder-count {
    color: var(--accent);
    font-weight: 700;
}
.rcv-folder-count.is-empty {
    color: var(--text-light);
    font-weight: 400;
}
.rcv-folder-size {
    color: var(--text-light);
}

/* データ受領：受領済み一覧のサムネイル＋タイル切替 */
.rcv-list-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.rcv-list-head .result-count { margin: 0; }
.view-toggle {
    display: flex;
    margin-left: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}
.view-toggle-btn {
    background: #fff;
    border: none;
    padding: 5px 12px;
    font-size: 12px;
    color: var(--text-light);
    cursor: pointer;
}
.view-toggle-btn + .view-toggle-btn { border-left: 1px solid var(--border); }
.view-toggle-btn.is-active { background: var(--accent); color: #fff; }

.rcv-thumb {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
}
.rcv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rcv-thumb svg { display: none; width: 18px; height: 18px; color: var(--text-light); }
.rcv-thumb:not(:has(img)) svg,
.rcv-thumb.is-noimg svg { display: block; }
.rcv-thumb.is-noimg img { display: none; }

/* タイル表示：テーブルをグリッドに組み替える。
   table と tbody の両方を grid にすると tbody が親グリッドの1列に押し込まれて
   縦積みになるため、table は block にして tbody だけを grid にする */
.portrait-list-card.view-tile thead { display: none; }
.portrait-list-card.view-tile .portrait-list-table {
    display: block;
    width: 100%;
}
.portrait-list-card.view-tile tbody {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    padding: 12px;
}
.portrait-list-card.view-tile tbody tr {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
}
.portrait-list-card.view-tile tbody td {
    display: block;
    border: none;
    padding: 0;
    font-size: 12px;
}
/* 一覧側の .plt-thumb-cell が !important で padding を持つので打ち消す */
.portrait-list-card.view-tile .plt-thumb-cell { padding: 0 !important; }
.portrait-list-card.view-tile .rcv-thumb {
    width: 100%;
    height: 110px;
    border-radius: 6px;
}
.portrait-list-card.view-tile .plt-name-cell {
    word-break: break-all;
    line-height: 1.4;
    font-weight: 600;
}
.portrait-list-card.view-tile .plt-action-cell { margin-top: 4px; }


/* フォーム項目の外でエラーを1行として出すとき（.err は inline 前提のため） */
.err--block { display: block; margin-top: 6px; }

/* テザースロット一覧のページャ */
.pager { margin-top: 16px; }
.pager .btn { margin: 0 2px; }

/* 納品・受領一覧のファイル名列。折り返して他の列を潰さないようにする */
.plt-col-name { width: auto; word-break: break-all; }

/* ---- 無料お試し版の帯（_studio_header.html） ---- */
.trial-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 20px;
    background: #fffaf0;
    border-bottom: 1px solid #f0d9a8;
    color: #8a5a00;
    font-size: .85rem;
    line-height: 1.6;
}
.trial-bar--over {
    background: #fff5f5;
    border-bottom-color: #f5c6c6;
    color: #a02020;
}
.trial-bar strong { font-weight: 600; }
.trial-bar-link {
    margin-left: auto;
    flex-shrink: 0;
    padding: 4px 14px;
    border-radius: 4px;
    background: #2b6cb0;
    color: #fff;
    text-decoration: none;
    font-size: .82rem;
}
.trial-bar-link:hover { background: #245a94; }

/* ---- photorimiユーザー専用 登録フォーム（register.html） ---- */
.reg-card { max-width: 560px; }
.reg-lead {
    font-size: .88rem;
    line-height: 1.9;
    color: #4a5568;
    margin: 0 0 18px;
}
.reg-steps {
    display: flex;
    list-style: none;
    margin: 0 0 22px;
    padding: 0;
    font-size: .78rem;
    counter-reset: regstep;
}
.reg-steps li {
    flex: 1;
    text-align: center;
    padding: 7px 4px;
    color: #a0aec0;
    border-bottom: 2px solid #e2e8f0;
    counter-increment: regstep;
}
.reg-steps li::before { content: counter(regstep) ". "; }
.reg-steps li.is-now  { color: #2b6cb0; border-bottom-color: #2b6cb0; font-weight: 600; }
.reg-steps li.is-done { color: #4a5568; border-bottom-color: #90b4d8; }
.reg-fixed {
    margin: 0;
    padding: 9px 12px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: .9rem;
    word-break: break-all;
}
.reg-note {
    margin: 5px 0 0;
    font-size: .76rem;
    line-height: 1.7;
    color: #718096;
}
.reg-code {
    letter-spacing: .5em;
    font-size: 1.3rem;
    text-align: center;
}
.reg-zip { max-width: 160px; }
.reg-sub-form { margin-top: 14px; text-align: center; }
.btn-link {
    background: none;
    border: none;
    padding: 0;
    color: #2b6cb0;
    font-size: .82rem;
    text-decoration: underline;
    cursor: pointer;
}
.reg-table th { white-space: nowrap; width: 11em; }
.reg-notice { margin: 16px 0; }
.reg-actions {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-top: 18px;
}
.reg-actions form { flex: 1; }
.reg-actions .btn { width: 100%; }
.req {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 6px;
    border-radius: 3px;
    background: #e53e3e;
    color: #fff;
    font-size: .68rem;
    font-weight: 500;
    vertical-align: middle;
}

/* register.html で使う不足分 */
.alert-info {
    padding: 10px 14px;
    border-radius: 4px;
    background: #ebf8ff;
    border: 1px solid #bee3f8;
    color: #2c5282;
    font-size: .85rem;
    margin-bottom: 14px;
}
.btn-block { display: block; width: 100%; }
.reg-card .table-wrap { overflow-x: auto; }

/* ---- 管理者画面（admin_accounts.html） ---- */
.admin-main { max-width: 900px; margin: 0 auto; padding: 24px 20px 60px; }
.acc-card {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    padding: 16px 18px;
    margin-bottom: 16px;
}
.acc-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.acc-shop { font-size: 1.02rem; }
.acc-badge {
    padding: 2px 9px;
    border-radius: 3px;
    font-size: .72rem;
    font-weight: 500;
    background: #edf2f7;
    color: #4a5568;
}
.acc-badge--pending   { background: #fffaf0; color: #975a16; border: 1px solid #f0d9a8; }
.acc-badge--active    { background: #f0fff4; color: #276749; border: 1px solid #b7e4c7; }
.acc-badge--rejected  { background: #fff5f5; color: #9b2c2c; border: 1px solid #f5c6c6; }
.acc-badge--suspended { background: #f7fafc; color: #4a5568; border: 1px solid #cbd5e0; }
.acc-badge--pr        { background: #ebf8ff; color: #2c5282; border: 1px solid #bee3f8; }
.acc-table th { white-space: nowrap; width: 10em; }
.acc-table { font-size: .86rem; }
.acc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: flex-end;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #edf2f7;
}
.acc-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.acc-label { font-size: .8rem; color: #4a5568; }
.acc-reason { min-width: 260px; font-size: .84rem; }
.empty-message { color: #718096; font-size: .9rem; padding: 30px 0; text-align: center; }

/* ---- パスワード強度メーター（register.html） ---- */
.pw-meter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}
.pw-meter {
    display: flex;
    gap: 4px;
    flex: 1;
}
.pw-meter span {
    flex: 1;
    height: 5px;
    border-radius: 3px;
    background: #e2e8f0;
    transition: background .15s;
}
.pw-meter.is-weak   span:nth-child(1) { background: #e53e3e; }
.pw-meter.is-mid    span:nth-child(-n+2) { background: #dd8f20; }
.pw-meter.is-strong span { background: #2f9e5f; }
.pw-label {
    min-width: 2.2em;
    font-size: .82rem;
    font-weight: 600;
    text-align: right;
}
.pw-label.is-weak   { color: #e53e3e; }
.pw-label.is-mid    { color: #b9770e; }
.pw-label.is-strong { color: #2f9e5f; }
.pw-reqs {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    font-size: .78rem;
    line-height: 1.9;
    color: #a0aec0;
}
.pw-reqs li::before {
    content: "○";
    display: inline-block;
    width: 1.4em;
    color: #cbd5e0;
}
.pw-reqs li.is-ok        { color: #2f9e5f; }
.pw-reqs li.is-ok::before { content: "✓"; color: #2f9e5f; }

/* ---- パスワード表示トグル（目のアイコン・JSが差し込む） ---- */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 42px; }
.pw-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: none;
    color: #a0aec0;
    cursor: pointer;
}
.pw-toggle:hover  { color: #4a5568; background: #edf2f7; }
.pw-toggle:active { background: #e2e8f0; }
.pw-toggle svg { display: block; }
.acc-approver {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 3px;
    background: #edf2f7;
    color: #4a5568;
    font-size: .76rem;
}

/* ---- 管理者：アカウント一覧の絞り込み ---- */
.acc-filter {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f7fafc;
    padding: 14px 16px;
    margin-bottom: 14px;
}
.acc-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}
.acc-filter-row + .acc-filter-row { margin-top: 10px; }
.acc-filter-item { display: flex; flex-direction: column; gap: 4px; }
.acc-filter-item--grow { flex: 1; min-width: 220px; }
.acc-filter-item--grow input { width: 100%; }
.acc-filter-item--btns { flex-direction: row; gap: 8px; margin-left: auto; }
.acc-filter-item label { font-size: .76rem; color: #4a5568; }
.acc-result {
    display: flex;
    gap: 14px;
    align-items: baseline;
    font-size: .84rem;
    color: #4a5568;
    margin-bottom: 8px;
}
.acc-page-info { color: #a0aec0; }

/* ---- 管理者：アカウント一覧テーブル ---- */
.acc-list { width: 100%; border-collapse: collapse; font-size: .85rem; }
.acc-list thead th {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 2px solid #e2e8f0;
    font-size: .78rem;
    color: #4a5568;
    white-space: nowrap;
}
.acc-list thead th a { color: inherit; text-decoration: none; }
.acc-list thead th a:hover { color: #2b6cb0; text-decoration: underline; }
.acc-sort { margin-left: 3px; color: #2b6cb0; font-size: .7rem; }
.acc-list tbody td { padding: 9px 10px; border-bottom: 1px solid #edf2f7; vertical-align: middle; }
.acc-row { cursor: pointer; }
.acc-row:hover  { background: #f7fafc; }
.acc-row.is-open { background: #ebf4fb; }
.acc-col-toggle { width: 30px; }
.acc-toggle {
    border: none;
    background: none;
    color: #a0aec0;
    font-size: .7rem;
    cursor: pointer;
    padding: 0;
}
.acc-col-mail { color: #4a5568; word-break: break-all; }
.acc-col-date { white-space: nowrap; color: #4a5568; font-size: .8rem; }

/* 期限列（有料の利用期限／お試し期限／データ削除予定を1列にまとめて出す） */
.acc-col-expire { white-space: nowrap; min-width: 120px; }
.acc-expire { font-size: .8rem; color: #4a5568; }
.acc-expire.is-warn   { color: #b7791f; font-weight: 600; }
.acc-expire.is-danger { color: #c53030; font-weight: 600; }
.acc-expire-note { display: block; color: #718096; font-size: .72rem; }
.acc-danger { color: #c53030; font-weight: 600; }
.acc-col-used { min-width: 130px; }
.acc-col-used small { color: #718096; font-size: .72rem; }
.acc-bar {
    height: 5px;
    border-radius: 3px;
    background: #e2e8f0;
    overflow: hidden;
    margin-bottom: 3px;
}
.acc-bar span { display: block; height: 100%; background: #2f9e5f; }
.acc-bar span.is-warn   { background: #dd8f20; }
.acc-bar span.is-danger { background: #e53e3e; }
.acc-detail > td { background: #f7fafc; padding: 14px 16px !important; }
.acc-detail .acc-actions { margin-top: 12px; padding-top: 12px; }

/* ---- 有料申し込みのコース選択（signup.html） ---- */
.plan-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.plan-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.plan-item:hover { border-color: #90b4d8; background: #f7fafc; }
.plan-item:has(input:checked) {
    border-color: #2b6cb0;
    background: #ebf4fb;
    box-shadow: 0 0 0 3px rgba(43,108,176,.12);
}
.plan-body { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.plan-name  { font-weight: 600; font-size: 1rem; }
.plan-size  { font-size: .8rem; color: #718096; }
.plan-price { font-size: 1.05rem; font-weight: 600; color: #2b6cb0; margin-top: 3px; }

/* 登録アンケート「どちらで知ったか」 */
.kf-group {
    margin-top: 22px;
    padding: 10px 12px 12px;
    background: #f9fafb;
    border: 1px dashed #d7dee6;
    border-radius: 6px;
}
.form-group label.kf-title { font-size: 11.5px; font-weight: 500; color: #718096; margin-bottom: 2px; }
.kf-group .kf-title .req { background: #a0aec0; font-size: .6rem; padding: 0 5px; }
.kf-list { display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; margin-top: 3px; }
.form-group label.kf-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    margin-bottom: 0;
    cursor: pointer;
    font-size: 11.5px;
    font-weight: 400;
    line-height: 1.8;
    color: #4a5568;
}
.kf-item input[type="radio"] { flex: none; width: 13px; height: 13px; margin: 0; }
.kf-item:has(input[type="radio"]:checked) { color: #2b6cb0; }
.form-group input[type="text"].kf-detail {
    width: 150px;
    max-width: 100%;
    padding: 2px 6px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 11.5px;
    line-height: 1.6;
    background: #fff;
}
.plan-price small { font-size: .74rem; font-weight: 400; color: #718096; margin-left: 3px; }

/* ---- ご契約カード（studio_top.html） ---- */
.plan-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.plan-current { font-size: 1.15rem; font-weight: 600; color: var(--text); }
.plan-tag {
    padding: 2px 10px;
    border-radius: 3px;
    background: #fffaf0;
    border: 1px solid #f0d9a8;
    color: #8a5a00;
    font-size: .74rem;
}
.plan-tag--alert { background: #fff5f5; border-color: #f5c6c6; color: #a02020; }

.plan-usage-text { font-size: .88rem; color: #4a5568; margin-bottom: 6px; }
.plan-usage-pct  { margin-left: 8px; color: #718096; font-size: .8rem; }
.plan-usage-bar {
    height: 7px;
    border-radius: 4px;
    background: #e2e8f0;
    overflow: hidden;
}
.plan-usage-bar span { display: block; height: 100%; background: #2f9e5f; }
.plan-usage-bar span.is-warn   { background: #dd8f20; }
.plan-usage-bar span.is-danger { background: #e53e3e; }

.plan-renew { margin: 12px 0 0; font-size: .85rem; color: #4a5568; }
.plan-renew-note { color: #a0aec0; font-size: .78rem; margin-left: 4px; }

.plan-upsell {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #edf2f7;
}
.plan-upsell-lead { margin: 0 0 8px; font-size: .84rem; color: #4a5568; }
.plan-upsell-list { list-style: none; margin: 0; padding: 0; font-size: .85rem; }
.plan-upsell-list li {
    display: flex;
    gap: 10px;
    align-items: baseline;
    padding: 5px 0;
    border-bottom: 1px dotted #e2e8f0;
}
.plan-upsell-list li:last-child { border-bottom: none; }
.plan-upsell-list span { margin-left: auto; color: #2b6cb0; font-weight: 600; }
.plan-upsell-note { margin: 8px 0 0; font-size: .78rem; color: #a0aec0; }

/* ---- ヘッダーのコースバッジ（_studio_header.html） ---- */
.header-course {
    padding: 3px 11px;
    border-radius: 3px;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    color: #fff;
    font-size: .76rem;
    text-decoration: none;
    white-space: nowrap;
}
.header-course:hover  { background: rgba(255,255,255,.28); }
.header-course.is-alert {
    background: #e53e3e;
    border-color: #e53e3e;
}

/* ---- コース変更モーダル（studio_top.html） ---- */
.plan-modal-lead { font-size: .86rem; line-height: 1.8; color: #4a5568; margin: 0 0 14px; }
.plan-modal-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.plan-modal-calc {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f7fafc;
    padding: 12px 14px;
    margin-bottom: 14px;
}
.plan-modal-calc-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: .86rem;
    color: #4a5568;
}
.plan-modal-calc-head strong { font-size: 1.25rem; color: #2b6cb0; }
.plan-modal-lines { list-style: none; margin: 8px 0 0; padding: 8px 0 0; border-top: 1px dotted #cbd5e0; }
.plan-modal-lines li {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    font-size: .78rem;
    color: #718096;
    padding: 2px 0;
}
.plan-modal-lines em { font-style: normal; white-space: nowrap; }
.plan-modal-note { margin: 8px 0 0; font-size: .78rem; color: #718096; }
.plan-modal-why {
    margin: 0 0 10px;
    padding: 8px 12px;
    border-radius: 4px;
    background: #ebf8ff;
    border: 1px solid #bee3f8;
    color: #2c5282;
    font-size: .8rem;
    line-height: 1.75;
}
.plan-modal-next {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #cbd5e0;
    font-size: .84rem;
    color: #4a5568;
}
.plan-modal-next strong { font-size: .98rem; color: var(--text); }

/* ---- 上位プランへの変更ボタン（studio_top.html） ---- */
.btn-upgrade {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #2b6cb0 0%, #3f8ed0 100%);
    color: #fff;
    font-size: .92rem;
    font-weight: 600;
    letter-spacing: .02em;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(43,108,176,.30);
    transition: transform .12s, box-shadow .12s, filter .12s;
}
.btn-upgrade:hover {
    filter: brightness(1.06);
    box-shadow: 0 4px 12px rgba(43,108,176,.38);
    transform: translateY(-1px);
}
.btn-upgrade:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(43,108,176,.30); }
.btn-upgrade-icon {
    width: 20px; height: 20px;
    flex-shrink: 0;
    padding: 3px;
    border-radius: 4px;
    background: rgba(255,255,255,.18);
}
.btn-upgrade-arrow {
    width: 16px; height: 16px;
    flex-shrink: 0;
    opacity: .75;
    transition: transform .12s;
}
.btn-upgrade:hover .btn-upgrade-arrow { transform: translateX(3px); opacity: 1; }

/* ---- メール通知パネル（studio_project_regist / edit） ----
   チェック1件ずつを枠で囲むと重いので、通知設定全体を1枚の枠にまとめ、
   中は細線で区切る。注釈はチェックの字下げ位置に揃える。 */
.notify-panel {
    border: 1px solid var(--input-border);
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
}
.notify-row {
    padding: 12px 14px;
}
.notify-row + .notify-row {
    border-top: 1px solid #edf2f7;
}
.notify-line {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: .9rem;
    line-height: 1.6;
    cursor: pointer;
}
.notify-line input {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 2px;
    cursor: pointer;
}
.notify-row:has(input:checked) { background: #f5f9fd; }

/* 注釈・日数入力はチェックの文字位置に揃える（16px + gap 9px） */
.notify-sub {
    margin: 5px 0 0 25px;
    font-size: .78rem;
    line-height: 1.75;
    color: #718096;
}
.notify-sub.expires-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

/* ---- 上位プランへの変更ボタン（studio_top.html） ---- */
.btn-upgrade {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #2b6cb0 0%, #3f8ed0 100%);
    color: #fff;
    font-size: .92rem;
    font-weight: 600;
    letter-spacing: .02em;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(43,108,176,.30);
    transition: transform .12s, box-shadow .12s, filter .12s;
}
.btn-upgrade:hover {
    filter: brightness(1.06);
    box-shadow: 0 4px 12px rgba(43,108,176,.38);
    transform: translateY(-1px);
}
.btn-upgrade:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(43,108,176,.30); }
.btn-upgrade-icon {
    width: 20px; height: 20px;
    flex-shrink: 0;
    padding: 3px;
    border-radius: 4px;
    background: rgba(255,255,255,.18);
}
.btn-upgrade-arrow {
    width: 16px; height: 16px;
    flex-shrink: 0;
    opacity: .75;
    transition: transform .12s;
}
.btn-upgrade:hover .btn-upgrade-arrow { transform: translateX(3px); opacity: 1; }


/* ---- コース変更の完了モーダル（studio_top.html） ---- */
.plan-done-icon { text-align: center; margin-bottom: 6px; }
.plan-done-icon svg { width: 64px; height: 64px; }
.plan-done-body {
    margin: 10px 0 4px;
    font-size: .88rem;
    line-height: 1.9;
    color: #4a5568;
    text-align: center;
}

/* ---- コース変更の最終確認（studio_top.html） ---- */
.plan-confirm-table { width: 100%; font-size: .88rem; margin-bottom: 14px; }
.plan-confirm-table th { white-space: nowrap; width: 9em; }
.plan-confirm-table strong { font-size: 1.15rem; color: #2b6cb0; }
.plan-confirm-warn { margin-bottom: 4px; font-size: .82rem; line-height: 1.8; }
.plan-confirm-agree {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    margin-bottom: 4px;
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius);
    font-size: .86rem;
    cursor: pointer;
}
.plan-confirm-agree:has(input:checked) { border-color: #2b6cb0; background: #ebf4fb; }
.plan-confirm-agree input { width: 16px; height: 16px; flex-shrink: 0; cursor: pointer; }

/* ---- 押せないボタンの見た目（共通） ----
   disabled で色が変わらないと、押せるつもりで連打されるので明示する。
   .btn-primary より詳細度が高く、かつファイル末尾なので !important は不要。 */
.btn:disabled,
.btn[disabled] {
    background: #e2e8f0;
    border-color: #e2e8f0;
    color: #a0aec0;
    cursor: not-allowed;
    box-shadow: none;
}
.btn:disabled:hover,
.btn[disabled]:hover {
    background: #e2e8f0;
    border-color: #e2e8f0;
    filter: none;
    transform: none;
}

/* ---- お支払い情報（studio_billing.html） ---- */
.billing-alert { margin-bottom: 16px; line-height: 1.85; }
.billing-table th { white-space: nowrap; width: 10em; }
.billing-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius);
    max-width: 380px;
}
.billing-card.is-soon    { border-color: #f0d9a8; background: #fffaf0; }
.billing-card.is-expired { border-color: #f5c6c6; background: #fff5f5; }
.billing-card-icon { width: 30px; height: 30px; color: #718096; flex-shrink: 0; }
.billing-card-body { display: flex; flex-direction: column; gap: 3px; }
.billing-card-no  { font-size: 1rem; font-weight: 600; letter-spacing: .04em; }
.billing-card-exp { font-size: .8rem; color: #718096; }
.billing-card-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 3px;
    font-style: normal;
    font-size: .72rem;
}
.billing-card-tag.is-soon    { background: #fffaf0; border: 1px solid #f0d9a8; color: #8a5a00; }
.billing-card-tag.is-expired { background: #fff5f5; border: 1px solid #f5c6c6; color: #a02020; }

/* サイドバーの警告アイコン */
.nav-alert {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px; height: 16px;
    margin-left: 6px;
    border-radius: 50%;
    background: #e53e3e;
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    flex-shrink: 0;
}
.plan-downgrade-note { margin-bottom: 14px; font-size: .82rem; line-height: 1.8; }
.plan-confirm-sub {
    margin: 0 0 12px;
    font-size: .78rem;
    color: #718096;
    text-align: center;
}
.cancel-panel { margin-bottom: 4px; }
.cancel-panel .notify-line span { font-size: .85rem; }
.billing-cancel-link { margin: 14px 0 0; font-size: .8rem; }
.billing-cancel-link a { color: #a0aec0; text-decoration: underline; }
.billing-cancel-link a:hover { color: #718096; }
.cancel-actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; }

/* ---- ログイン（2段階認証の各段） ---- */
.login-lead { font-size: .86rem; line-height: 1.9; color: #4a5568; margin: 0 0 16px; }
.login-sub-form { margin-top: 14px; text-align: center; }

/* ---- パスキー ---- */
.login-or {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0 14px;
    color: #a0aec0;
    font-size: .78rem;
}
.login-or::before, .login-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}
.btn-passkey {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px;
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius);
    background: #fff;
    font-size: .92rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.btn-passkey:hover:not(:disabled) { border-color: #90b4d8; background: #f7fafc; }
.btn-passkey:disabled { color: #a0aec0; cursor: not-allowed; }
.btn-passkey svg { width: 20px; height: 20px; flex-shrink: 0; }
.login-passkey-note { margin: 8px 0 0; font-size: .76rem; line-height: 1.7; color: #718096; text-align: center; }
.passkey-add { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.passkey-name { min-width: 220px; }

/* パスキーが使えそうな端末では主従を入れ替える。
   DOMの順序は変えず order で並べ替えるので、非対応環境では従来どおり */
.login-pw-toggle { display: none; }

.has-passkey .login-card         { display: flex; flex-direction: column; }
.has-passkey .login-logo         { order: 1; }
.has-passkey .login-title        { order: 2; }
.has-passkey .alert              { order: 3; }
.has-passkey .login-passkey-block{ order: 4; }
.has-passkey .login-pw-toggle    { order: 5; display: block; width: 100%; margin-top: 18px; }
.has-passkey .login-pw-block     { order: 6; display: none; }
.has-passkey .login-pw-block.is-open { display: block; }
.has-passkey .login-or           { display: none; }

/* 主役になったパスキーのボタンは塗りにする */
.has-passkey .btn-passkey {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
    padding: 13px;
    font-size: .98rem;
}
.has-passkey .btn-passkey:hover:not(:disabled) { border-color: var(--accent-hover); background: var(--accent-hover); }
.has-passkey .btn-passkey:disabled { border-color: var(--input-border); background: #fff; color: #a0aec0; }

/* パスキーのおすすめカード */
.card-suggest { border-left: 4px solid var(--accent); }
.suggest-body { display: flex; gap: 18px; align-items: flex-start; }
.suggest-icon { width: 40px; height: 40px; flex-shrink: 0; color: var(--accent); margin-top: 2px; }
.suggest-text { flex: 1; min-width: 0; }
.suggest-text h2 { margin: 0 0 8px; font-size: 1.02rem; }
.suggest-text p  { margin: 0; font-size: .86rem; line-height: 1.8; color: #4a5568; }
.suggest-actions { display: flex; gap: 18px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
@media (max-width: 600px) {
    .suggest-body { flex-direction: column; gap: 12px; }
}
.suggest-caution { margin: 10px 0 0; font-size: .8rem; line-height: 1.75; color: #975a16; }
/* 注意書き。アイコン＋左の色帯で「読むもの」と分かるようにする。
   アイコンはCSSで差し込むのでテンプレート側は <strong> と <p> を並べるだけでよい */
.note-caution {
    display: grid;
    grid-template-columns: 20px 1fr;
    column-gap: 12px;
    margin: 0 0 16px;
    padding: 14px 16px 14px 14px;
    background: #fffbeb;
    border: 1px solid #fde3a7;
    border-left: 4px solid #e8a020;
    border-radius: 8px;
}
.note-caution::before {
    content: "";
    grid-column: 1;
    grid-row: 1 / span 30;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d97706' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/><line x1='12' y1='9' x2='12' y2='13'/><line x1='12' y1='17' x2='12.01' y2='17'/></svg>") no-repeat center / contain;
}
.note-caution > * { grid-column: 2; min-width: 0; }
.note-caution strong {
    display: block;
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.6;
    color: #92400e;
    letter-spacing: .01em;
}
.note-caution p {
    margin: 5px 0 0;
    font-size: .82rem;
    line-height: 1.85;
    color: #7c5219;
}
.note-caution p + p { margin-top: 8px; }
.note-caution a { color: #92400e; }
.passkey-add label { font-size: .84rem; font-weight: 600; white-space: nowrap; }
.passkey-add .req {
    display: inline-block; margin-left: 6px; padding: 1px 6px;
    background: #c53030; color: #fff; border-radius: 3px; font-size: 11px; font-weight: 700;
}
.passkey-name.iserr { border-color: var(--error); background: #ffe8e8; }

/* ------------------------------------------------------------
   セキュリティ設定：ログイン履歴・操作履歴
   ------------------------------------------------------------ */
.log-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.log-tab {
    padding: 8px 16px;
    font-size: .86rem;
    font-weight: 600;
    color: var(--text-light);
    text-decoration: none;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    margin-bottom: -1px;
}
.log-tab:hover { color: var(--text); background: #f1f5f9; }
.log-tab.is-active {
    color: var(--primary);
    background: var(--surface);
    border-color: var(--border);
    border-bottom: 1px solid var(--surface);
}
.log-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 99px;
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
}
.log-badge-ok { background: #f0f7ff; border-color: #bfd4f6; color: #2c5282; }
.log-badge-ng { background: #fff5f5; border-color: #feb2b2; color: #c53030; }
.log-list td { font-size: .84rem; }
.log-col-from { white-space: nowrap; color: var(--text-light); font-size: .78rem; }
.log-ua { display: block; color: #a0aec0; }

/* ------------------------------------------------------------
   会員情報（studio/account.php）
   ------------------------------------------------------------ */
.acc-current {
    font-size: .95rem;
    font-weight: 600;
    color: var(--text);
    padding: 8px 0;
}
.acc-code-form .reg-code { max-width: 200px; }
.acc-code-sub {
    display: flex;
    gap: 18px;
    margin-top: 12px;
}
.acc-passkey-reset { margin: 4px 0 18px; }
.acc-passkey-reset label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: .86rem;
    font-weight: 600;
    color: #744210;
    cursor: pointer;
}
.acc-passkey-reset input[type="checkbox"] { margin-top: 3px; }

/* ------------------------------------------------------------
   スタッフ（studio/staff.php）
   ------------------------------------------------------------ */
.staff-me {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 99px;
    background: #f0f7ff;
    border: 1px solid #bfd4f6;
    color: #2c5282;
    font-size: 11px;
    font-weight: 600;
}
.staff-status {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 600;
    border: 1px solid transparent;
}
.staff-status--active   { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.staff-status--invited  { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.staff-status--disabled { background: #f1f3f5; border-color: #e2e8f0; color: #8b919b; }
.staff-status--retired  { background: #f8f9fa; border-color: #e9ecef; color: #adb5bd; }
.staff-role { padding: 3px 8px; font-size: .82rem; }
.staff-actions { white-space: nowrap; }
.staff-actions .inline-form { margin-right: 4px; }
.staff-role-pick {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 0;
    font-size: .86rem;
    cursor: pointer;
}
.staff-role-pick input[type="radio"] { margin-top: 4px; }
.acc-staff-link {
    margin: -8px 0 20px;
    font-size: .84rem;
}
.log-actor { white-space: nowrap; font-size: .82rem; }
.proj-owner-sel { border: none; outline: none; font-size: 13px; background: transparent; max-width: 140px; }
.proj-owner-cell { white-space: nowrap; color: var(--text-light); font-size: .88em; }
.readonly-note { margin-bottom: 18px; }

/* ------------------------------------------------------------
   権限が無いときの操作UI（要素は残し、押せないことを見せる）
   ------------------------------------------------------------ */
.btn:disabled,
.btn-danger-sm:disabled,
.btn.is-disabled,
.evt-photo-del:disabled,
.btn-rename-pencil:disabled {
    opacity: .4;
    cursor: not-allowed;
    filter: grayscale(60%);
}
.btn.is-disabled { display: inline-block; text-decoration: none; }
.drop-zone-locked {
    background: #f1f3f5;
    border-color: #cbd5e0;
    cursor: not-allowed;
}
.drop-zone-locked .drop-icon { opacity: .4; }
.drop-lock-text { color: #718096; font-weight: 600; }
.drop-lock-sub  { color: #a0aec0; font-size: .85em; display: block; margin-top: 4px; }
.staff-proj-cell { white-space: nowrap; color: var(--text-light); font-size: .88em; }
.staff-handover {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.staff-handover select { min-width: 220px; }
.staff-handover-arrow { color: var(--text-light); font-weight: 700; }

/* 確認モーダル（js/ui_confirm.js が生成する） */
.ui-confirm-msg {
    font-size: .88rem;
    line-height: 1.9;
    color: var(--text);
    margin-bottom: 6px;
}
/* 確認モーダルの実行ボタンは、押す先が分かるよう塗りつぶしにする */
.ui-confirm-ok.btn-danger {
    background: #c53030;
    border-color: #c53030;
    color: #fff;
}
.ui-confirm-ok.btn-danger:hover { background: #9b2c2c; border-color: #9b2c2c; }
.ui-confirm .ui-modal-actions { margin-top: 16px; }
.ui-confirm .ui-modal-title { font-size: 1.02rem; }

/* 例外的な操作の確認（コース変更など）。いつもの確認と見分けがつくよう強く出す */
.ui-confirm.is-alarm .ui-modal-box {
    border: 3px solid #c53030;
    padding: 0 0 20px;
    overflow: hidden;
}
.ui-confirm.is-alarm .ui-modal-title {
    background: #c53030;
    color: #fff;
    font-size: 1.06rem;
    margin: 0 0 16px;
    padding: 14px 22px;
}
.ui-confirm.is-alarm .ui-modal-title::before { content: "⚠ "; }
.ui-confirm.is-alarm .ui-confirm-msg { padding: 0 22px; }
.ui-confirm.is-alarm .ui-modal-actions { padding: 0 22px; }
.ui-confirm.is-alarm .ui-confirm-msg strong { color: #c53030; }

/* 迷ったら戻れるように、「やめる」を主役にする。
   実行ボタンは押せるが目立たせない（並びも逆にして左を実行にする） */
.ui-confirm.is-alarm .ui-modal-actions {
    flex-direction: row-reverse;
    justify-content: flex-start;
    align-items: center;
    gap: 14px;
    margin-top: 22px;
}
.ui-confirm.is-alarm .ui-confirm-cancel {
    flex: 1 1 auto;
    padding: 14px 20px;
    font-size: 1.02rem;
    font-weight: 700;
    background: #2b6cb0;
    color: #fff;
    border: none;
}
.ui-confirm.is-alarm .ui-confirm-cancel:hover { background: #245a94; color: #fff; }
.ui-confirm.is-alarm .ui-confirm-ok.btn-danger {
    flex: 0 0 auto;
    padding: 8px 14px;
    font-size: .82rem;
    background: #fff;
    color: #c53030;
    border: 1px solid #c53030;
}
.ui-confirm.is-alarm .ui-confirm-ok.btn-danger:hover { background: #fff5f5; color: #c53030; }

/* サイドバー下部のリンク（操作マニュアルなど） */
.sidebar-footer {
    margin: 6px 0;
    padding: 8px 0;
    border-top: 1px solid rgba(255,255,255,.12);
}
.sidebar-footer-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: rgba(255,255,255,.7);
    font-size: 12.5px;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.sidebar-footer-link:hover { background: rgba(255,255,255,.12); color: #fff; }
.sidebar-footer-link svg { width: 16px; height: 16px; flex-shrink: 0; }

a.btn-upgrade { text-decoration: none; }

/* 処理中モーダル（js/studio.js の studioBusy）
   削除など時間のかかる操作で、二重に押されないよう画面を覆う */
.busy-note {
    font-size: 12px;
    color: var(--text-light);
    padding-bottom: 4px;
}

/* アプリのダウンロード誘導（撮影アプリ・原本収集ツールで共用） */
.app-dl-desc { font-size:.88rem; line-height:1.8; color:#4a5568; margin:0 0 14px; }
.app-dl-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.app-dl-btn { display:inline-flex; align-items:center; gap:8px; }
.app-dl-btn.is-disabled { opacity:.5; cursor:not-allowed; }
.app-dl-ver { font-size:.8rem; color:#718096; }
.app-dl-note { font-size:.8rem; color:#718096; margin:12px 0 0; }
/* 撮影アプリと原本収集ツールの横並び。狭い画面では自動で1列に落ちる */
.app-dl-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(400px,1fr)); gap:20px; }
.app-dl-item { display:flex; flex-direction:column; min-width:0; }
.app-dl-item > .card { flex:1; }
/* スマホはダウンロードしても使えない。ボタンを隠して一行の案内に差し替える */
.app-dl-sp-note { display:none; font-size:.8rem; color:#718096; margin:0; line-height:1.7; }
@media (max-width: 768px) {
    .app-dl-actions,
    .app-dl-note { display:none; }
    .app-dl-sp-note { display:block; }
    .app-dl-desc { margin-bottom:10px; }
}

/* ------------------------------------------------------------
   ご利用終了のご案内（studio/expired.php）
   サイドバーもダッシュボードも出さない1枚もの。
   お申し込みへ迷わず進めることだけを考えた画面
   ------------------------------------------------------------ */
.expired-wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}
.expired-lead { text-align: center; margin-bottom: 30px; }
.expired-lead h1 { font-size: 1.5rem; color: var(--text); margin-bottom: 14px; }
.expired-lead p { color: #4a5568; line-height: 1.9; }
.expired-meta { margin-top: 10px; font-size: .86rem; color: #718096; }

.expired-data {
    background: #fffaf0;
    border: 1px solid #f6c752;
    border-radius: 8px;
    padding: 16px 20px;
    line-height: 1.9;
    font-size: .9rem;
    color: #744210;
    margin-bottom: 30px;
}
.expired-data.is-gone { background: #f7fafc; border-color: var(--border); color: #4a5568; }
.expired-data strong { display: block; }

.expired-plans h2 { font-size: 1.05rem; text-align: center; margin-bottom: 18px; }
.expired-plans .plan-cards { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.expired-plans .plan-card {
    flex: 1 1 240px;
    max-width: 300px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 22px 20px;
    text-align: center;
    background: #fff;
}
.expired-plans .plan-name  { font-weight: 700; font-size: 1.1rem; margin-bottom: 6px; }
.expired-plans .plan-size  { color: #4a5568; font-size: .88rem; margin-bottom: 12px; }
.expired-plans .plan-price { margin-bottom: 16px; color: #4a5568; font-size: .82rem; }
.expired-plans .plan-price span { font-size: 1.3rem; font-weight: 700; color: var(--text); }
.expired-plans .plan-price small { font-size: .74rem; color: #718096; }
.expired-plans .plan-same {
    font-size: .74rem;
    color: #718096;
    margin: -8px 0 10px;
}
.expired-plans .plan-btn { width: 100%; padding: 13px 0; font-size: .96rem; font-weight: 700; }
.expired-note { margin-top: 18px; font-size: .8rem; color: #718096; line-height: 1.9; text-align: center; }
.expired-contact { margin-top: 34px; text-align: center; font-size: .84rem; color: #718096; }

@media screen and (max-width: 640px) {
    .expired-wrap { padding: 30px 16px 60px; }
    .expired-plans .plan-cards { flex-direction: column; align-items: stretch; }
    .expired-plans .plan-card { max-width: none; }
}

/* ご契約カードの期限notice（まもなく更新／解約済み） */
.plan-notice {
    margin-top: 12px;
    padding: 11px 14px;
    border-radius: 6px;
    background: #fffaf0;
    border: 1px solid #f6c752;
    color: #744210;
    font-size: .82rem;
    line-height: 1.85;
}
.plan-notice.is-alert { background: #fff5f5; border-color: #fbb6b6; color: #9b2c2c; }
.plan-notice strong { display: block; }
.plan-notice a { color: inherit; text-decoration: underline; }

/* 管理画面：流入（アンケート）集計 */
.kf-agg td, .kf-agg th { vertical-align: top; }
.kf-agg .kf-num { text-align: right; white-space: nowrap; }
.kf-agg .kf-bar-col { width: 200px; white-space: nowrap; }
.kf-agg tr.kf-zero { color: #a0aec0; }
.kf-bar {
    display: inline-block;
    width: 130px;
    height: 8px;
    background: #edf2f7;
    border-radius: 4px;
    overflow: hidden;
    vertical-align: middle;
}
.kf-bar > span { display: block; height: 100%; background: #2b6cb0; }
.kf-pct { font-size: .8rem; color: #4a5568; margin-left: 6px; }
.kf-detail-list { margin: 6px 0 0; padding-left: 1.1em; font-size: .82rem; color: #4a5568; }
.kf-detail-list li { margin-bottom: 2px; }
.kf-detail-num { color: #2b6cb0; font-weight: 600; }
